| 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) { |
| 97 | mCleanupCallbacks.insert({handle, cb}); |
| 98 | } |
| 99 | |
| 100 | void unregisterCleanupCallback(void* handle) { |
| 101 | mCleanupCallbacks.erase(handle); |
| 102 | } |
| 103 | |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 104 | Lock lock; |
| 105 | |
| Lingfeng Yang | a126a8a | 2018-11-01 18:21:40 -0700 | [diff] [blame] | 106 | private: |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 107 | VulkanCountingStream m_countingStream; |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 108 | VulkanStreamGuest m_stream; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 109 | Pool m_pool { 8, 4096, 64 }; |
| Lingfeng Yang | 29c99d9 | 2018-11-30 11:15:29 -0800 | [diff] [blame] | 110 | |
| 111 | Validation m_validation; |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 112 | bool m_logEncodes; |
| Lingfeng Yang | 39a276e | 2019-06-17 13:27:22 -0700 | [diff] [blame^] | 113 | |
| 114 | std::unordered_map<void*, VkEncoder::CleanupCallback> mCleanupCallbacks; |
| Lingfeng Yang | a126a8a | 2018-11-01 18:21:40 -0700 | [diff] [blame] | 115 | }; |
| 116 | |
| 117 | VkEncoder::VkEncoder(IOStream *stream) : |
| 118 | mImpl(new VkEncoder::Impl(stream)) { } |
| Lingfeng Yang | 60b411d | 2018-11-29 00:26:45 -0800 | [diff] [blame] | 119 | |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 120 | void VkEncoder::flush() { |
| 121 | mImpl->flush(); |
| 122 | } |
| 123 | |
| Lingfeng Yang | 39a276e | 2019-06-17 13:27:22 -0700 | [diff] [blame^] | 124 | void VkEncoder::registerCleanupCallback(void* handle, VkEncoder::CleanupCallback cb) { |
| 125 | mImpl->registerCleanupCallback(handle, cb); |
| 126 | } |
| 127 | |
| 128 | void VkEncoder::unregisterCleanupCallback(void* handle) { |
| 129 | mImpl->unregisterCleanupCallback(handle); |
| 130 | } |
| 131 | |
| Lingfeng Yang | 60b411d | 2018-11-29 00:26:45 -0800 | [diff] [blame] | 132 | #define VALIDATE_RET(retType, success, validate) \ |
| 133 | retType goldfish_vk_validateResult = validate; \ |
| 134 | if (goldfish_vk_validateResult != success) return goldfish_vk_validateResult; \ |
| 135 | |
| 136 | #define VALIDATE_VOID(validate) \ |
| 137 | VkResult goldfish_vk_validateResult = validate; \ |
| 138 | if (goldfish_vk_validateResult != VK_SUCCESS) return; \ |
| 139 | |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 140 | #ifdef VK_VERSION_1_0 |
| 141 | VkResult VkEncoder::vkCreateInstance( |
| 142 | const VkInstanceCreateInfo* pCreateInfo, |
| 143 | const VkAllocationCallbacks* pAllocator, |
| 144 | VkInstance* pInstance) |
| 145 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 146 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 147 | AEMU_SCOPED_TRACE("vkCreateInstance encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 148 | mImpl->log("start vkCreateInstance"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 149 | auto stream = mImpl->stream(); |
| 150 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 151 | auto resources = mImpl->resources(); |
| 152 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 153 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 154 | VkInstanceCreateInfo* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 155 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 156 | local_pCreateInfo = nullptr; |
| 157 | if (pCreateInfo) |
| 158 | { |
| 159 | local_pCreateInfo = (VkInstanceCreateInfo*)pool->alloc(sizeof(const VkInstanceCreateInfo)); |
| 160 | deepcopy_VkInstanceCreateInfo(pool, pCreateInfo, (VkInstanceCreateInfo*)(local_pCreateInfo)); |
| 161 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 162 | local_pAllocator = nullptr; |
| 163 | if (pAllocator) |
| 164 | { |
| 165 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 166 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 167 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 168 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 169 | if (local_pCreateInfo) |
| 170 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 171 | transform_tohost_VkInstanceCreateInfo(mImpl->resources(), (VkInstanceCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 172 | } |
| 173 | if (local_pAllocator) |
| 174 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 175 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 176 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 177 | countingStream->rewind(); |
| 178 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 179 | marshal_VkInstanceCreateInfo(countingStream, (VkInstanceCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 180 | // WARNING PTR CHECK |
| 181 | uint64_t cgen_var_0 = (uint64_t)(uintptr_t)local_pAllocator; |
| 182 | countingStream->putBe64(cgen_var_0); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 183 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 184 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 185 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 186 | } |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 187 | uint64_t cgen_var_1; |
| 188 | countingStream->handleMapping()->mapHandles_VkInstance_u64(pInstance, &cgen_var_1, 1); |
| 189 | countingStream->write((uint64_t*)&cgen_var_1, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 190 | } |
| 191 | uint32_t packetSize_vkCreateInstance = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 192 | countingStream->rewind(); |
| 193 | uint32_t opcode_vkCreateInstance = OP_vkCreateInstance; |
| 194 | stream->write(&opcode_vkCreateInstance, sizeof(uint32_t)); |
| 195 | stream->write(&packetSize_vkCreateInstance, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 196 | marshal_VkInstanceCreateInfo(stream, (VkInstanceCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 197 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 198 | uint64_t cgen_var_2 = (uint64_t)(uintptr_t)local_pAllocator; |
| 199 | stream->putBe64(cgen_var_2); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 200 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 201 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 202 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 203 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 204 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 205 | uint64_t cgen_var_3; |
| 206 | stream->handleMapping()->mapHandles_VkInstance_u64(pInstance, &cgen_var_3, 1); |
| 207 | stream->write((uint64_t*)&cgen_var_3, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 208 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 209 | AEMU_SCOPED_TRACE("vkCreateInstance readParams"); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 210 | stream->setHandleMapping(resources->createMapping()); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 211 | uint64_t cgen_var_4; |
| 212 | stream->read((uint64_t*)&cgen_var_4, 8); |
| 213 | stream->handleMapping()->mapHandles_u64_VkInstance(&cgen_var_4, (VkInstance*)pInstance, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 214 | stream->unsetHandleMapping(); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 215 | AEMU_SCOPED_TRACE("vkCreateInstance returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 216 | VkResult vkCreateInstance_VkResult_return = (VkResult)0; |
| 217 | stream->read(&vkCreateInstance_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 218 | countingStream->clearPool(); |
| 219 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 220 | pool->freeAll(); |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 221 | encoderLock.unlock(); |
| Lingfeng Yang | f0654ff | 2019-02-02 12:21:24 -0800 | [diff] [blame] | 222 | mImpl->resources()->on_vkCreateInstance(this, vkCreateInstance_VkResult_return, pCreateInfo, pAllocator, pInstance); |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 223 | encoderLock.lock(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 224 | mImpl->log("finish vkCreateInstance");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 225 | return vkCreateInstance_VkResult_return; |
| 226 | } |
| 227 | |
| 228 | void VkEncoder::vkDestroyInstance( |
| 229 | VkInstance instance, |
| 230 | const VkAllocationCallbacks* pAllocator) |
| 231 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 232 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 233 | AEMU_SCOPED_TRACE("vkDestroyInstance encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 234 | mImpl->log("start vkDestroyInstance"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 235 | auto stream = mImpl->stream(); |
| 236 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 237 | auto resources = mImpl->resources(); |
| 238 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 239 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 240 | VkInstance local_instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 241 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 242 | local_instance = instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 243 | local_pAllocator = nullptr; |
| 244 | if (pAllocator) |
| 245 | { |
| 246 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 247 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 248 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 249 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 250 | if (local_pAllocator) |
| 251 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 252 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 253 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 254 | countingStream->rewind(); |
| 255 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 256 | uint64_t cgen_var_5; |
| 257 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_5, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 258 | countingStream->write((uint64_t*)&cgen_var_5, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 259 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 260 | uint64_t cgen_var_6 = (uint64_t)(uintptr_t)local_pAllocator; |
| 261 | countingStream->putBe64(cgen_var_6); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 262 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 263 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 264 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 265 | } |
| 266 | } |
| 267 | uint32_t packetSize_vkDestroyInstance = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 268 | countingStream->rewind(); |
| 269 | uint32_t opcode_vkDestroyInstance = OP_vkDestroyInstance; |
| 270 | stream->write(&opcode_vkDestroyInstance, sizeof(uint32_t)); |
| 271 | stream->write(&packetSize_vkDestroyInstance, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 272 | uint64_t cgen_var_7; |
| 273 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_7, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 274 | stream->write((uint64_t*)&cgen_var_7, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 275 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 276 | uint64_t cgen_var_8 = (uint64_t)(uintptr_t)local_pAllocator; |
| 277 | stream->putBe64(cgen_var_8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 278 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 279 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 280 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 281 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 282 | AEMU_SCOPED_TRACE("vkDestroyInstance readParams"); |
| 283 | AEMU_SCOPED_TRACE("vkDestroyInstance returnUnmarshal"); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 284 | resources->destroyMapping()->mapHandles_VkInstance((VkInstance*)&instance); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 285 | mImpl->log("finish vkDestroyInstance");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 286 | } |
| 287 | |
| 288 | VkResult VkEncoder::vkEnumeratePhysicalDevices( |
| 289 | VkInstance instance, |
| 290 | uint32_t* pPhysicalDeviceCount, |
| 291 | VkPhysicalDevice* pPhysicalDevices) |
| 292 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 293 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 294 | AEMU_SCOPED_TRACE("vkEnumeratePhysicalDevices encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 295 | mImpl->log("start vkEnumeratePhysicalDevices"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 296 | auto stream = mImpl->stream(); |
| 297 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 298 | auto resources = mImpl->resources(); |
| 299 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 300 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 301 | VkInstance local_instance; |
| 302 | local_instance = instance; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 303 | countingStream->rewind(); |
| 304 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 305 | uint64_t cgen_var_9; |
| 306 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_9, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 307 | countingStream->write((uint64_t*)&cgen_var_9, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 308 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 309 | uint64_t cgen_var_10 = (uint64_t)(uintptr_t)pPhysicalDeviceCount; |
| 310 | countingStream->putBe64(cgen_var_10); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 311 | if (pPhysicalDeviceCount) |
| 312 | { |
| 313 | countingStream->write((uint32_t*)pPhysicalDeviceCount, sizeof(uint32_t)); |
| 314 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 315 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 316 | uint64_t cgen_var_11 = (uint64_t)(uintptr_t)pPhysicalDevices; |
| 317 | countingStream->putBe64(cgen_var_11); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 318 | if (pPhysicalDevices) |
| 319 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 320 | if ((*(pPhysicalDeviceCount))) |
| 321 | { |
| 322 | uint64_t* cgen_var_12; |
| 323 | countingStream->alloc((void**)&cgen_var_12, (*(pPhysicalDeviceCount)) * 8); |
| 324 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(pPhysicalDevices, cgen_var_12, (*(pPhysicalDeviceCount))); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 325 | countingStream->write((uint64_t*)cgen_var_12, (*(pPhysicalDeviceCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 326 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 327 | } |
| 328 | } |
| 329 | uint32_t packetSize_vkEnumeratePhysicalDevices = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 330 | countingStream->rewind(); |
| 331 | uint32_t opcode_vkEnumeratePhysicalDevices = OP_vkEnumeratePhysicalDevices; |
| 332 | stream->write(&opcode_vkEnumeratePhysicalDevices, sizeof(uint32_t)); |
| 333 | stream->write(&packetSize_vkEnumeratePhysicalDevices, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 334 | uint64_t cgen_var_13; |
| 335 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_13, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 336 | stream->write((uint64_t*)&cgen_var_13, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 337 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 338 | uint64_t cgen_var_14 = (uint64_t)(uintptr_t)pPhysicalDeviceCount; |
| 339 | stream->putBe64(cgen_var_14); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 340 | if (pPhysicalDeviceCount) |
| 341 | { |
| 342 | stream->write((uint32_t*)pPhysicalDeviceCount, sizeof(uint32_t)); |
| 343 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 344 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 345 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 346 | uint64_t cgen_var_15 = (uint64_t)(uintptr_t)pPhysicalDevices; |
| 347 | stream->putBe64(cgen_var_15); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 348 | if (pPhysicalDevices) |
| 349 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 350 | if ((*(pPhysicalDeviceCount))) |
| 351 | { |
| 352 | uint64_t* cgen_var_16; |
| 353 | stream->alloc((void**)&cgen_var_16, (*(pPhysicalDeviceCount)) * 8); |
| 354 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(pPhysicalDevices, cgen_var_16, (*(pPhysicalDeviceCount))); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 355 | stream->write((uint64_t*)cgen_var_16, (*(pPhysicalDeviceCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 356 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 357 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 358 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 359 | AEMU_SCOPED_TRACE("vkEnumeratePhysicalDevices readParams"); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 360 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 361 | uint32_t* check_pPhysicalDeviceCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 362 | check_pPhysicalDeviceCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 363 | if (pPhysicalDeviceCount) |
| 364 | { |
| 365 | if (!(check_pPhysicalDeviceCount)) |
| 366 | { |
| 367 | fprintf(stderr, "fatal: pPhysicalDeviceCount inconsistent between guest and host\n"); |
| 368 | } |
| 369 | stream->read((uint32_t*)pPhysicalDeviceCount, sizeof(uint32_t)); |
| 370 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 371 | stream->setHandleMapping(resources->createMapping()); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 372 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 373 | VkPhysicalDevice* check_pPhysicalDevices; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 374 | check_pPhysicalDevices = (VkPhysicalDevice*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 375 | if (pPhysicalDevices) |
| 376 | { |
| 377 | if (!(check_pPhysicalDevices)) |
| 378 | { |
| 379 | fprintf(stderr, "fatal: pPhysicalDevices inconsistent between guest and host\n"); |
| 380 | } |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 381 | if ((*(pPhysicalDeviceCount))) |
| 382 | { |
| 383 | uint64_t* cgen_var_19; |
| 384 | stream->alloc((void**)&cgen_var_19, (*(pPhysicalDeviceCount)) * 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 385 | stream->read((uint64_t*)cgen_var_19, (*(pPhysicalDeviceCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 386 | stream->handleMapping()->mapHandles_u64_VkPhysicalDevice(cgen_var_19, (VkPhysicalDevice*)pPhysicalDevices, (*(pPhysicalDeviceCount))); |
| 387 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 388 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 389 | stream->unsetHandleMapping(); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 390 | AEMU_SCOPED_TRACE("vkEnumeratePhysicalDevices returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 391 | VkResult vkEnumeratePhysicalDevices_VkResult_return = (VkResult)0; |
| 392 | stream->read(&vkEnumeratePhysicalDevices_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 393 | countingStream->clearPool(); |
| 394 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 395 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 396 | mImpl->log("finish vkEnumeratePhysicalDevices");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 397 | return vkEnumeratePhysicalDevices_VkResult_return; |
| 398 | } |
| 399 | |
| 400 | void VkEncoder::vkGetPhysicalDeviceFeatures( |
| 401 | VkPhysicalDevice physicalDevice, |
| 402 | VkPhysicalDeviceFeatures* pFeatures) |
| 403 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 404 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 405 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceFeatures encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 406 | mImpl->log("start vkGetPhysicalDeviceFeatures"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 407 | auto stream = mImpl->stream(); |
| 408 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 409 | auto resources = mImpl->resources(); |
| 410 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 411 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 412 | VkPhysicalDevice local_physicalDevice; |
| 413 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 414 | countingStream->rewind(); |
| 415 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 416 | uint64_t cgen_var_20; |
| 417 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_20, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 418 | countingStream->write((uint64_t*)&cgen_var_20, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 419 | marshal_VkPhysicalDeviceFeatures(countingStream, (VkPhysicalDeviceFeatures*)(pFeatures)); |
| 420 | } |
| 421 | uint32_t packetSize_vkGetPhysicalDeviceFeatures = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 422 | countingStream->rewind(); |
| 423 | uint32_t opcode_vkGetPhysicalDeviceFeatures = OP_vkGetPhysicalDeviceFeatures; |
| 424 | stream->write(&opcode_vkGetPhysicalDeviceFeatures, sizeof(uint32_t)); |
| 425 | stream->write(&packetSize_vkGetPhysicalDeviceFeatures, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 426 | uint64_t cgen_var_21; |
| 427 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_21, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 428 | stream->write((uint64_t*)&cgen_var_21, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 429 | marshal_VkPhysicalDeviceFeatures(stream, (VkPhysicalDeviceFeatures*)(pFeatures)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 430 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceFeatures readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 431 | unmarshal_VkPhysicalDeviceFeatures(stream, (VkPhysicalDeviceFeatures*)(pFeatures)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 432 | if (pFeatures) |
| 433 | { |
| 434 | transform_fromhost_VkPhysicalDeviceFeatures(mImpl->resources(), (VkPhysicalDeviceFeatures*)(pFeatures)); |
| 435 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 436 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceFeatures returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 437 | mImpl->log("finish vkGetPhysicalDeviceFeatures");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 438 | } |
| 439 | |
| 440 | void VkEncoder::vkGetPhysicalDeviceFormatProperties( |
| 441 | VkPhysicalDevice physicalDevice, |
| 442 | VkFormat format, |
| 443 | VkFormatProperties* pFormatProperties) |
| 444 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 445 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 446 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceFormatProperties encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 447 | mImpl->log("start vkGetPhysicalDeviceFormatProperties"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 448 | auto stream = mImpl->stream(); |
| 449 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 450 | auto resources = mImpl->resources(); |
| 451 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 452 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 453 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 454 | VkFormat local_format; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 455 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 456 | local_format = format; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 457 | countingStream->rewind(); |
| 458 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 459 | uint64_t cgen_var_22; |
| 460 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_22, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 461 | countingStream->write((uint64_t*)&cgen_var_22, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 462 | countingStream->write((VkFormat*)&local_format, sizeof(VkFormat)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 463 | marshal_VkFormatProperties(countingStream, (VkFormatProperties*)(pFormatProperties)); |
| 464 | } |
| 465 | uint32_t packetSize_vkGetPhysicalDeviceFormatProperties = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 466 | countingStream->rewind(); |
| 467 | uint32_t opcode_vkGetPhysicalDeviceFormatProperties = OP_vkGetPhysicalDeviceFormatProperties; |
| 468 | stream->write(&opcode_vkGetPhysicalDeviceFormatProperties, sizeof(uint32_t)); |
| 469 | stream->write(&packetSize_vkGetPhysicalDeviceFormatProperties, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 470 | uint64_t cgen_var_23; |
| 471 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_23, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 472 | stream->write((uint64_t*)&cgen_var_23, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 473 | stream->write((VkFormat*)&local_format, sizeof(VkFormat)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 474 | marshal_VkFormatProperties(stream, (VkFormatProperties*)(pFormatProperties)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 475 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceFormatProperties readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 476 | unmarshal_VkFormatProperties(stream, (VkFormatProperties*)(pFormatProperties)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 477 | if (pFormatProperties) |
| 478 | { |
| 479 | transform_fromhost_VkFormatProperties(mImpl->resources(), (VkFormatProperties*)(pFormatProperties)); |
| 480 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 481 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceFormatProperties returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 482 | mImpl->log("finish vkGetPhysicalDeviceFormatProperties");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 483 | } |
| 484 | |
| 485 | VkResult VkEncoder::vkGetPhysicalDeviceImageFormatProperties( |
| 486 | VkPhysicalDevice physicalDevice, |
| 487 | VkFormat format, |
| 488 | VkImageType type, |
| 489 | VkImageTiling tiling, |
| 490 | VkImageUsageFlags usage, |
| 491 | VkImageCreateFlags flags, |
| 492 | VkImageFormatProperties* pImageFormatProperties) |
| 493 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 494 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 495 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceImageFormatProperties encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 496 | mImpl->log("start vkGetPhysicalDeviceImageFormatProperties"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 497 | auto stream = mImpl->stream(); |
| 498 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 499 | auto resources = mImpl->resources(); |
| 500 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 501 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 502 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 503 | VkFormat local_format; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 504 | VkImageType local_type; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 505 | VkImageTiling local_tiling; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 506 | VkImageUsageFlags local_usage; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 507 | VkImageCreateFlags local_flags; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 508 | local_physicalDevice = physicalDevice; |
| 509 | local_format = format; |
| 510 | local_type = type; |
| 511 | local_tiling = tiling; |
| 512 | local_usage = usage; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 513 | local_flags = flags; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 514 | countingStream->rewind(); |
| 515 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 516 | uint64_t cgen_var_24; |
| 517 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_24, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 518 | countingStream->write((uint64_t*)&cgen_var_24, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 519 | countingStream->write((VkFormat*)&local_format, sizeof(VkFormat)); |
| 520 | countingStream->write((VkImageType*)&local_type, sizeof(VkImageType)); |
| 521 | countingStream->write((VkImageTiling*)&local_tiling, sizeof(VkImageTiling)); |
| 522 | countingStream->write((VkImageUsageFlags*)&local_usage, sizeof(VkImageUsageFlags)); |
| 523 | countingStream->write((VkImageCreateFlags*)&local_flags, sizeof(VkImageCreateFlags)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 524 | marshal_VkImageFormatProperties(countingStream, (VkImageFormatProperties*)(pImageFormatProperties)); |
| 525 | } |
| 526 | uint32_t packetSize_vkGetPhysicalDeviceImageFormatProperties = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 527 | countingStream->rewind(); |
| 528 | uint32_t opcode_vkGetPhysicalDeviceImageFormatProperties = OP_vkGetPhysicalDeviceImageFormatProperties; |
| 529 | stream->write(&opcode_vkGetPhysicalDeviceImageFormatProperties, sizeof(uint32_t)); |
| 530 | stream->write(&packetSize_vkGetPhysicalDeviceImageFormatProperties, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 531 | uint64_t cgen_var_25; |
| 532 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_25, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 533 | stream->write((uint64_t*)&cgen_var_25, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 534 | stream->write((VkFormat*)&local_format, sizeof(VkFormat)); |
| 535 | stream->write((VkImageType*)&local_type, sizeof(VkImageType)); |
| 536 | stream->write((VkImageTiling*)&local_tiling, sizeof(VkImageTiling)); |
| 537 | stream->write((VkImageUsageFlags*)&local_usage, sizeof(VkImageUsageFlags)); |
| 538 | stream->write((VkImageCreateFlags*)&local_flags, sizeof(VkImageCreateFlags)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 539 | marshal_VkImageFormatProperties(stream, (VkImageFormatProperties*)(pImageFormatProperties)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 540 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceImageFormatProperties readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 541 | unmarshal_VkImageFormatProperties(stream, (VkImageFormatProperties*)(pImageFormatProperties)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 542 | if (pImageFormatProperties) |
| 543 | { |
| 544 | transform_fromhost_VkImageFormatProperties(mImpl->resources(), (VkImageFormatProperties*)(pImageFormatProperties)); |
| 545 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 546 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceImageFormatProperties returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 547 | VkResult vkGetPhysicalDeviceImageFormatProperties_VkResult_return = (VkResult)0; |
| 548 | stream->read(&vkGetPhysicalDeviceImageFormatProperties_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 549 | countingStream->clearPool(); |
| 550 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 551 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 552 | mImpl->log("finish vkGetPhysicalDeviceImageFormatProperties");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 553 | return vkGetPhysicalDeviceImageFormatProperties_VkResult_return; |
| 554 | } |
| 555 | |
| 556 | void VkEncoder::vkGetPhysicalDeviceProperties( |
| 557 | VkPhysicalDevice physicalDevice, |
| 558 | VkPhysicalDeviceProperties* pProperties) |
| 559 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 560 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 561 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceProperties encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 562 | mImpl->log("start vkGetPhysicalDeviceProperties"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 563 | auto stream = mImpl->stream(); |
| 564 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 565 | auto resources = mImpl->resources(); |
| 566 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 567 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 568 | VkPhysicalDevice local_physicalDevice; |
| 569 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 570 | countingStream->rewind(); |
| 571 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 572 | uint64_t cgen_var_26; |
| 573 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_26, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 574 | countingStream->write((uint64_t*)&cgen_var_26, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 575 | marshal_VkPhysicalDeviceProperties(countingStream, (VkPhysicalDeviceProperties*)(pProperties)); |
| 576 | } |
| 577 | uint32_t packetSize_vkGetPhysicalDeviceProperties = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 578 | countingStream->rewind(); |
| 579 | uint32_t opcode_vkGetPhysicalDeviceProperties = OP_vkGetPhysicalDeviceProperties; |
| 580 | stream->write(&opcode_vkGetPhysicalDeviceProperties, sizeof(uint32_t)); |
| 581 | stream->write(&packetSize_vkGetPhysicalDeviceProperties, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 582 | uint64_t cgen_var_27; |
| 583 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_27, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 584 | stream->write((uint64_t*)&cgen_var_27, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 585 | marshal_VkPhysicalDeviceProperties(stream, (VkPhysicalDeviceProperties*)(pProperties)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 586 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceProperties readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 587 | unmarshal_VkPhysicalDeviceProperties(stream, (VkPhysicalDeviceProperties*)(pProperties)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 588 | if (pProperties) |
| 589 | { |
| 590 | transform_fromhost_VkPhysicalDeviceProperties(mImpl->resources(), (VkPhysicalDeviceProperties*)(pProperties)); |
| 591 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 592 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceProperties returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 593 | mImpl->log("finish vkGetPhysicalDeviceProperties");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 594 | } |
| 595 | |
| 596 | void VkEncoder::vkGetPhysicalDeviceQueueFamilyProperties( |
| 597 | VkPhysicalDevice physicalDevice, |
| 598 | uint32_t* pQueueFamilyPropertyCount, |
| 599 | VkQueueFamilyProperties* pQueueFamilyProperties) |
| 600 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 601 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 602 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceQueueFamilyProperties encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 603 | mImpl->log("start vkGetPhysicalDeviceQueueFamilyProperties"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 604 | auto stream = mImpl->stream(); |
| 605 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 606 | auto resources = mImpl->resources(); |
| 607 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 608 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 609 | VkPhysicalDevice local_physicalDevice; |
| 610 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 611 | countingStream->rewind(); |
| 612 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 613 | uint64_t cgen_var_28; |
| 614 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_28, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 615 | countingStream->write((uint64_t*)&cgen_var_28, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 616 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 617 | uint64_t cgen_var_29 = (uint64_t)(uintptr_t)pQueueFamilyPropertyCount; |
| 618 | countingStream->putBe64(cgen_var_29); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 619 | if (pQueueFamilyPropertyCount) |
| 620 | { |
| 621 | countingStream->write((uint32_t*)pQueueFamilyPropertyCount, sizeof(uint32_t)); |
| 622 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 623 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 624 | uint64_t cgen_var_30 = (uint64_t)(uintptr_t)pQueueFamilyProperties; |
| 625 | countingStream->putBe64(cgen_var_30); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 626 | if (pQueueFamilyProperties) |
| 627 | { |
| 628 | for (uint32_t i = 0; i < (uint32_t)(*(pQueueFamilyPropertyCount)); ++i) |
| 629 | { |
| 630 | marshal_VkQueueFamilyProperties(countingStream, (VkQueueFamilyProperties*)(pQueueFamilyProperties + i)); |
| 631 | } |
| 632 | } |
| 633 | } |
| 634 | uint32_t packetSize_vkGetPhysicalDeviceQueueFamilyProperties = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 635 | countingStream->rewind(); |
| 636 | uint32_t opcode_vkGetPhysicalDeviceQueueFamilyProperties = OP_vkGetPhysicalDeviceQueueFamilyProperties; |
| 637 | stream->write(&opcode_vkGetPhysicalDeviceQueueFamilyProperties, sizeof(uint32_t)); |
| 638 | stream->write(&packetSize_vkGetPhysicalDeviceQueueFamilyProperties, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 639 | uint64_t cgen_var_31; |
| 640 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_31, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 641 | stream->write((uint64_t*)&cgen_var_31, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 642 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 643 | uint64_t cgen_var_32 = (uint64_t)(uintptr_t)pQueueFamilyPropertyCount; |
| 644 | stream->putBe64(cgen_var_32); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 645 | if (pQueueFamilyPropertyCount) |
| 646 | { |
| 647 | stream->write((uint32_t*)pQueueFamilyPropertyCount, sizeof(uint32_t)); |
| 648 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 649 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 650 | uint64_t cgen_var_33 = (uint64_t)(uintptr_t)pQueueFamilyProperties; |
| 651 | stream->putBe64(cgen_var_33); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 652 | if (pQueueFamilyProperties) |
| 653 | { |
| 654 | for (uint32_t i = 0; i < (uint32_t)(*(pQueueFamilyPropertyCount)); ++i) |
| 655 | { |
| 656 | marshal_VkQueueFamilyProperties(stream, (VkQueueFamilyProperties*)(pQueueFamilyProperties + i)); |
| 657 | } |
| 658 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 659 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceQueueFamilyProperties readParams"); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 660 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 661 | uint32_t* check_pQueueFamilyPropertyCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 662 | check_pQueueFamilyPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 663 | if (pQueueFamilyPropertyCount) |
| 664 | { |
| 665 | if (!(check_pQueueFamilyPropertyCount)) |
| 666 | { |
| 667 | fprintf(stderr, "fatal: pQueueFamilyPropertyCount inconsistent between guest and host\n"); |
| 668 | } |
| 669 | stream->read((uint32_t*)pQueueFamilyPropertyCount, sizeof(uint32_t)); |
| 670 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 671 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 672 | VkQueueFamilyProperties* check_pQueueFamilyProperties; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 673 | check_pQueueFamilyProperties = (VkQueueFamilyProperties*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 674 | if (pQueueFamilyProperties) |
| 675 | { |
| 676 | if (!(check_pQueueFamilyProperties)) |
| 677 | { |
| 678 | fprintf(stderr, "fatal: pQueueFamilyProperties inconsistent between guest and host\n"); |
| 679 | } |
| 680 | for (uint32_t i = 0; i < (uint32_t)(*(pQueueFamilyPropertyCount)); ++i) |
| 681 | { |
| 682 | unmarshal_VkQueueFamilyProperties(stream, (VkQueueFamilyProperties*)(pQueueFamilyProperties + i)); |
| 683 | } |
| 684 | } |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 685 | if (pQueueFamilyProperties) |
| 686 | { |
| 687 | for (uint32_t i = 0; i < (uint32_t)(*(pQueueFamilyPropertyCount)); ++i) |
| 688 | { |
| 689 | transform_fromhost_VkQueueFamilyProperties(mImpl->resources(), (VkQueueFamilyProperties*)(pQueueFamilyProperties + i)); |
| 690 | } |
| 691 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 692 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceQueueFamilyProperties returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 693 | mImpl->log("finish vkGetPhysicalDeviceQueueFamilyProperties");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 694 | } |
| 695 | |
| 696 | void VkEncoder::vkGetPhysicalDeviceMemoryProperties( |
| 697 | VkPhysicalDevice physicalDevice, |
| 698 | VkPhysicalDeviceMemoryProperties* pMemoryProperties) |
| 699 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 700 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 701 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceMemoryProperties encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 702 | mImpl->log("start vkGetPhysicalDeviceMemoryProperties"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 703 | auto stream = mImpl->stream(); |
| 704 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 705 | auto resources = mImpl->resources(); |
| 706 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 707 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 708 | VkPhysicalDevice local_physicalDevice; |
| 709 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 710 | countingStream->rewind(); |
| 711 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 712 | uint64_t cgen_var_36; |
| 713 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_36, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 714 | countingStream->write((uint64_t*)&cgen_var_36, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 715 | marshal_VkPhysicalDeviceMemoryProperties(countingStream, (VkPhysicalDeviceMemoryProperties*)(pMemoryProperties)); |
| 716 | } |
| 717 | uint32_t packetSize_vkGetPhysicalDeviceMemoryProperties = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 718 | countingStream->rewind(); |
| 719 | uint32_t opcode_vkGetPhysicalDeviceMemoryProperties = OP_vkGetPhysicalDeviceMemoryProperties; |
| 720 | stream->write(&opcode_vkGetPhysicalDeviceMemoryProperties, sizeof(uint32_t)); |
| 721 | stream->write(&packetSize_vkGetPhysicalDeviceMemoryProperties, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 722 | uint64_t cgen_var_37; |
| 723 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_37, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 724 | stream->write((uint64_t*)&cgen_var_37, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 725 | marshal_VkPhysicalDeviceMemoryProperties(stream, (VkPhysicalDeviceMemoryProperties*)(pMemoryProperties)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 726 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceMemoryProperties readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 727 | unmarshal_VkPhysicalDeviceMemoryProperties(stream, (VkPhysicalDeviceMemoryProperties*)(pMemoryProperties)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 728 | if (pMemoryProperties) |
| 729 | { |
| 730 | transform_fromhost_VkPhysicalDeviceMemoryProperties(mImpl->resources(), (VkPhysicalDeviceMemoryProperties*)(pMemoryProperties)); |
| 731 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 732 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceMemoryProperties returnUnmarshal"); |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 733 | encoderLock.unlock(); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 734 | mImpl->resources()->on_vkGetPhysicalDeviceMemoryProperties(this, physicalDevice, pMemoryProperties); |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 735 | encoderLock.lock(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 736 | mImpl->log("finish vkGetPhysicalDeviceMemoryProperties");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 737 | } |
| 738 | |
| 739 | PFN_vkVoidFunction VkEncoder::vkGetInstanceProcAddr( |
| 740 | VkInstance instance, |
| 741 | const char* pName) |
| 742 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 743 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 744 | AEMU_SCOPED_TRACE("vkGetInstanceProcAddr encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 745 | mImpl->log("start vkGetInstanceProcAddr"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 746 | auto stream = mImpl->stream(); |
| 747 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 748 | auto resources = mImpl->resources(); |
| 749 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 750 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 751 | VkInstance local_instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 752 | char* local_pName; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 753 | local_instance = instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 754 | local_pName = nullptr; |
| 755 | if (pName) |
| 756 | { |
| 757 | local_pName = pool->strDup(pName); |
| 758 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 759 | countingStream->rewind(); |
| 760 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 761 | uint64_t cgen_var_38; |
| 762 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_38, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 763 | countingStream->write((uint64_t*)&cgen_var_38, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 764 | countingStream->putString(local_pName); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 765 | } |
| 766 | uint32_t packetSize_vkGetInstanceProcAddr = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 767 | countingStream->rewind(); |
| 768 | uint32_t opcode_vkGetInstanceProcAddr = OP_vkGetInstanceProcAddr; |
| 769 | stream->write(&opcode_vkGetInstanceProcAddr, sizeof(uint32_t)); |
| 770 | stream->write(&packetSize_vkGetInstanceProcAddr, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 771 | uint64_t cgen_var_39; |
| 772 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_39, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 773 | stream->write((uint64_t*)&cgen_var_39, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 774 | stream->putString(local_pName); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 775 | AEMU_SCOPED_TRACE("vkGetInstanceProcAddr readParams"); |
| 776 | AEMU_SCOPED_TRACE("vkGetInstanceProcAddr returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 777 | PFN_vkVoidFunction vkGetInstanceProcAddr_PFN_vkVoidFunction_return = (PFN_vkVoidFunction)0; |
| 778 | stream->read(&vkGetInstanceProcAddr_PFN_vkVoidFunction_return, sizeof(PFN_vkVoidFunction)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 779 | countingStream->clearPool(); |
| 780 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 781 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 782 | mImpl->log("finish vkGetInstanceProcAddr");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 783 | return vkGetInstanceProcAddr_PFN_vkVoidFunction_return; |
| 784 | } |
| 785 | |
| 786 | PFN_vkVoidFunction VkEncoder::vkGetDeviceProcAddr( |
| 787 | VkDevice device, |
| 788 | const char* pName) |
| 789 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 790 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 791 | AEMU_SCOPED_TRACE("vkGetDeviceProcAddr encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 792 | mImpl->log("start vkGetDeviceProcAddr"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 793 | auto stream = mImpl->stream(); |
| 794 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 795 | auto resources = mImpl->resources(); |
| 796 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 797 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 798 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 799 | char* local_pName; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 800 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 801 | local_pName = nullptr; |
| 802 | if (pName) |
| 803 | { |
| 804 | local_pName = pool->strDup(pName); |
| 805 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 806 | countingStream->rewind(); |
| 807 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 808 | uint64_t cgen_var_40; |
| 809 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_40, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 810 | countingStream->write((uint64_t*)&cgen_var_40, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 811 | countingStream->putString(local_pName); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 812 | } |
| 813 | uint32_t packetSize_vkGetDeviceProcAddr = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 814 | countingStream->rewind(); |
| 815 | uint32_t opcode_vkGetDeviceProcAddr = OP_vkGetDeviceProcAddr; |
| 816 | stream->write(&opcode_vkGetDeviceProcAddr, sizeof(uint32_t)); |
| 817 | stream->write(&packetSize_vkGetDeviceProcAddr, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 818 | uint64_t cgen_var_41; |
| 819 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_41, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 820 | stream->write((uint64_t*)&cgen_var_41, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 821 | stream->putString(local_pName); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 822 | AEMU_SCOPED_TRACE("vkGetDeviceProcAddr readParams"); |
| 823 | AEMU_SCOPED_TRACE("vkGetDeviceProcAddr returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 824 | PFN_vkVoidFunction vkGetDeviceProcAddr_PFN_vkVoidFunction_return = (PFN_vkVoidFunction)0; |
| 825 | stream->read(&vkGetDeviceProcAddr_PFN_vkVoidFunction_return, sizeof(PFN_vkVoidFunction)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 826 | countingStream->clearPool(); |
| 827 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 828 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 829 | mImpl->log("finish vkGetDeviceProcAddr");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 830 | return vkGetDeviceProcAddr_PFN_vkVoidFunction_return; |
| 831 | } |
| 832 | |
| 833 | VkResult VkEncoder::vkCreateDevice( |
| 834 | VkPhysicalDevice physicalDevice, |
| 835 | const VkDeviceCreateInfo* pCreateInfo, |
| 836 | const VkAllocationCallbacks* pAllocator, |
| 837 | VkDevice* pDevice) |
| 838 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 839 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 840 | AEMU_SCOPED_TRACE("vkCreateDevice encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 841 | mImpl->log("start vkCreateDevice"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 842 | auto stream = mImpl->stream(); |
| 843 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 844 | auto resources = mImpl->resources(); |
| 845 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 846 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 847 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 848 | VkDeviceCreateInfo* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 849 | VkAllocationCallbacks* local_pAllocator; |
| 850 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 851 | local_pCreateInfo = nullptr; |
| 852 | if (pCreateInfo) |
| 853 | { |
| 854 | local_pCreateInfo = (VkDeviceCreateInfo*)pool->alloc(sizeof(const VkDeviceCreateInfo)); |
| 855 | deepcopy_VkDeviceCreateInfo(pool, pCreateInfo, (VkDeviceCreateInfo*)(local_pCreateInfo)); |
| 856 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 857 | local_pAllocator = nullptr; |
| 858 | if (pAllocator) |
| 859 | { |
| 860 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 861 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 862 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 863 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 864 | if (local_pCreateInfo) |
| 865 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 866 | transform_tohost_VkDeviceCreateInfo(mImpl->resources(), (VkDeviceCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 867 | } |
| 868 | if (local_pAllocator) |
| 869 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 870 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 871 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 872 | countingStream->rewind(); |
| 873 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 874 | uint64_t cgen_var_42; |
| 875 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_42, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 876 | countingStream->write((uint64_t*)&cgen_var_42, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 877 | marshal_VkDeviceCreateInfo(countingStream, (VkDeviceCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 878 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 879 | uint64_t cgen_var_43 = (uint64_t)(uintptr_t)local_pAllocator; |
| 880 | countingStream->putBe64(cgen_var_43); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 881 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 882 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 883 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 884 | } |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 885 | uint64_t cgen_var_44; |
| 886 | countingStream->handleMapping()->mapHandles_VkDevice_u64(pDevice, &cgen_var_44, 1); |
| 887 | countingStream->write((uint64_t*)&cgen_var_44, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 888 | } |
| 889 | uint32_t packetSize_vkCreateDevice = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 890 | countingStream->rewind(); |
| 891 | uint32_t opcode_vkCreateDevice = OP_vkCreateDevice; |
| 892 | stream->write(&opcode_vkCreateDevice, sizeof(uint32_t)); |
| 893 | stream->write(&packetSize_vkCreateDevice, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 894 | uint64_t cgen_var_45; |
| 895 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_45, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 896 | stream->write((uint64_t*)&cgen_var_45, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 897 | marshal_VkDeviceCreateInfo(stream, (VkDeviceCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 898 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 899 | uint64_t cgen_var_46 = (uint64_t)(uintptr_t)local_pAllocator; |
| 900 | stream->putBe64(cgen_var_46); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 901 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 902 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 903 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 904 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 905 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 906 | uint64_t cgen_var_47; |
| 907 | stream->handleMapping()->mapHandles_VkDevice_u64(pDevice, &cgen_var_47, 1); |
| 908 | stream->write((uint64_t*)&cgen_var_47, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 909 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 910 | AEMU_SCOPED_TRACE("vkCreateDevice readParams"); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 911 | stream->setHandleMapping(resources->createMapping()); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 912 | uint64_t cgen_var_48; |
| 913 | stream->read((uint64_t*)&cgen_var_48, 8); |
| 914 | stream->handleMapping()->mapHandles_u64_VkDevice(&cgen_var_48, (VkDevice*)pDevice, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 915 | stream->unsetHandleMapping(); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 916 | AEMU_SCOPED_TRACE("vkCreateDevice returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 917 | VkResult vkCreateDevice_VkResult_return = (VkResult)0; |
| 918 | stream->read(&vkCreateDevice_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 919 | countingStream->clearPool(); |
| 920 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 921 | pool->freeAll(); |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 922 | encoderLock.unlock(); |
| Lingfeng Yang | 131d5a4 | 2018-11-30 12:00:33 -0800 | [diff] [blame] | 923 | mImpl->resources()->on_vkCreateDevice(this, vkCreateDevice_VkResult_return, physicalDevice, pCreateInfo, pAllocator, pDevice); |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 924 | encoderLock.lock(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 925 | mImpl->log("finish vkCreateDevice");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 926 | return vkCreateDevice_VkResult_return; |
| 927 | } |
| 928 | |
| 929 | void VkEncoder::vkDestroyDevice( |
| 930 | VkDevice device, |
| 931 | const VkAllocationCallbacks* pAllocator) |
| 932 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 933 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 934 | AEMU_SCOPED_TRACE("vkDestroyDevice encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 935 | mImpl->log("start vkDestroyDevice"); |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 936 | encoderLock.unlock(); |
| Lingfeng Yang | 35e9c6a | 2018-12-25 17:13:36 -0800 | [diff] [blame] | 937 | mImpl->resources()->on_vkDestroyDevice_pre(this, device, pAllocator); |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 938 | encoderLock.lock(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 939 | auto stream = mImpl->stream(); |
| 940 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 941 | auto resources = mImpl->resources(); |
| 942 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 943 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 944 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 945 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 946 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 947 | local_pAllocator = nullptr; |
| 948 | if (pAllocator) |
| 949 | { |
| 950 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 951 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 952 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 953 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 954 | if (local_pAllocator) |
| 955 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 956 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 957 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 958 | countingStream->rewind(); |
| 959 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 960 | uint64_t cgen_var_49; |
| 961 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_49, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 962 | countingStream->write((uint64_t*)&cgen_var_49, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 963 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 964 | uint64_t cgen_var_50 = (uint64_t)(uintptr_t)local_pAllocator; |
| 965 | countingStream->putBe64(cgen_var_50); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 966 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 967 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 968 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 969 | } |
| 970 | } |
| 971 | uint32_t packetSize_vkDestroyDevice = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 972 | countingStream->rewind(); |
| 973 | uint32_t opcode_vkDestroyDevice = OP_vkDestroyDevice; |
| 974 | stream->write(&opcode_vkDestroyDevice, sizeof(uint32_t)); |
| 975 | stream->write(&packetSize_vkDestroyDevice, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 976 | uint64_t cgen_var_51; |
| 977 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_51, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 978 | stream->write((uint64_t*)&cgen_var_51, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 979 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 980 | uint64_t cgen_var_52 = (uint64_t)(uintptr_t)local_pAllocator; |
| 981 | stream->putBe64(cgen_var_52); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 982 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 983 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 984 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 985 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 986 | AEMU_SCOPED_TRACE("vkDestroyDevice readParams"); |
| 987 | AEMU_SCOPED_TRACE("vkDestroyDevice returnUnmarshal"); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 988 | resources->destroyMapping()->mapHandles_VkDevice((VkDevice*)&device); |
| Lingfeng Yang | 35e9c6a | 2018-12-25 17:13:36 -0800 | [diff] [blame] | 989 | stream->flush(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 990 | mImpl->log("finish vkDestroyDevice");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 991 | } |
| 992 | |
| 993 | VkResult VkEncoder::vkEnumerateInstanceExtensionProperties( |
| 994 | const char* pLayerName, |
| 995 | uint32_t* pPropertyCount, |
| 996 | VkExtensionProperties* pProperties) |
| 997 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 998 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 999 | AEMU_SCOPED_TRACE("vkEnumerateInstanceExtensionProperties encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 1000 | mImpl->log("start vkEnumerateInstanceExtensionProperties"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1001 | auto stream = mImpl->stream(); |
| 1002 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1003 | auto resources = mImpl->resources(); |
| 1004 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1005 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1006 | char* local_pLayerName; |
| 1007 | local_pLayerName = nullptr; |
| 1008 | if (pLayerName) |
| 1009 | { |
| 1010 | local_pLayerName = pool->strDup(pLayerName); |
| 1011 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1012 | countingStream->rewind(); |
| 1013 | { |
| Lingfeng Yang | b55ed1c | 2019-06-20 15:57:08 -0700 | [diff] [blame] | 1014 | if (countingStream->getFeatureBits() & VULKAN_STREAM_FEATURE_NULL_OPTIONAL_STRINGS_BIT) |
| 1015 | { |
| 1016 | // WARNING PTR CHECK |
| 1017 | uint64_t cgen_var_53 = (uint64_t)(uintptr_t)local_pLayerName; |
| 1018 | countingStream->putBe64(cgen_var_53); |
| 1019 | if (local_pLayerName) |
| 1020 | { |
| 1021 | countingStream->putString(local_pLayerName); |
| 1022 | } |
| 1023 | } |
| 1024 | else |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1025 | { |
| 1026 | countingStream->putString(local_pLayerName); |
| 1027 | } |
| 1028 | // WARNING PTR CHECK |
| 1029 | uint64_t cgen_var_54 = (uint64_t)(uintptr_t)pPropertyCount; |
| 1030 | countingStream->putBe64(cgen_var_54); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1031 | if (pPropertyCount) |
| 1032 | { |
| 1033 | countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 1034 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1035 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1036 | uint64_t cgen_var_55 = (uint64_t)(uintptr_t)pProperties; |
| 1037 | countingStream->putBe64(cgen_var_55); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1038 | if (pProperties) |
| 1039 | { |
| 1040 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 1041 | { |
| 1042 | marshal_VkExtensionProperties(countingStream, (VkExtensionProperties*)(pProperties + i)); |
| 1043 | } |
| 1044 | } |
| 1045 | } |
| 1046 | uint32_t packetSize_vkEnumerateInstanceExtensionProperties = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 1047 | countingStream->rewind(); |
| 1048 | uint32_t opcode_vkEnumerateInstanceExtensionProperties = OP_vkEnumerateInstanceExtensionProperties; |
| 1049 | stream->write(&opcode_vkEnumerateInstanceExtensionProperties, sizeof(uint32_t)); |
| 1050 | stream->write(&packetSize_vkEnumerateInstanceExtensionProperties, sizeof(uint32_t)); |
| Lingfeng Yang | b55ed1c | 2019-06-20 15:57:08 -0700 | [diff] [blame] | 1051 | if (stream->getFeatureBits() & VULKAN_STREAM_FEATURE_NULL_OPTIONAL_STRINGS_BIT) |
| 1052 | { |
| 1053 | // WARNING PTR CHECK |
| 1054 | uint64_t cgen_var_56 = (uint64_t)(uintptr_t)local_pLayerName; |
| 1055 | stream->putBe64(cgen_var_56); |
| 1056 | if (local_pLayerName) |
| 1057 | { |
| 1058 | stream->putString(local_pLayerName); |
| 1059 | } |
| 1060 | } |
| 1061 | else |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1062 | { |
| 1063 | stream->putString(local_pLayerName); |
| 1064 | } |
| 1065 | // WARNING PTR CHECK |
| 1066 | uint64_t cgen_var_57 = (uint64_t)(uintptr_t)pPropertyCount; |
| 1067 | stream->putBe64(cgen_var_57); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1068 | if (pPropertyCount) |
| 1069 | { |
| 1070 | stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 1071 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1072 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1073 | uint64_t cgen_var_58 = (uint64_t)(uintptr_t)pProperties; |
| 1074 | stream->putBe64(cgen_var_58); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1075 | if (pProperties) |
| 1076 | { |
| 1077 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 1078 | { |
| 1079 | marshal_VkExtensionProperties(stream, (VkExtensionProperties*)(pProperties + i)); |
| 1080 | } |
| 1081 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 1082 | AEMU_SCOPED_TRACE("vkEnumerateInstanceExtensionProperties readParams"); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1083 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1084 | uint32_t* check_pPropertyCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1085 | check_pPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1086 | if (pPropertyCount) |
| 1087 | { |
| 1088 | if (!(check_pPropertyCount)) |
| 1089 | { |
| 1090 | fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n"); |
| 1091 | } |
| 1092 | stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 1093 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1094 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1095 | VkExtensionProperties* check_pProperties; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1096 | check_pProperties = (VkExtensionProperties*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1097 | if (pProperties) |
| 1098 | { |
| 1099 | if (!(check_pProperties)) |
| 1100 | { |
| 1101 | fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n"); |
| 1102 | } |
| 1103 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 1104 | { |
| 1105 | unmarshal_VkExtensionProperties(stream, (VkExtensionProperties*)(pProperties + i)); |
| 1106 | } |
| 1107 | } |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 1108 | if (pProperties) |
| 1109 | { |
| 1110 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 1111 | { |
| 1112 | transform_fromhost_VkExtensionProperties(mImpl->resources(), (VkExtensionProperties*)(pProperties + i)); |
| 1113 | } |
| 1114 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 1115 | AEMU_SCOPED_TRACE("vkEnumerateInstanceExtensionProperties returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1116 | VkResult vkEnumerateInstanceExtensionProperties_VkResult_return = (VkResult)0; |
| 1117 | stream->read(&vkEnumerateInstanceExtensionProperties_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1118 | countingStream->clearPool(); |
| 1119 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1120 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 1121 | mImpl->log("finish vkEnumerateInstanceExtensionProperties");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1122 | return vkEnumerateInstanceExtensionProperties_VkResult_return; |
| 1123 | } |
| 1124 | |
| 1125 | VkResult VkEncoder::vkEnumerateDeviceExtensionProperties( |
| 1126 | VkPhysicalDevice physicalDevice, |
| 1127 | const char* pLayerName, |
| 1128 | uint32_t* pPropertyCount, |
| 1129 | VkExtensionProperties* pProperties) |
| 1130 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 1131 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 1132 | AEMU_SCOPED_TRACE("vkEnumerateDeviceExtensionProperties encode"); |
| Lingfeng Yang | 154a33c | 2019-01-29 19:06:23 -0800 | [diff] [blame] | 1133 | mImpl->log("start vkEnumerateDeviceExtensionProperties"); |
| 1134 | auto stream = mImpl->stream(); |
| 1135 | auto countingStream = mImpl->countingStream(); |
| 1136 | auto resources = mImpl->resources(); |
| 1137 | auto pool = mImpl->pool(); |
| 1138 | stream->setHandleMapping(resources->unwrapMapping()); |
| 1139 | VkPhysicalDevice local_physicalDevice; |
| 1140 | char* local_pLayerName; |
| 1141 | local_physicalDevice = physicalDevice; |
| 1142 | local_pLayerName = nullptr; |
| 1143 | if (pLayerName) |
| 1144 | { |
| 1145 | local_pLayerName = pool->strDup(pLayerName); |
| 1146 | } |
| 1147 | countingStream->rewind(); |
| 1148 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1149 | uint64_t cgen_var_61; |
| 1150 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_61, 1); |
| 1151 | countingStream->write((uint64_t*)&cgen_var_61, 1 * 8); |
| Lingfeng Yang | b55ed1c | 2019-06-20 15:57:08 -0700 | [diff] [blame] | 1152 | if (countingStream->getFeatureBits() & VULKAN_STREAM_FEATURE_NULL_OPTIONAL_STRINGS_BIT) |
| 1153 | { |
| 1154 | // WARNING PTR CHECK |
| 1155 | uint64_t cgen_var_62 = (uint64_t)(uintptr_t)local_pLayerName; |
| 1156 | countingStream->putBe64(cgen_var_62); |
| 1157 | if (local_pLayerName) |
| 1158 | { |
| 1159 | countingStream->putString(local_pLayerName); |
| 1160 | } |
| 1161 | } |
| 1162 | else |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1163 | { |
| 1164 | countingStream->putString(local_pLayerName); |
| 1165 | } |
| 1166 | // WARNING PTR CHECK |
| 1167 | uint64_t cgen_var_63 = (uint64_t)(uintptr_t)pPropertyCount; |
| 1168 | countingStream->putBe64(cgen_var_63); |
| Lingfeng Yang | 154a33c | 2019-01-29 19:06:23 -0800 | [diff] [blame] | 1169 | if (pPropertyCount) |
| 1170 | { |
| 1171 | countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 1172 | } |
| 1173 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1174 | uint64_t cgen_var_64 = (uint64_t)(uintptr_t)pProperties; |
| 1175 | countingStream->putBe64(cgen_var_64); |
| Lingfeng Yang | 154a33c | 2019-01-29 19:06:23 -0800 | [diff] [blame] | 1176 | if (pProperties) |
| 1177 | { |
| 1178 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 1179 | { |
| 1180 | marshal_VkExtensionProperties(countingStream, (VkExtensionProperties*)(pProperties + i)); |
| 1181 | } |
| 1182 | } |
| 1183 | } |
| 1184 | uint32_t packetSize_vkEnumerateDeviceExtensionProperties = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 1185 | countingStream->rewind(); |
| 1186 | uint32_t opcode_vkEnumerateDeviceExtensionProperties = OP_vkEnumerateDeviceExtensionProperties; |
| 1187 | stream->write(&opcode_vkEnumerateDeviceExtensionProperties, sizeof(uint32_t)); |
| 1188 | stream->write(&packetSize_vkEnumerateDeviceExtensionProperties, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1189 | uint64_t cgen_var_65; |
| 1190 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_65, 1); |
| 1191 | stream->write((uint64_t*)&cgen_var_65, 1 * 8); |
| Lingfeng Yang | b55ed1c | 2019-06-20 15:57:08 -0700 | [diff] [blame] | 1192 | if (stream->getFeatureBits() & VULKAN_STREAM_FEATURE_NULL_OPTIONAL_STRINGS_BIT) |
| 1193 | { |
| 1194 | // WARNING PTR CHECK |
| 1195 | uint64_t cgen_var_66 = (uint64_t)(uintptr_t)local_pLayerName; |
| 1196 | stream->putBe64(cgen_var_66); |
| 1197 | if (local_pLayerName) |
| 1198 | { |
| 1199 | stream->putString(local_pLayerName); |
| 1200 | } |
| 1201 | } |
| 1202 | else |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1203 | { |
| 1204 | stream->putString(local_pLayerName); |
| 1205 | } |
| 1206 | // WARNING PTR CHECK |
| 1207 | uint64_t cgen_var_67 = (uint64_t)(uintptr_t)pPropertyCount; |
| 1208 | stream->putBe64(cgen_var_67); |
| Lingfeng Yang | 154a33c | 2019-01-29 19:06:23 -0800 | [diff] [blame] | 1209 | if (pPropertyCount) |
| 1210 | { |
| 1211 | stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 1212 | } |
| 1213 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1214 | uint64_t cgen_var_68 = (uint64_t)(uintptr_t)pProperties; |
| 1215 | stream->putBe64(cgen_var_68); |
| Lingfeng Yang | 154a33c | 2019-01-29 19:06:23 -0800 | [diff] [blame] | 1216 | if (pProperties) |
| 1217 | { |
| 1218 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 1219 | { |
| 1220 | marshal_VkExtensionProperties(stream, (VkExtensionProperties*)(pProperties + i)); |
| 1221 | } |
| 1222 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 1223 | AEMU_SCOPED_TRACE("vkEnumerateDeviceExtensionProperties readParams"); |
| Lingfeng Yang | 154a33c | 2019-01-29 19:06:23 -0800 | [diff] [blame] | 1224 | // WARNING PTR CHECK |
| 1225 | uint32_t* check_pPropertyCount; |
| 1226 | check_pPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| 1227 | if (pPropertyCount) |
| 1228 | { |
| 1229 | if (!(check_pPropertyCount)) |
| 1230 | { |
| 1231 | fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n"); |
| 1232 | } |
| 1233 | stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 1234 | } |
| 1235 | // WARNING PTR CHECK |
| 1236 | VkExtensionProperties* check_pProperties; |
| 1237 | check_pProperties = (VkExtensionProperties*)(uintptr_t)stream->getBe64(); |
| 1238 | if (pProperties) |
| 1239 | { |
| 1240 | if (!(check_pProperties)) |
| 1241 | { |
| 1242 | fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n"); |
| 1243 | } |
| 1244 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 1245 | { |
| 1246 | unmarshal_VkExtensionProperties(stream, (VkExtensionProperties*)(pProperties + i)); |
| 1247 | } |
| 1248 | } |
| 1249 | if (pProperties) |
| 1250 | { |
| 1251 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 1252 | { |
| 1253 | transform_fromhost_VkExtensionProperties(mImpl->resources(), (VkExtensionProperties*)(pProperties + i)); |
| 1254 | } |
| 1255 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 1256 | AEMU_SCOPED_TRACE("vkEnumerateDeviceExtensionProperties returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1257 | VkResult vkEnumerateDeviceExtensionProperties_VkResult_return = (VkResult)0; |
| Lingfeng Yang | 154a33c | 2019-01-29 19:06:23 -0800 | [diff] [blame] | 1258 | stream->read(&vkEnumerateDeviceExtensionProperties_VkResult_return, sizeof(VkResult)); |
| 1259 | countingStream->clearPool(); |
| 1260 | stream->clearPool(); |
| 1261 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 1262 | mImpl->log("finish vkEnumerateDeviceExtensionProperties");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1263 | return vkEnumerateDeviceExtensionProperties_VkResult_return; |
| 1264 | } |
| 1265 | |
| 1266 | VkResult VkEncoder::vkEnumerateInstanceLayerProperties( |
| 1267 | uint32_t* pPropertyCount, |
| 1268 | VkLayerProperties* pProperties) |
| 1269 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 1270 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 1271 | AEMU_SCOPED_TRACE("vkEnumerateInstanceLayerProperties encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 1272 | mImpl->log("start vkEnumerateInstanceLayerProperties"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1273 | auto stream = mImpl->stream(); |
| 1274 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1275 | auto resources = mImpl->resources(); |
| 1276 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1277 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1278 | countingStream->rewind(); |
| 1279 | { |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1280 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1281 | uint64_t cgen_var_71 = (uint64_t)(uintptr_t)pPropertyCount; |
| 1282 | countingStream->putBe64(cgen_var_71); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1283 | if (pPropertyCount) |
| 1284 | { |
| 1285 | countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 1286 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1287 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1288 | uint64_t cgen_var_72 = (uint64_t)(uintptr_t)pProperties; |
| 1289 | countingStream->putBe64(cgen_var_72); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1290 | if (pProperties) |
| 1291 | { |
| 1292 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 1293 | { |
| 1294 | marshal_VkLayerProperties(countingStream, (VkLayerProperties*)(pProperties + i)); |
| 1295 | } |
| 1296 | } |
| 1297 | } |
| 1298 | uint32_t packetSize_vkEnumerateInstanceLayerProperties = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 1299 | countingStream->rewind(); |
| 1300 | uint32_t opcode_vkEnumerateInstanceLayerProperties = OP_vkEnumerateInstanceLayerProperties; |
| 1301 | stream->write(&opcode_vkEnumerateInstanceLayerProperties, sizeof(uint32_t)); |
| 1302 | stream->write(&packetSize_vkEnumerateInstanceLayerProperties, sizeof(uint32_t)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1303 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1304 | uint64_t cgen_var_73 = (uint64_t)(uintptr_t)pPropertyCount; |
| 1305 | stream->putBe64(cgen_var_73); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1306 | if (pPropertyCount) |
| 1307 | { |
| 1308 | stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 1309 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1310 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1311 | uint64_t cgen_var_74 = (uint64_t)(uintptr_t)pProperties; |
| 1312 | stream->putBe64(cgen_var_74); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1313 | if (pProperties) |
| 1314 | { |
| 1315 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 1316 | { |
| 1317 | marshal_VkLayerProperties(stream, (VkLayerProperties*)(pProperties + i)); |
| 1318 | } |
| 1319 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 1320 | AEMU_SCOPED_TRACE("vkEnumerateInstanceLayerProperties readParams"); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1321 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1322 | uint32_t* check_pPropertyCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1323 | check_pPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1324 | if (pPropertyCount) |
| 1325 | { |
| 1326 | if (!(check_pPropertyCount)) |
| 1327 | { |
| 1328 | fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n"); |
| 1329 | } |
| 1330 | stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 1331 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1332 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1333 | VkLayerProperties* check_pProperties; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1334 | check_pProperties = (VkLayerProperties*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1335 | if (pProperties) |
| 1336 | { |
| 1337 | if (!(check_pProperties)) |
| 1338 | { |
| 1339 | fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n"); |
| 1340 | } |
| 1341 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 1342 | { |
| 1343 | unmarshal_VkLayerProperties(stream, (VkLayerProperties*)(pProperties + i)); |
| 1344 | } |
| 1345 | } |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 1346 | if (pProperties) |
| 1347 | { |
| 1348 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 1349 | { |
| 1350 | transform_fromhost_VkLayerProperties(mImpl->resources(), (VkLayerProperties*)(pProperties + i)); |
| 1351 | } |
| 1352 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 1353 | AEMU_SCOPED_TRACE("vkEnumerateInstanceLayerProperties returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1354 | VkResult vkEnumerateInstanceLayerProperties_VkResult_return = (VkResult)0; |
| 1355 | stream->read(&vkEnumerateInstanceLayerProperties_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1356 | countingStream->clearPool(); |
| 1357 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1358 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 1359 | mImpl->log("finish vkEnumerateInstanceLayerProperties");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1360 | return vkEnumerateInstanceLayerProperties_VkResult_return; |
| 1361 | } |
| 1362 | |
| 1363 | VkResult VkEncoder::vkEnumerateDeviceLayerProperties( |
| 1364 | VkPhysicalDevice physicalDevice, |
| 1365 | uint32_t* pPropertyCount, |
| 1366 | VkLayerProperties* pProperties) |
| 1367 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 1368 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 1369 | AEMU_SCOPED_TRACE("vkEnumerateDeviceLayerProperties encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 1370 | mImpl->log("start vkEnumerateDeviceLayerProperties"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1371 | auto stream = mImpl->stream(); |
| 1372 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1373 | auto resources = mImpl->resources(); |
| 1374 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1375 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1376 | VkPhysicalDevice local_physicalDevice; |
| 1377 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1378 | countingStream->rewind(); |
| 1379 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1380 | uint64_t cgen_var_77; |
| 1381 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_77, 1); |
| 1382 | countingStream->write((uint64_t*)&cgen_var_77, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1383 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1384 | uint64_t cgen_var_78 = (uint64_t)(uintptr_t)pPropertyCount; |
| 1385 | countingStream->putBe64(cgen_var_78); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1386 | if (pPropertyCount) |
| 1387 | { |
| 1388 | countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 1389 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1390 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1391 | uint64_t cgen_var_79 = (uint64_t)(uintptr_t)pProperties; |
| 1392 | countingStream->putBe64(cgen_var_79); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1393 | if (pProperties) |
| 1394 | { |
| 1395 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 1396 | { |
| 1397 | marshal_VkLayerProperties(countingStream, (VkLayerProperties*)(pProperties + i)); |
| 1398 | } |
| 1399 | } |
| 1400 | } |
| 1401 | uint32_t packetSize_vkEnumerateDeviceLayerProperties = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 1402 | countingStream->rewind(); |
| 1403 | uint32_t opcode_vkEnumerateDeviceLayerProperties = OP_vkEnumerateDeviceLayerProperties; |
| 1404 | stream->write(&opcode_vkEnumerateDeviceLayerProperties, sizeof(uint32_t)); |
| 1405 | stream->write(&packetSize_vkEnumerateDeviceLayerProperties, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1406 | uint64_t cgen_var_80; |
| 1407 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_80, 1); |
| 1408 | stream->write((uint64_t*)&cgen_var_80, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1409 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1410 | uint64_t cgen_var_81 = (uint64_t)(uintptr_t)pPropertyCount; |
| 1411 | stream->putBe64(cgen_var_81); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1412 | if (pPropertyCount) |
| 1413 | { |
| 1414 | stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 1415 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1416 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1417 | uint64_t cgen_var_82 = (uint64_t)(uintptr_t)pProperties; |
| 1418 | stream->putBe64(cgen_var_82); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1419 | if (pProperties) |
| 1420 | { |
| 1421 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 1422 | { |
| 1423 | marshal_VkLayerProperties(stream, (VkLayerProperties*)(pProperties + i)); |
| 1424 | } |
| 1425 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 1426 | AEMU_SCOPED_TRACE("vkEnumerateDeviceLayerProperties readParams"); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1427 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1428 | uint32_t* check_pPropertyCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1429 | check_pPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1430 | if (pPropertyCount) |
| 1431 | { |
| 1432 | if (!(check_pPropertyCount)) |
| 1433 | { |
| 1434 | fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n"); |
| 1435 | } |
| 1436 | stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 1437 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1438 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1439 | VkLayerProperties* check_pProperties; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1440 | check_pProperties = (VkLayerProperties*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1441 | if (pProperties) |
| 1442 | { |
| 1443 | if (!(check_pProperties)) |
| 1444 | { |
| 1445 | fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n"); |
| 1446 | } |
| 1447 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 1448 | { |
| 1449 | unmarshal_VkLayerProperties(stream, (VkLayerProperties*)(pProperties + i)); |
| 1450 | } |
| 1451 | } |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 1452 | if (pProperties) |
| 1453 | { |
| 1454 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 1455 | { |
| 1456 | transform_fromhost_VkLayerProperties(mImpl->resources(), (VkLayerProperties*)(pProperties + i)); |
| 1457 | } |
| 1458 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 1459 | AEMU_SCOPED_TRACE("vkEnumerateDeviceLayerProperties returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1460 | VkResult vkEnumerateDeviceLayerProperties_VkResult_return = (VkResult)0; |
| 1461 | stream->read(&vkEnumerateDeviceLayerProperties_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1462 | countingStream->clearPool(); |
| 1463 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1464 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 1465 | mImpl->log("finish vkEnumerateDeviceLayerProperties");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1466 | return vkEnumerateDeviceLayerProperties_VkResult_return; |
| 1467 | } |
| 1468 | |
| 1469 | void VkEncoder::vkGetDeviceQueue( |
| 1470 | VkDevice device, |
| 1471 | uint32_t queueFamilyIndex, |
| 1472 | uint32_t queueIndex, |
| 1473 | VkQueue* pQueue) |
| 1474 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 1475 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 1476 | AEMU_SCOPED_TRACE("vkGetDeviceQueue encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 1477 | mImpl->log("start vkGetDeviceQueue"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1478 | auto stream = mImpl->stream(); |
| 1479 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1480 | auto resources = mImpl->resources(); |
| 1481 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1482 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1483 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1484 | uint32_t local_queueFamilyIndex; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1485 | uint32_t local_queueIndex; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 1486 | local_device = device; |
| 1487 | local_queueFamilyIndex = queueFamilyIndex; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1488 | local_queueIndex = queueIndex; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1489 | countingStream->rewind(); |
| 1490 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1491 | uint64_t cgen_var_85; |
| 1492 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_85, 1); |
| 1493 | countingStream->write((uint64_t*)&cgen_var_85, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1494 | countingStream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t)); |
| 1495 | countingStream->write((uint32_t*)&local_queueIndex, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1496 | uint64_t cgen_var_86; |
| 1497 | countingStream->handleMapping()->mapHandles_VkQueue_u64(pQueue, &cgen_var_86, 1); |
| 1498 | countingStream->write((uint64_t*)&cgen_var_86, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1499 | } |
| 1500 | uint32_t packetSize_vkGetDeviceQueue = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 1501 | countingStream->rewind(); |
| 1502 | uint32_t opcode_vkGetDeviceQueue = OP_vkGetDeviceQueue; |
| 1503 | stream->write(&opcode_vkGetDeviceQueue, sizeof(uint32_t)); |
| 1504 | stream->write(&packetSize_vkGetDeviceQueue, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1505 | uint64_t cgen_var_87; |
| 1506 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_87, 1); |
| 1507 | stream->write((uint64_t*)&cgen_var_87, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1508 | stream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t)); |
| 1509 | stream->write((uint32_t*)&local_queueIndex, sizeof(uint32_t)); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1510 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1511 | uint64_t cgen_var_88; |
| 1512 | stream->handleMapping()->mapHandles_VkQueue_u64(pQueue, &cgen_var_88, 1); |
| 1513 | stream->write((uint64_t*)&cgen_var_88, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1514 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 1515 | AEMU_SCOPED_TRACE("vkGetDeviceQueue readParams"); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1516 | stream->setHandleMapping(resources->createMapping()); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1517 | uint64_t cgen_var_89; |
| 1518 | stream->read((uint64_t*)&cgen_var_89, 8); |
| 1519 | stream->handleMapping()->mapHandles_u64_VkQueue(&cgen_var_89, (VkQueue*)pQueue, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1520 | stream->unsetHandleMapping(); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 1521 | AEMU_SCOPED_TRACE("vkGetDeviceQueue returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 1522 | mImpl->log("finish vkGetDeviceQueue");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1523 | } |
| 1524 | |
| 1525 | VkResult VkEncoder::vkQueueSubmit( |
| 1526 | VkQueue queue, |
| 1527 | uint32_t submitCount, |
| 1528 | const VkSubmitInfo* pSubmits, |
| 1529 | VkFence fence) |
| 1530 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 1531 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 1532 | AEMU_SCOPED_TRACE("vkQueueSubmit encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 1533 | mImpl->log("start vkQueueSubmit"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1534 | auto stream = mImpl->stream(); |
| 1535 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1536 | auto resources = mImpl->resources(); |
| 1537 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1538 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1539 | VkQueue local_queue; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1540 | uint32_t local_submitCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1541 | VkSubmitInfo* local_pSubmits; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 1542 | VkFence local_fence; |
| 1543 | local_queue = queue; |
| 1544 | local_submitCount = submitCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1545 | local_pSubmits = nullptr; |
| 1546 | if (pSubmits) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1547 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1548 | local_pSubmits = (VkSubmitInfo*)pool->alloc(((submitCount)) * sizeof(const VkSubmitInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1549 | for (uint32_t i = 0; i < (uint32_t)((submitCount)); ++i) |
| 1550 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1551 | deepcopy_VkSubmitInfo(pool, pSubmits + i, (VkSubmitInfo*)(local_pSubmits + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1552 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1553 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1554 | local_fence = fence; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 1555 | if (local_pSubmits) |
| 1556 | { |
| 1557 | for (uint32_t i = 0; i < (uint32_t)((submitCount)); ++i) |
| 1558 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 1559 | transform_tohost_VkSubmitInfo(mImpl->resources(), (VkSubmitInfo*)(local_pSubmits + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 1560 | } |
| 1561 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1562 | countingStream->rewind(); |
| 1563 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1564 | uint64_t cgen_var_90; |
| 1565 | countingStream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_90, 1); |
| 1566 | countingStream->write((uint64_t*)&cgen_var_90, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1567 | countingStream->write((uint32_t*)&local_submitCount, sizeof(uint32_t)); |
| 1568 | for (uint32_t i = 0; i < (uint32_t)((submitCount)); ++i) |
| 1569 | { |
| 1570 | marshal_VkSubmitInfo(countingStream, (VkSubmitInfo*)(local_pSubmits + i)); |
| 1571 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1572 | uint64_t cgen_var_91; |
| 1573 | countingStream->handleMapping()->mapHandles_VkFence_u64(&local_fence, &cgen_var_91, 1); |
| 1574 | countingStream->write((uint64_t*)&cgen_var_91, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1575 | } |
| 1576 | uint32_t packetSize_vkQueueSubmit = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 1577 | countingStream->rewind(); |
| 1578 | uint32_t opcode_vkQueueSubmit = OP_vkQueueSubmit; |
| 1579 | stream->write(&opcode_vkQueueSubmit, sizeof(uint32_t)); |
| 1580 | stream->write(&packetSize_vkQueueSubmit, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1581 | uint64_t cgen_var_92; |
| 1582 | stream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_92, 1); |
| 1583 | stream->write((uint64_t*)&cgen_var_92, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1584 | stream->write((uint32_t*)&local_submitCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1585 | for (uint32_t i = 0; i < (uint32_t)((submitCount)); ++i) |
| 1586 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1587 | marshal_VkSubmitInfo(stream, (VkSubmitInfo*)(local_pSubmits + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1588 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1589 | uint64_t cgen_var_93; |
| 1590 | stream->handleMapping()->mapHandles_VkFence_u64(&local_fence, &cgen_var_93, 1); |
| 1591 | stream->write((uint64_t*)&cgen_var_93, 1 * 8); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 1592 | AEMU_SCOPED_TRACE("vkQueueSubmit readParams"); |
| 1593 | AEMU_SCOPED_TRACE("vkQueueSubmit returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1594 | VkResult vkQueueSubmit_VkResult_return = (VkResult)0; |
| 1595 | stream->read(&vkQueueSubmit_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1596 | countingStream->clearPool(); |
| 1597 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1598 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 1599 | mImpl->log("finish vkQueueSubmit");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1600 | return vkQueueSubmit_VkResult_return; |
| 1601 | } |
| 1602 | |
| 1603 | VkResult VkEncoder::vkQueueWaitIdle( |
| 1604 | VkQueue queue) |
| 1605 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 1606 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 1607 | AEMU_SCOPED_TRACE("vkQueueWaitIdle encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 1608 | mImpl->log("start vkQueueWaitIdle"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1609 | auto stream = mImpl->stream(); |
| 1610 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1611 | auto resources = mImpl->resources(); |
| 1612 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1613 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1614 | VkQueue local_queue; |
| 1615 | local_queue = queue; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1616 | countingStream->rewind(); |
| 1617 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1618 | uint64_t cgen_var_94; |
| 1619 | countingStream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_94, 1); |
| 1620 | countingStream->write((uint64_t*)&cgen_var_94, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1621 | } |
| 1622 | uint32_t packetSize_vkQueueWaitIdle = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 1623 | countingStream->rewind(); |
| 1624 | uint32_t opcode_vkQueueWaitIdle = OP_vkQueueWaitIdle; |
| 1625 | stream->write(&opcode_vkQueueWaitIdle, sizeof(uint32_t)); |
| 1626 | stream->write(&packetSize_vkQueueWaitIdle, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1627 | uint64_t cgen_var_95; |
| 1628 | stream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_95, 1); |
| 1629 | stream->write((uint64_t*)&cgen_var_95, 1 * 8); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 1630 | AEMU_SCOPED_TRACE("vkQueueWaitIdle readParams"); |
| 1631 | AEMU_SCOPED_TRACE("vkQueueWaitIdle returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1632 | VkResult vkQueueWaitIdle_VkResult_return = (VkResult)0; |
| 1633 | stream->read(&vkQueueWaitIdle_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1634 | countingStream->clearPool(); |
| 1635 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1636 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 1637 | mImpl->log("finish vkQueueWaitIdle");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1638 | return vkQueueWaitIdle_VkResult_return; |
| 1639 | } |
| 1640 | |
| 1641 | VkResult VkEncoder::vkDeviceWaitIdle( |
| 1642 | VkDevice device) |
| 1643 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 1644 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 1645 | AEMU_SCOPED_TRACE("vkDeviceWaitIdle encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 1646 | mImpl->log("start vkDeviceWaitIdle"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1647 | auto stream = mImpl->stream(); |
| 1648 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1649 | auto resources = mImpl->resources(); |
| 1650 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1651 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1652 | VkDevice local_device; |
| 1653 | local_device = device; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1654 | countingStream->rewind(); |
| 1655 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1656 | uint64_t cgen_var_96; |
| 1657 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_96, 1); |
| 1658 | countingStream->write((uint64_t*)&cgen_var_96, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1659 | } |
| 1660 | uint32_t packetSize_vkDeviceWaitIdle = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 1661 | countingStream->rewind(); |
| 1662 | uint32_t opcode_vkDeviceWaitIdle = OP_vkDeviceWaitIdle; |
| 1663 | stream->write(&opcode_vkDeviceWaitIdle, sizeof(uint32_t)); |
| 1664 | stream->write(&packetSize_vkDeviceWaitIdle, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1665 | uint64_t cgen_var_97; |
| 1666 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_97, 1); |
| 1667 | stream->write((uint64_t*)&cgen_var_97, 1 * 8); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 1668 | AEMU_SCOPED_TRACE("vkDeviceWaitIdle readParams"); |
| 1669 | AEMU_SCOPED_TRACE("vkDeviceWaitIdle returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1670 | VkResult vkDeviceWaitIdle_VkResult_return = (VkResult)0; |
| 1671 | stream->read(&vkDeviceWaitIdle_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1672 | countingStream->clearPool(); |
| 1673 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1674 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 1675 | mImpl->log("finish vkDeviceWaitIdle");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1676 | return vkDeviceWaitIdle_VkResult_return; |
| 1677 | } |
| 1678 | |
| 1679 | VkResult VkEncoder::vkAllocateMemory( |
| 1680 | VkDevice device, |
| 1681 | const VkMemoryAllocateInfo* pAllocateInfo, |
| 1682 | const VkAllocationCallbacks* pAllocator, |
| 1683 | VkDeviceMemory* pMemory) |
| 1684 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 1685 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 1686 | AEMU_SCOPED_TRACE("vkAllocateMemory encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 1687 | mImpl->log("start vkAllocateMemory"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1688 | auto stream = mImpl->stream(); |
| 1689 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1690 | auto resources = mImpl->resources(); |
| 1691 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1692 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1693 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1694 | VkMemoryAllocateInfo* local_pAllocateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 1695 | VkAllocationCallbacks* local_pAllocator; |
| 1696 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1697 | local_pAllocateInfo = nullptr; |
| 1698 | if (pAllocateInfo) |
| 1699 | { |
| 1700 | local_pAllocateInfo = (VkMemoryAllocateInfo*)pool->alloc(sizeof(const VkMemoryAllocateInfo)); |
| 1701 | deepcopy_VkMemoryAllocateInfo(pool, pAllocateInfo, (VkMemoryAllocateInfo*)(local_pAllocateInfo)); |
| 1702 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1703 | local_pAllocator = nullptr; |
| 1704 | if (pAllocator) |
| 1705 | { |
| 1706 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 1707 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 1708 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 1709 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 1710 | if (local_pAllocateInfo) |
| 1711 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 1712 | transform_tohost_VkMemoryAllocateInfo(mImpl->resources(), (VkMemoryAllocateInfo*)(local_pAllocateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 1713 | } |
| 1714 | if (local_pAllocator) |
| 1715 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 1716 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 1717 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1718 | countingStream->rewind(); |
| 1719 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1720 | uint64_t cgen_var_98; |
| 1721 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_98, 1); |
| 1722 | countingStream->write((uint64_t*)&cgen_var_98, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1723 | marshal_VkMemoryAllocateInfo(countingStream, (VkMemoryAllocateInfo*)(local_pAllocateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1724 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1725 | uint64_t cgen_var_99 = (uint64_t)(uintptr_t)local_pAllocator; |
| 1726 | countingStream->putBe64(cgen_var_99); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1727 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1728 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1729 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1730 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1731 | uint64_t cgen_var_100; |
| 1732 | countingStream->handleMapping()->mapHandles_VkDeviceMemory_u64(pMemory, &cgen_var_100, 1); |
| 1733 | countingStream->write((uint64_t*)&cgen_var_100, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1734 | } |
| 1735 | uint32_t packetSize_vkAllocateMemory = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 1736 | countingStream->rewind(); |
| 1737 | uint32_t opcode_vkAllocateMemory = OP_vkAllocateMemory; |
| 1738 | stream->write(&opcode_vkAllocateMemory, sizeof(uint32_t)); |
| 1739 | stream->write(&packetSize_vkAllocateMemory, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1740 | uint64_t cgen_var_101; |
| 1741 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_101, 1); |
| 1742 | stream->write((uint64_t*)&cgen_var_101, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1743 | marshal_VkMemoryAllocateInfo(stream, (VkMemoryAllocateInfo*)(local_pAllocateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1744 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1745 | uint64_t cgen_var_102 = (uint64_t)(uintptr_t)local_pAllocator; |
| 1746 | stream->putBe64(cgen_var_102); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1747 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1748 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1749 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1750 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1751 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1752 | uint64_t cgen_var_103; |
| 1753 | stream->handleMapping()->mapHandles_VkDeviceMemory_u64(pMemory, &cgen_var_103, 1); |
| 1754 | stream->write((uint64_t*)&cgen_var_103, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1755 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 1756 | AEMU_SCOPED_TRACE("vkAllocateMemory readParams"); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1757 | stream->setHandleMapping(resources->createMapping()); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1758 | uint64_t cgen_var_104; |
| 1759 | stream->read((uint64_t*)&cgen_var_104, 8); |
| 1760 | stream->handleMapping()->mapHandles_u64_VkDeviceMemory(&cgen_var_104, (VkDeviceMemory*)pMemory, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1761 | stream->unsetHandleMapping(); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 1762 | AEMU_SCOPED_TRACE("vkAllocateMemory returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1763 | VkResult vkAllocateMemory_VkResult_return = (VkResult)0; |
| 1764 | stream->read(&vkAllocateMemory_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1765 | countingStream->clearPool(); |
| 1766 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1767 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 1768 | mImpl->log("finish vkAllocateMemory");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1769 | return vkAllocateMemory_VkResult_return; |
| 1770 | } |
| 1771 | |
| 1772 | void VkEncoder::vkFreeMemory( |
| 1773 | VkDevice device, |
| 1774 | VkDeviceMemory memory, |
| 1775 | const VkAllocationCallbacks* pAllocator) |
| 1776 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 1777 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 1778 | AEMU_SCOPED_TRACE("vkFreeMemory encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 1779 | mImpl->log("start vkFreeMemory"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1780 | auto stream = mImpl->stream(); |
| 1781 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1782 | auto resources = mImpl->resources(); |
| 1783 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1784 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1785 | VkDevice local_device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 1786 | VkDeviceMemory local_memory; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1787 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 1788 | local_device = device; |
| 1789 | local_memory = memory; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1790 | local_pAllocator = nullptr; |
| 1791 | if (pAllocator) |
| 1792 | { |
| 1793 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 1794 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 1795 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 1796 | local_pAllocator = nullptr; |
| Lingfeng Yang | 2b1b8cf | 2019-02-08 09:53:36 -0800 | [diff] [blame] | 1797 | 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] | 1798 | countingStream->rewind(); |
| 1799 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1800 | uint64_t cgen_var_105; |
| 1801 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_105, 1); |
| 1802 | countingStream->write((uint64_t*)&cgen_var_105, 1 * 8); |
| 1803 | uint64_t cgen_var_106; |
| 1804 | countingStream->handleMapping()->mapHandles_VkDeviceMemory_u64(&local_memory, &cgen_var_106, 1); |
| 1805 | countingStream->write((uint64_t*)&cgen_var_106, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1806 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1807 | uint64_t cgen_var_107 = (uint64_t)(uintptr_t)local_pAllocator; |
| 1808 | countingStream->putBe64(cgen_var_107); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1809 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1810 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1811 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1812 | } |
| 1813 | } |
| 1814 | uint32_t packetSize_vkFreeMemory = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 1815 | countingStream->rewind(); |
| 1816 | uint32_t opcode_vkFreeMemory = OP_vkFreeMemory; |
| 1817 | stream->write(&opcode_vkFreeMemory, sizeof(uint32_t)); |
| 1818 | stream->write(&packetSize_vkFreeMemory, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1819 | uint64_t cgen_var_108; |
| 1820 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_108, 1); |
| 1821 | stream->write((uint64_t*)&cgen_var_108, 1 * 8); |
| 1822 | uint64_t cgen_var_109; |
| 1823 | stream->handleMapping()->mapHandles_VkDeviceMemory_u64(&local_memory, &cgen_var_109, 1); |
| 1824 | stream->write((uint64_t*)&cgen_var_109, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1825 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1826 | uint64_t cgen_var_110 = (uint64_t)(uintptr_t)local_pAllocator; |
| 1827 | stream->putBe64(cgen_var_110); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1828 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1829 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1830 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1831 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 1832 | AEMU_SCOPED_TRACE("vkFreeMemory readParams"); |
| 1833 | AEMU_SCOPED_TRACE("vkFreeMemory returnUnmarshal"); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1834 | resources->destroyMapping()->mapHandles_VkDeviceMemory((VkDeviceMemory*)&memory); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 1835 | mImpl->log("finish vkFreeMemory");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1836 | } |
| 1837 | |
| 1838 | VkResult VkEncoder::vkMapMemory( |
| 1839 | VkDevice device, |
| 1840 | VkDeviceMemory memory, |
| 1841 | VkDeviceSize offset, |
| 1842 | VkDeviceSize size, |
| 1843 | VkMemoryMapFlags flags, |
| 1844 | void** ppData) |
| 1845 | { |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 1846 | AEMU_SCOPED_TRACE("vkMapMemory resourceEvent"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1847 | VkResult vkMapMemory_VkResult_return = (VkResult)0; |
| Lingfeng Yang | def88ba | 2018-12-13 12:43:17 -0800 | [diff] [blame] | 1848 | 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] | 1849 | mImpl->log("finish vkMapMemory");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1850 | return vkMapMemory_VkResult_return; |
| 1851 | } |
| 1852 | |
| 1853 | void VkEncoder::vkUnmapMemory( |
| 1854 | VkDevice device, |
| 1855 | VkDeviceMemory memory) |
| 1856 | { |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 1857 | AEMU_SCOPED_TRACE("vkUnmapMemory resourceEvent"); |
| Lingfeng Yang | def88ba | 2018-12-13 12:43:17 -0800 | [diff] [blame] | 1858 | mImpl->resources()->on_vkUnmapMemory(this, device, memory); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1859 | } |
| 1860 | |
| 1861 | VkResult VkEncoder::vkFlushMappedMemoryRanges( |
| 1862 | VkDevice device, |
| 1863 | uint32_t memoryRangeCount, |
| 1864 | const VkMappedMemoryRange* pMemoryRanges) |
| 1865 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 1866 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 1867 | AEMU_SCOPED_TRACE("vkFlushMappedMemoryRanges encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 1868 | mImpl->log("start vkFlushMappedMemoryRanges"); |
| Lingfeng Yang | 29c99d9 | 2018-11-30 11:15:29 -0800 | [diff] [blame] | 1869 | 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] | 1870 | auto stream = mImpl->stream(); |
| 1871 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1872 | auto resources = mImpl->resources(); |
| 1873 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1874 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1875 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1876 | uint32_t local_memoryRangeCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1877 | VkMappedMemoryRange* local_pMemoryRanges; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 1878 | local_device = device; |
| 1879 | local_memoryRangeCount = memoryRangeCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1880 | local_pMemoryRanges = nullptr; |
| 1881 | if (pMemoryRanges) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1882 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1883 | local_pMemoryRanges = (VkMappedMemoryRange*)pool->alloc(((memoryRangeCount)) * sizeof(const VkMappedMemoryRange)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1884 | for (uint32_t i = 0; i < (uint32_t)((memoryRangeCount)); ++i) |
| 1885 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1886 | deepcopy_VkMappedMemoryRange(pool, pMemoryRanges + i, (VkMappedMemoryRange*)(local_pMemoryRanges + i)); |
| 1887 | } |
| 1888 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 1889 | if (local_pMemoryRanges) |
| 1890 | { |
| 1891 | for (uint32_t i = 0; i < (uint32_t)((memoryRangeCount)); ++i) |
| 1892 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 1893 | transform_tohost_VkMappedMemoryRange(mImpl->resources(), (VkMappedMemoryRange*)(local_pMemoryRanges + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 1894 | } |
| 1895 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1896 | countingStream->rewind(); |
| 1897 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1898 | uint64_t cgen_var_111; |
| 1899 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_111, 1); |
| 1900 | countingStream->write((uint64_t*)&cgen_var_111, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1901 | countingStream->write((uint32_t*)&local_memoryRangeCount, sizeof(uint32_t)); |
| 1902 | for (uint32_t i = 0; i < (uint32_t)((memoryRangeCount)); ++i) |
| 1903 | { |
| 1904 | marshal_VkMappedMemoryRange(countingStream, (VkMappedMemoryRange*)(local_pMemoryRanges + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1905 | } |
| 1906 | } |
| Lingfeng Yang | 5c63afd | 2018-12-22 01:21:14 -0800 | [diff] [blame] | 1907 | if (!resources->usingDirectMapping()) |
| Lingfeng Yang | e30d338 | 2018-11-09 08:24:37 -0800 | [diff] [blame] | 1908 | { |
| Lingfeng Yang | 5c63afd | 2018-12-22 01:21:14 -0800 | [diff] [blame] | 1909 | for (uint32_t i = 0; i < memoryRangeCount; ++i) |
| 1910 | { |
| 1911 | auto range = pMemoryRanges[i]; |
| 1912 | auto memory = pMemoryRanges[i].memory; |
| 1913 | auto size = pMemoryRanges[i].size; |
| 1914 | auto offset = pMemoryRanges[i].offset; |
| 1915 | uint64_t streamSize = 0; |
| 1916 | if (!memory) { countingStream->write(&streamSize, sizeof(uint64_t)); continue; }; |
| 1917 | auto hostPtr = resources->getMappedPointer(memory); |
| 1918 | auto actualSize = size == VK_WHOLE_SIZE ? resources->getMappedSize(memory) : size; |
| 1919 | if (!hostPtr) { countingStream->write(&streamSize, sizeof(uint64_t)); continue; }; |
| 1920 | streamSize = actualSize; |
| 1921 | countingStream->write(&streamSize, sizeof(uint64_t)); |
| 1922 | uint8_t* targetRange = hostPtr + offset; |
| 1923 | countingStream->write(targetRange, actualSize); |
| 1924 | } |
| Lingfeng Yang | e30d338 | 2018-11-09 08:24:37 -0800 | [diff] [blame] | 1925 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1926 | uint32_t packetSize_vkFlushMappedMemoryRanges = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 1927 | countingStream->rewind(); |
| 1928 | uint32_t opcode_vkFlushMappedMemoryRanges = OP_vkFlushMappedMemoryRanges; |
| 1929 | stream->write(&opcode_vkFlushMappedMemoryRanges, sizeof(uint32_t)); |
| 1930 | stream->write(&packetSize_vkFlushMappedMemoryRanges, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1931 | uint64_t cgen_var_112; |
| 1932 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_112, 1); |
| 1933 | stream->write((uint64_t*)&cgen_var_112, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1934 | stream->write((uint32_t*)&local_memoryRangeCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1935 | for (uint32_t i = 0; i < (uint32_t)((memoryRangeCount)); ++i) |
| 1936 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1937 | marshal_VkMappedMemoryRange(stream, (VkMappedMemoryRange*)(local_pMemoryRanges + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1938 | } |
| Lingfeng Yang | 5c63afd | 2018-12-22 01:21:14 -0800 | [diff] [blame] | 1939 | if (!resources->usingDirectMapping()) |
| Lingfeng Yang | e30d338 | 2018-11-09 08:24:37 -0800 | [diff] [blame] | 1940 | { |
| Lingfeng Yang | 5c63afd | 2018-12-22 01:21:14 -0800 | [diff] [blame] | 1941 | for (uint32_t i = 0; i < memoryRangeCount; ++i) |
| 1942 | { |
| 1943 | auto range = pMemoryRanges[i]; |
| 1944 | auto memory = pMemoryRanges[i].memory; |
| 1945 | auto size = pMemoryRanges[i].size; |
| 1946 | auto offset = pMemoryRanges[i].offset; |
| 1947 | uint64_t streamSize = 0; |
| 1948 | if (!memory) { stream->write(&streamSize, sizeof(uint64_t)); continue; }; |
| 1949 | auto hostPtr = resources->getMappedPointer(memory); |
| 1950 | auto actualSize = size == VK_WHOLE_SIZE ? resources->getMappedSize(memory) : size; |
| 1951 | if (!hostPtr) { stream->write(&streamSize, sizeof(uint64_t)); continue; }; |
| 1952 | streamSize = actualSize; |
| 1953 | stream->write(&streamSize, sizeof(uint64_t)); |
| 1954 | uint8_t* targetRange = hostPtr + offset; |
| 1955 | stream->write(targetRange, actualSize); |
| 1956 | } |
| Lingfeng Yang | e30d338 | 2018-11-09 08:24:37 -0800 | [diff] [blame] | 1957 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 1958 | AEMU_SCOPED_TRACE("vkFlushMappedMemoryRanges readParams"); |
| 1959 | AEMU_SCOPED_TRACE("vkFlushMappedMemoryRanges returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1960 | VkResult vkFlushMappedMemoryRanges_VkResult_return = (VkResult)0; |
| 1961 | stream->read(&vkFlushMappedMemoryRanges_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1962 | countingStream->clearPool(); |
| 1963 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1964 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 1965 | mImpl->log("finish vkFlushMappedMemoryRanges");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1966 | return vkFlushMappedMemoryRanges_VkResult_return; |
| 1967 | } |
| 1968 | |
| 1969 | VkResult VkEncoder::vkInvalidateMappedMemoryRanges( |
| 1970 | VkDevice device, |
| 1971 | uint32_t memoryRangeCount, |
| 1972 | const VkMappedMemoryRange* pMemoryRanges) |
| 1973 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 1974 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 1975 | AEMU_SCOPED_TRACE("vkInvalidateMappedMemoryRanges encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 1976 | mImpl->log("start vkInvalidateMappedMemoryRanges"); |
| Lingfeng Yang | 29c99d9 | 2018-11-30 11:15:29 -0800 | [diff] [blame] | 1977 | 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] | 1978 | auto stream = mImpl->stream(); |
| 1979 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1980 | auto resources = mImpl->resources(); |
| 1981 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1982 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1983 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1984 | uint32_t local_memoryRangeCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1985 | VkMappedMemoryRange* local_pMemoryRanges; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 1986 | local_device = device; |
| 1987 | local_memoryRangeCount = memoryRangeCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1988 | local_pMemoryRanges = nullptr; |
| 1989 | if (pMemoryRanges) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1990 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1991 | local_pMemoryRanges = (VkMappedMemoryRange*)pool->alloc(((memoryRangeCount)) * sizeof(const VkMappedMemoryRange)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1992 | for (uint32_t i = 0; i < (uint32_t)((memoryRangeCount)); ++i) |
| 1993 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1994 | deepcopy_VkMappedMemoryRange(pool, pMemoryRanges + i, (VkMappedMemoryRange*)(local_pMemoryRanges + i)); |
| 1995 | } |
| 1996 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 1997 | if (local_pMemoryRanges) |
| 1998 | { |
| 1999 | for (uint32_t i = 0; i < (uint32_t)((memoryRangeCount)); ++i) |
| 2000 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 2001 | transform_tohost_VkMappedMemoryRange(mImpl->resources(), (VkMappedMemoryRange*)(local_pMemoryRanges + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 2002 | } |
| 2003 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2004 | countingStream->rewind(); |
| 2005 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2006 | uint64_t cgen_var_113; |
| 2007 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_113, 1); |
| 2008 | countingStream->write((uint64_t*)&cgen_var_113, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2009 | countingStream->write((uint32_t*)&local_memoryRangeCount, sizeof(uint32_t)); |
| 2010 | for (uint32_t i = 0; i < (uint32_t)((memoryRangeCount)); ++i) |
| 2011 | { |
| 2012 | marshal_VkMappedMemoryRange(countingStream, (VkMappedMemoryRange*)(local_pMemoryRanges + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2013 | } |
| 2014 | } |
| 2015 | uint32_t packetSize_vkInvalidateMappedMemoryRanges = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 2016 | countingStream->rewind(); |
| 2017 | uint32_t opcode_vkInvalidateMappedMemoryRanges = OP_vkInvalidateMappedMemoryRanges; |
| 2018 | stream->write(&opcode_vkInvalidateMappedMemoryRanges, sizeof(uint32_t)); |
| 2019 | stream->write(&packetSize_vkInvalidateMappedMemoryRanges, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2020 | uint64_t cgen_var_114; |
| 2021 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_114, 1); |
| 2022 | stream->write((uint64_t*)&cgen_var_114, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2023 | stream->write((uint32_t*)&local_memoryRangeCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2024 | for (uint32_t i = 0; i < (uint32_t)((memoryRangeCount)); ++i) |
| 2025 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2026 | marshal_VkMappedMemoryRange(stream, (VkMappedMemoryRange*)(local_pMemoryRanges + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2027 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 2028 | AEMU_SCOPED_TRACE("vkInvalidateMappedMemoryRanges readParams"); |
| 2029 | AEMU_SCOPED_TRACE("vkInvalidateMappedMemoryRanges returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2030 | VkResult vkInvalidateMappedMemoryRanges_VkResult_return = (VkResult)0; |
| 2031 | stream->read(&vkInvalidateMappedMemoryRanges_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2032 | countingStream->clearPool(); |
| 2033 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2034 | pool->freeAll(); |
| Lingfeng Yang | 5c63afd | 2018-12-22 01:21:14 -0800 | [diff] [blame] | 2035 | if (!resources->usingDirectMapping()) |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 2036 | { |
| Lingfeng Yang | 5c63afd | 2018-12-22 01:21:14 -0800 | [diff] [blame] | 2037 | for (uint32_t i = 0; i < memoryRangeCount; ++i) |
| 2038 | { |
| 2039 | auto range = pMemoryRanges[i]; |
| 2040 | auto memory = pMemoryRanges[i].memory; |
| 2041 | auto size = pMemoryRanges[i].size; |
| 2042 | auto offset = pMemoryRanges[i].offset; |
| 2043 | uint64_t streamSize = 0; |
| 2044 | if (!memory) { stream->read(&streamSize, sizeof(uint64_t)); continue; }; |
| 2045 | auto hostPtr = resources->getMappedPointer(memory); |
| 2046 | auto actualSize = size == VK_WHOLE_SIZE ? resources->getMappedSize(memory) : size; |
| 2047 | if (!hostPtr) { stream->read(&streamSize, sizeof(uint64_t)); continue; }; |
| 2048 | streamSize = actualSize; |
| 2049 | stream->read(&streamSize, sizeof(uint64_t)); |
| 2050 | uint8_t* targetRange = hostPtr + offset; |
| 2051 | stream->read(targetRange, actualSize); |
| 2052 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 2053 | } |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2054 | mImpl->log("finish vkInvalidateMappedMemoryRanges");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2055 | return vkInvalidateMappedMemoryRanges_VkResult_return; |
| 2056 | } |
| 2057 | |
| 2058 | void VkEncoder::vkGetDeviceMemoryCommitment( |
| 2059 | VkDevice device, |
| 2060 | VkDeviceMemory memory, |
| 2061 | VkDeviceSize* pCommittedMemoryInBytes) |
| 2062 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 2063 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 2064 | AEMU_SCOPED_TRACE("vkGetDeviceMemoryCommitment encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2065 | mImpl->log("start vkGetDeviceMemoryCommitment"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2066 | auto stream = mImpl->stream(); |
| 2067 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2068 | auto resources = mImpl->resources(); |
| 2069 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2070 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2071 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2072 | VkDeviceMemory local_memory; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 2073 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2074 | local_memory = memory; |
| Lingfeng Yang | 2b1b8cf | 2019-02-08 09:53:36 -0800 | [diff] [blame] | 2075 | 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] | 2076 | countingStream->rewind(); |
| 2077 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2078 | uint64_t cgen_var_115; |
| 2079 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_115, 1); |
| 2080 | countingStream->write((uint64_t*)&cgen_var_115, 1 * 8); |
| 2081 | uint64_t cgen_var_116; |
| 2082 | countingStream->handleMapping()->mapHandles_VkDeviceMemory_u64(&local_memory, &cgen_var_116, 1); |
| 2083 | countingStream->write((uint64_t*)&cgen_var_116, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2084 | countingStream->write((VkDeviceSize*)pCommittedMemoryInBytes, sizeof(VkDeviceSize)); |
| 2085 | } |
| 2086 | uint32_t packetSize_vkGetDeviceMemoryCommitment = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 2087 | countingStream->rewind(); |
| 2088 | uint32_t opcode_vkGetDeviceMemoryCommitment = OP_vkGetDeviceMemoryCommitment; |
| 2089 | stream->write(&opcode_vkGetDeviceMemoryCommitment, sizeof(uint32_t)); |
| 2090 | stream->write(&packetSize_vkGetDeviceMemoryCommitment, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2091 | uint64_t cgen_var_117; |
| 2092 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_117, 1); |
| 2093 | stream->write((uint64_t*)&cgen_var_117, 1 * 8); |
| 2094 | uint64_t cgen_var_118; |
| 2095 | stream->handleMapping()->mapHandles_VkDeviceMemory_u64(&local_memory, &cgen_var_118, 1); |
| 2096 | stream->write((uint64_t*)&cgen_var_118, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2097 | stream->write((VkDeviceSize*)pCommittedMemoryInBytes, sizeof(VkDeviceSize)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 2098 | AEMU_SCOPED_TRACE("vkGetDeviceMemoryCommitment readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2099 | stream->read((VkDeviceSize*)pCommittedMemoryInBytes, sizeof(VkDeviceSize)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 2100 | AEMU_SCOPED_TRACE("vkGetDeviceMemoryCommitment returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2101 | mImpl->log("finish vkGetDeviceMemoryCommitment");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2102 | } |
| 2103 | |
| 2104 | VkResult VkEncoder::vkBindBufferMemory( |
| 2105 | VkDevice device, |
| 2106 | VkBuffer buffer, |
| 2107 | VkDeviceMemory memory, |
| 2108 | VkDeviceSize memoryOffset) |
| 2109 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 2110 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 2111 | AEMU_SCOPED_TRACE("vkBindBufferMemory encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2112 | mImpl->log("start vkBindBufferMemory"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2113 | auto stream = mImpl->stream(); |
| 2114 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2115 | auto resources = mImpl->resources(); |
| 2116 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2117 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2118 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2119 | VkBuffer local_buffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2120 | VkDeviceMemory local_memory; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2121 | VkDeviceSize local_memoryOffset; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 2122 | local_device = device; |
| 2123 | local_buffer = buffer; |
| 2124 | local_memory = memory; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2125 | local_memoryOffset = memoryOffset; |
| Lingfeng Yang | 2b1b8cf | 2019-02-08 09:53:36 -0800 | [diff] [blame] | 2126 | 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] | 2127 | countingStream->rewind(); |
| 2128 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2129 | uint64_t cgen_var_119; |
| 2130 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_119, 1); |
| 2131 | countingStream->write((uint64_t*)&cgen_var_119, 1 * 8); |
| 2132 | uint64_t cgen_var_120; |
| 2133 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_120, 1); |
| 2134 | countingStream->write((uint64_t*)&cgen_var_120, 1 * 8); |
| 2135 | uint64_t cgen_var_121; |
| 2136 | countingStream->handleMapping()->mapHandles_VkDeviceMemory_u64(&local_memory, &cgen_var_121, 1); |
| 2137 | countingStream->write((uint64_t*)&cgen_var_121, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2138 | countingStream->write((VkDeviceSize*)&local_memoryOffset, sizeof(VkDeviceSize)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2139 | } |
| 2140 | uint32_t packetSize_vkBindBufferMemory = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 2141 | countingStream->rewind(); |
| 2142 | uint32_t opcode_vkBindBufferMemory = OP_vkBindBufferMemory; |
| 2143 | stream->write(&opcode_vkBindBufferMemory, sizeof(uint32_t)); |
| 2144 | stream->write(&packetSize_vkBindBufferMemory, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2145 | uint64_t cgen_var_122; |
| 2146 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_122, 1); |
| 2147 | stream->write((uint64_t*)&cgen_var_122, 1 * 8); |
| 2148 | uint64_t cgen_var_123; |
| 2149 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_123, 1); |
| 2150 | stream->write((uint64_t*)&cgen_var_123, 1 * 8); |
| 2151 | uint64_t cgen_var_124; |
| 2152 | stream->handleMapping()->mapHandles_VkDeviceMemory_u64(&local_memory, &cgen_var_124, 1); |
| 2153 | stream->write((uint64_t*)&cgen_var_124, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2154 | stream->write((VkDeviceSize*)&local_memoryOffset, sizeof(VkDeviceSize)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 2155 | AEMU_SCOPED_TRACE("vkBindBufferMemory readParams"); |
| 2156 | AEMU_SCOPED_TRACE("vkBindBufferMemory returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2157 | VkResult vkBindBufferMemory_VkResult_return = (VkResult)0; |
| 2158 | stream->read(&vkBindBufferMemory_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2159 | countingStream->clearPool(); |
| 2160 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2161 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2162 | mImpl->log("finish vkBindBufferMemory");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2163 | return vkBindBufferMemory_VkResult_return; |
| 2164 | } |
| 2165 | |
| 2166 | VkResult VkEncoder::vkBindImageMemory( |
| 2167 | VkDevice device, |
| 2168 | VkImage image, |
| 2169 | VkDeviceMemory memory, |
| 2170 | VkDeviceSize memoryOffset) |
| 2171 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 2172 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 2173 | AEMU_SCOPED_TRACE("vkBindImageMemory encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2174 | mImpl->log("start vkBindImageMemory"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2175 | auto stream = mImpl->stream(); |
| 2176 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2177 | auto resources = mImpl->resources(); |
| 2178 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2179 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2180 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2181 | VkImage local_image; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2182 | VkDeviceMemory local_memory; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2183 | VkDeviceSize local_memoryOffset; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 2184 | local_device = device; |
| 2185 | local_image = image; |
| 2186 | local_memory = memory; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2187 | local_memoryOffset = memoryOffset; |
| Lingfeng Yang | 2b1b8cf | 2019-02-08 09:53:36 -0800 | [diff] [blame] | 2188 | 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] | 2189 | countingStream->rewind(); |
| 2190 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2191 | uint64_t cgen_var_125; |
| 2192 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_125, 1); |
| 2193 | countingStream->write((uint64_t*)&cgen_var_125, 1 * 8); |
| 2194 | uint64_t cgen_var_126; |
| 2195 | countingStream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_126, 1); |
| 2196 | countingStream->write((uint64_t*)&cgen_var_126, 1 * 8); |
| 2197 | uint64_t cgen_var_127; |
| 2198 | countingStream->handleMapping()->mapHandles_VkDeviceMemory_u64(&local_memory, &cgen_var_127, 1); |
| 2199 | countingStream->write((uint64_t*)&cgen_var_127, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2200 | countingStream->write((VkDeviceSize*)&local_memoryOffset, sizeof(VkDeviceSize)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2201 | } |
| 2202 | uint32_t packetSize_vkBindImageMemory = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 2203 | countingStream->rewind(); |
| 2204 | uint32_t opcode_vkBindImageMemory = OP_vkBindImageMemory; |
| 2205 | stream->write(&opcode_vkBindImageMemory, sizeof(uint32_t)); |
| 2206 | stream->write(&packetSize_vkBindImageMemory, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2207 | uint64_t cgen_var_128; |
| 2208 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_128, 1); |
| 2209 | stream->write((uint64_t*)&cgen_var_128, 1 * 8); |
| 2210 | uint64_t cgen_var_129; |
| 2211 | stream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_129, 1); |
| 2212 | stream->write((uint64_t*)&cgen_var_129, 1 * 8); |
| 2213 | uint64_t cgen_var_130; |
| 2214 | stream->handleMapping()->mapHandles_VkDeviceMemory_u64(&local_memory, &cgen_var_130, 1); |
| 2215 | stream->write((uint64_t*)&cgen_var_130, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2216 | stream->write((VkDeviceSize*)&local_memoryOffset, sizeof(VkDeviceSize)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 2217 | AEMU_SCOPED_TRACE("vkBindImageMemory readParams"); |
| 2218 | AEMU_SCOPED_TRACE("vkBindImageMemory returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2219 | VkResult vkBindImageMemory_VkResult_return = (VkResult)0; |
| 2220 | stream->read(&vkBindImageMemory_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2221 | countingStream->clearPool(); |
| 2222 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2223 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2224 | mImpl->log("finish vkBindImageMemory");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2225 | return vkBindImageMemory_VkResult_return; |
| 2226 | } |
| 2227 | |
| 2228 | void VkEncoder::vkGetBufferMemoryRequirements( |
| 2229 | VkDevice device, |
| 2230 | VkBuffer buffer, |
| 2231 | VkMemoryRequirements* pMemoryRequirements) |
| 2232 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 2233 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 2234 | AEMU_SCOPED_TRACE("vkGetBufferMemoryRequirements encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2235 | mImpl->log("start vkGetBufferMemoryRequirements"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2236 | auto stream = mImpl->stream(); |
| 2237 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2238 | auto resources = mImpl->resources(); |
| 2239 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2240 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2241 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2242 | VkBuffer local_buffer; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 2243 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2244 | local_buffer = buffer; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2245 | countingStream->rewind(); |
| 2246 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2247 | uint64_t cgen_var_131; |
| 2248 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_131, 1); |
| 2249 | countingStream->write((uint64_t*)&cgen_var_131, 1 * 8); |
| 2250 | uint64_t cgen_var_132; |
| 2251 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_132, 1); |
| 2252 | countingStream->write((uint64_t*)&cgen_var_132, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2253 | marshal_VkMemoryRequirements(countingStream, (VkMemoryRequirements*)(pMemoryRequirements)); |
| 2254 | } |
| 2255 | uint32_t packetSize_vkGetBufferMemoryRequirements = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 2256 | countingStream->rewind(); |
| 2257 | uint32_t opcode_vkGetBufferMemoryRequirements = OP_vkGetBufferMemoryRequirements; |
| 2258 | stream->write(&opcode_vkGetBufferMemoryRequirements, sizeof(uint32_t)); |
| 2259 | stream->write(&packetSize_vkGetBufferMemoryRequirements, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2260 | uint64_t cgen_var_133; |
| 2261 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_133, 1); |
| 2262 | stream->write((uint64_t*)&cgen_var_133, 1 * 8); |
| 2263 | uint64_t cgen_var_134; |
| 2264 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_134, 1); |
| 2265 | stream->write((uint64_t*)&cgen_var_134, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2266 | marshal_VkMemoryRequirements(stream, (VkMemoryRequirements*)(pMemoryRequirements)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 2267 | AEMU_SCOPED_TRACE("vkGetBufferMemoryRequirements readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2268 | unmarshal_VkMemoryRequirements(stream, (VkMemoryRequirements*)(pMemoryRequirements)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 2269 | if (pMemoryRequirements) |
| 2270 | { |
| 2271 | transform_fromhost_VkMemoryRequirements(mImpl->resources(), (VkMemoryRequirements*)(pMemoryRequirements)); |
| 2272 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 2273 | AEMU_SCOPED_TRACE("vkGetBufferMemoryRequirements returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2274 | mImpl->log("finish vkGetBufferMemoryRequirements");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2275 | } |
| 2276 | |
| 2277 | void VkEncoder::vkGetImageMemoryRequirements( |
| 2278 | VkDevice device, |
| 2279 | VkImage image, |
| 2280 | VkMemoryRequirements* pMemoryRequirements) |
| 2281 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 2282 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 2283 | AEMU_SCOPED_TRACE("vkGetImageMemoryRequirements encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2284 | mImpl->log("start vkGetImageMemoryRequirements"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2285 | auto stream = mImpl->stream(); |
| 2286 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2287 | auto resources = mImpl->resources(); |
| 2288 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2289 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2290 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2291 | VkImage local_image; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 2292 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2293 | local_image = image; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2294 | countingStream->rewind(); |
| 2295 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2296 | uint64_t cgen_var_135; |
| 2297 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_135, 1); |
| 2298 | countingStream->write((uint64_t*)&cgen_var_135, 1 * 8); |
| 2299 | uint64_t cgen_var_136; |
| 2300 | countingStream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_136, 1); |
| 2301 | countingStream->write((uint64_t*)&cgen_var_136, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2302 | marshal_VkMemoryRequirements(countingStream, (VkMemoryRequirements*)(pMemoryRequirements)); |
| 2303 | } |
| 2304 | uint32_t packetSize_vkGetImageMemoryRequirements = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 2305 | countingStream->rewind(); |
| 2306 | uint32_t opcode_vkGetImageMemoryRequirements = OP_vkGetImageMemoryRequirements; |
| 2307 | stream->write(&opcode_vkGetImageMemoryRequirements, sizeof(uint32_t)); |
| 2308 | stream->write(&packetSize_vkGetImageMemoryRequirements, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2309 | uint64_t cgen_var_137; |
| 2310 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_137, 1); |
| 2311 | stream->write((uint64_t*)&cgen_var_137, 1 * 8); |
| 2312 | uint64_t cgen_var_138; |
| 2313 | stream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_138, 1); |
| 2314 | stream->write((uint64_t*)&cgen_var_138, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2315 | marshal_VkMemoryRequirements(stream, (VkMemoryRequirements*)(pMemoryRequirements)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 2316 | AEMU_SCOPED_TRACE("vkGetImageMemoryRequirements readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2317 | unmarshal_VkMemoryRequirements(stream, (VkMemoryRequirements*)(pMemoryRequirements)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 2318 | if (pMemoryRequirements) |
| 2319 | { |
| 2320 | transform_fromhost_VkMemoryRequirements(mImpl->resources(), (VkMemoryRequirements*)(pMemoryRequirements)); |
| 2321 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 2322 | AEMU_SCOPED_TRACE("vkGetImageMemoryRequirements returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2323 | mImpl->log("finish vkGetImageMemoryRequirements");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2324 | } |
| 2325 | |
| 2326 | void VkEncoder::vkGetImageSparseMemoryRequirements( |
| 2327 | VkDevice device, |
| 2328 | VkImage image, |
| 2329 | uint32_t* pSparseMemoryRequirementCount, |
| 2330 | VkSparseImageMemoryRequirements* pSparseMemoryRequirements) |
| 2331 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 2332 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 2333 | AEMU_SCOPED_TRACE("vkGetImageSparseMemoryRequirements encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2334 | mImpl->log("start vkGetImageSparseMemoryRequirements"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2335 | auto stream = mImpl->stream(); |
| 2336 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2337 | auto resources = mImpl->resources(); |
| 2338 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2339 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2340 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2341 | VkImage local_image; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 2342 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2343 | local_image = image; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2344 | countingStream->rewind(); |
| 2345 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2346 | uint64_t cgen_var_139; |
| 2347 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_139, 1); |
| 2348 | countingStream->write((uint64_t*)&cgen_var_139, 1 * 8); |
| 2349 | uint64_t cgen_var_140; |
| 2350 | countingStream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_140, 1); |
| 2351 | countingStream->write((uint64_t*)&cgen_var_140, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2352 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2353 | uint64_t cgen_var_141 = (uint64_t)(uintptr_t)pSparseMemoryRequirementCount; |
| 2354 | countingStream->putBe64(cgen_var_141); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2355 | if (pSparseMemoryRequirementCount) |
| 2356 | { |
| 2357 | countingStream->write((uint32_t*)pSparseMemoryRequirementCount, sizeof(uint32_t)); |
| 2358 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2359 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2360 | uint64_t cgen_var_142 = (uint64_t)(uintptr_t)pSparseMemoryRequirements; |
| 2361 | countingStream->putBe64(cgen_var_142); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2362 | if (pSparseMemoryRequirements) |
| 2363 | { |
| 2364 | for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i) |
| 2365 | { |
| 2366 | marshal_VkSparseImageMemoryRequirements(countingStream, (VkSparseImageMemoryRequirements*)(pSparseMemoryRequirements + i)); |
| 2367 | } |
| 2368 | } |
| 2369 | } |
| 2370 | uint32_t packetSize_vkGetImageSparseMemoryRequirements = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 2371 | countingStream->rewind(); |
| 2372 | uint32_t opcode_vkGetImageSparseMemoryRequirements = OP_vkGetImageSparseMemoryRequirements; |
| 2373 | stream->write(&opcode_vkGetImageSparseMemoryRequirements, sizeof(uint32_t)); |
| 2374 | stream->write(&packetSize_vkGetImageSparseMemoryRequirements, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2375 | uint64_t cgen_var_143; |
| 2376 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_143, 1); |
| 2377 | stream->write((uint64_t*)&cgen_var_143, 1 * 8); |
| 2378 | uint64_t cgen_var_144; |
| 2379 | stream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_144, 1); |
| 2380 | stream->write((uint64_t*)&cgen_var_144, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2381 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2382 | uint64_t cgen_var_145 = (uint64_t)(uintptr_t)pSparseMemoryRequirementCount; |
| 2383 | stream->putBe64(cgen_var_145); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2384 | if (pSparseMemoryRequirementCount) |
| 2385 | { |
| 2386 | stream->write((uint32_t*)pSparseMemoryRequirementCount, sizeof(uint32_t)); |
| 2387 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2388 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2389 | uint64_t cgen_var_146 = (uint64_t)(uintptr_t)pSparseMemoryRequirements; |
| 2390 | stream->putBe64(cgen_var_146); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2391 | if (pSparseMemoryRequirements) |
| 2392 | { |
| 2393 | for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i) |
| 2394 | { |
| 2395 | marshal_VkSparseImageMemoryRequirements(stream, (VkSparseImageMemoryRequirements*)(pSparseMemoryRequirements + i)); |
| 2396 | } |
| 2397 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 2398 | AEMU_SCOPED_TRACE("vkGetImageSparseMemoryRequirements readParams"); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2399 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2400 | uint32_t* check_pSparseMemoryRequirementCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2401 | check_pSparseMemoryRequirementCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2402 | if (pSparseMemoryRequirementCount) |
| 2403 | { |
| 2404 | if (!(check_pSparseMemoryRequirementCount)) |
| 2405 | { |
| 2406 | fprintf(stderr, "fatal: pSparseMemoryRequirementCount inconsistent between guest and host\n"); |
| 2407 | } |
| 2408 | stream->read((uint32_t*)pSparseMemoryRequirementCount, sizeof(uint32_t)); |
| 2409 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2410 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2411 | VkSparseImageMemoryRequirements* check_pSparseMemoryRequirements; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2412 | check_pSparseMemoryRequirements = (VkSparseImageMemoryRequirements*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2413 | if (pSparseMemoryRequirements) |
| 2414 | { |
| 2415 | if (!(check_pSparseMemoryRequirements)) |
| 2416 | { |
| 2417 | fprintf(stderr, "fatal: pSparseMemoryRequirements inconsistent between guest and host\n"); |
| 2418 | } |
| 2419 | for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i) |
| 2420 | { |
| 2421 | unmarshal_VkSparseImageMemoryRequirements(stream, (VkSparseImageMemoryRequirements*)(pSparseMemoryRequirements + i)); |
| 2422 | } |
| 2423 | } |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 2424 | if (pSparseMemoryRequirements) |
| 2425 | { |
| 2426 | for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i) |
| 2427 | { |
| 2428 | transform_fromhost_VkSparseImageMemoryRequirements(mImpl->resources(), (VkSparseImageMemoryRequirements*)(pSparseMemoryRequirements + i)); |
| 2429 | } |
| 2430 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 2431 | AEMU_SCOPED_TRACE("vkGetImageSparseMemoryRequirements returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2432 | mImpl->log("finish vkGetImageSparseMemoryRequirements");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2433 | } |
| 2434 | |
| 2435 | void VkEncoder::vkGetPhysicalDeviceSparseImageFormatProperties( |
| 2436 | VkPhysicalDevice physicalDevice, |
| 2437 | VkFormat format, |
| 2438 | VkImageType type, |
| 2439 | VkSampleCountFlagBits samples, |
| 2440 | VkImageUsageFlags usage, |
| 2441 | VkImageTiling tiling, |
| 2442 | uint32_t* pPropertyCount, |
| 2443 | VkSparseImageFormatProperties* pProperties) |
| 2444 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 2445 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 2446 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceSparseImageFormatProperties encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2447 | mImpl->log("start vkGetPhysicalDeviceSparseImageFormatProperties"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2448 | auto stream = mImpl->stream(); |
| 2449 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2450 | auto resources = mImpl->resources(); |
| 2451 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2452 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2453 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2454 | VkFormat local_format; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2455 | VkImageType local_type; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2456 | VkSampleCountFlagBits local_samples; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2457 | VkImageUsageFlags local_usage; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2458 | VkImageTiling local_tiling; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 2459 | local_physicalDevice = physicalDevice; |
| 2460 | local_format = format; |
| 2461 | local_type = type; |
| 2462 | local_samples = samples; |
| 2463 | local_usage = usage; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2464 | local_tiling = tiling; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2465 | countingStream->rewind(); |
| 2466 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2467 | uint64_t cgen_var_149; |
| 2468 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_149, 1); |
| 2469 | countingStream->write((uint64_t*)&cgen_var_149, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2470 | countingStream->write((VkFormat*)&local_format, sizeof(VkFormat)); |
| 2471 | countingStream->write((VkImageType*)&local_type, sizeof(VkImageType)); |
| 2472 | countingStream->write((VkSampleCountFlagBits*)&local_samples, sizeof(VkSampleCountFlagBits)); |
| 2473 | countingStream->write((VkImageUsageFlags*)&local_usage, sizeof(VkImageUsageFlags)); |
| 2474 | countingStream->write((VkImageTiling*)&local_tiling, sizeof(VkImageTiling)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2475 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2476 | uint64_t cgen_var_150 = (uint64_t)(uintptr_t)pPropertyCount; |
| 2477 | countingStream->putBe64(cgen_var_150); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2478 | if (pPropertyCount) |
| 2479 | { |
| 2480 | countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 2481 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2482 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2483 | uint64_t cgen_var_151 = (uint64_t)(uintptr_t)pProperties; |
| 2484 | countingStream->putBe64(cgen_var_151); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2485 | if (pProperties) |
| 2486 | { |
| 2487 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 2488 | { |
| 2489 | marshal_VkSparseImageFormatProperties(countingStream, (VkSparseImageFormatProperties*)(pProperties + i)); |
| 2490 | } |
| 2491 | } |
| 2492 | } |
| 2493 | uint32_t packetSize_vkGetPhysicalDeviceSparseImageFormatProperties = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 2494 | countingStream->rewind(); |
| 2495 | uint32_t opcode_vkGetPhysicalDeviceSparseImageFormatProperties = OP_vkGetPhysicalDeviceSparseImageFormatProperties; |
| 2496 | stream->write(&opcode_vkGetPhysicalDeviceSparseImageFormatProperties, sizeof(uint32_t)); |
| 2497 | stream->write(&packetSize_vkGetPhysicalDeviceSparseImageFormatProperties, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2498 | uint64_t cgen_var_152; |
| 2499 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_152, 1); |
| 2500 | stream->write((uint64_t*)&cgen_var_152, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2501 | stream->write((VkFormat*)&local_format, sizeof(VkFormat)); |
| 2502 | stream->write((VkImageType*)&local_type, sizeof(VkImageType)); |
| 2503 | stream->write((VkSampleCountFlagBits*)&local_samples, sizeof(VkSampleCountFlagBits)); |
| 2504 | stream->write((VkImageUsageFlags*)&local_usage, sizeof(VkImageUsageFlags)); |
| 2505 | stream->write((VkImageTiling*)&local_tiling, sizeof(VkImageTiling)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2506 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2507 | uint64_t cgen_var_153 = (uint64_t)(uintptr_t)pPropertyCount; |
| 2508 | stream->putBe64(cgen_var_153); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2509 | if (pPropertyCount) |
| 2510 | { |
| 2511 | stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 2512 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2513 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2514 | uint64_t cgen_var_154 = (uint64_t)(uintptr_t)pProperties; |
| 2515 | stream->putBe64(cgen_var_154); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2516 | if (pProperties) |
| 2517 | { |
| 2518 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 2519 | { |
| 2520 | marshal_VkSparseImageFormatProperties(stream, (VkSparseImageFormatProperties*)(pProperties + i)); |
| 2521 | } |
| 2522 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 2523 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceSparseImageFormatProperties readParams"); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2524 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2525 | uint32_t* check_pPropertyCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2526 | check_pPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2527 | if (pPropertyCount) |
| 2528 | { |
| 2529 | if (!(check_pPropertyCount)) |
| 2530 | { |
| 2531 | fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n"); |
| 2532 | } |
| 2533 | stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 2534 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2535 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2536 | VkSparseImageFormatProperties* check_pProperties; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2537 | check_pProperties = (VkSparseImageFormatProperties*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2538 | if (pProperties) |
| 2539 | { |
| 2540 | if (!(check_pProperties)) |
| 2541 | { |
| 2542 | fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n"); |
| 2543 | } |
| 2544 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 2545 | { |
| 2546 | unmarshal_VkSparseImageFormatProperties(stream, (VkSparseImageFormatProperties*)(pProperties + i)); |
| 2547 | } |
| 2548 | } |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 2549 | if (pProperties) |
| 2550 | { |
| 2551 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 2552 | { |
| 2553 | transform_fromhost_VkSparseImageFormatProperties(mImpl->resources(), (VkSparseImageFormatProperties*)(pProperties + i)); |
| 2554 | } |
| 2555 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 2556 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceSparseImageFormatProperties returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2557 | mImpl->log("finish vkGetPhysicalDeviceSparseImageFormatProperties");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2558 | } |
| 2559 | |
| 2560 | VkResult VkEncoder::vkQueueBindSparse( |
| 2561 | VkQueue queue, |
| 2562 | uint32_t bindInfoCount, |
| 2563 | const VkBindSparseInfo* pBindInfo, |
| 2564 | VkFence fence) |
| 2565 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 2566 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 2567 | AEMU_SCOPED_TRACE("vkQueueBindSparse encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2568 | mImpl->log("start vkQueueBindSparse"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2569 | auto stream = mImpl->stream(); |
| 2570 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2571 | auto resources = mImpl->resources(); |
| 2572 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2573 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2574 | VkQueue local_queue; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2575 | uint32_t local_bindInfoCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2576 | VkBindSparseInfo* local_pBindInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 2577 | VkFence local_fence; |
| 2578 | local_queue = queue; |
| 2579 | local_bindInfoCount = bindInfoCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2580 | local_pBindInfo = nullptr; |
| 2581 | if (pBindInfo) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2582 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2583 | local_pBindInfo = (VkBindSparseInfo*)pool->alloc(((bindInfoCount)) * sizeof(const VkBindSparseInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2584 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 2585 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2586 | deepcopy_VkBindSparseInfo(pool, pBindInfo + i, (VkBindSparseInfo*)(local_pBindInfo + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2587 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2588 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2589 | local_fence = fence; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 2590 | if (local_pBindInfo) |
| 2591 | { |
| 2592 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 2593 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 2594 | transform_tohost_VkBindSparseInfo(mImpl->resources(), (VkBindSparseInfo*)(local_pBindInfo + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 2595 | } |
| 2596 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2597 | countingStream->rewind(); |
| 2598 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2599 | uint64_t cgen_var_157; |
| 2600 | countingStream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_157, 1); |
| 2601 | countingStream->write((uint64_t*)&cgen_var_157, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2602 | countingStream->write((uint32_t*)&local_bindInfoCount, sizeof(uint32_t)); |
| 2603 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 2604 | { |
| 2605 | marshal_VkBindSparseInfo(countingStream, (VkBindSparseInfo*)(local_pBindInfo + i)); |
| 2606 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2607 | uint64_t cgen_var_158; |
| 2608 | countingStream->handleMapping()->mapHandles_VkFence_u64(&local_fence, &cgen_var_158, 1); |
| 2609 | countingStream->write((uint64_t*)&cgen_var_158, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2610 | } |
| 2611 | uint32_t packetSize_vkQueueBindSparse = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 2612 | countingStream->rewind(); |
| 2613 | uint32_t opcode_vkQueueBindSparse = OP_vkQueueBindSparse; |
| 2614 | stream->write(&opcode_vkQueueBindSparse, sizeof(uint32_t)); |
| 2615 | stream->write(&packetSize_vkQueueBindSparse, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2616 | uint64_t cgen_var_159; |
| 2617 | stream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_159, 1); |
| 2618 | stream->write((uint64_t*)&cgen_var_159, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2619 | stream->write((uint32_t*)&local_bindInfoCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2620 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 2621 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2622 | marshal_VkBindSparseInfo(stream, (VkBindSparseInfo*)(local_pBindInfo + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2623 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2624 | uint64_t cgen_var_160; |
| 2625 | stream->handleMapping()->mapHandles_VkFence_u64(&local_fence, &cgen_var_160, 1); |
| 2626 | stream->write((uint64_t*)&cgen_var_160, 1 * 8); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 2627 | AEMU_SCOPED_TRACE("vkQueueBindSparse readParams"); |
| 2628 | AEMU_SCOPED_TRACE("vkQueueBindSparse returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2629 | VkResult vkQueueBindSparse_VkResult_return = (VkResult)0; |
| 2630 | stream->read(&vkQueueBindSparse_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2631 | countingStream->clearPool(); |
| 2632 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2633 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2634 | mImpl->log("finish vkQueueBindSparse");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2635 | return vkQueueBindSparse_VkResult_return; |
| 2636 | } |
| 2637 | |
| 2638 | VkResult VkEncoder::vkCreateFence( |
| 2639 | VkDevice device, |
| 2640 | const VkFenceCreateInfo* pCreateInfo, |
| 2641 | const VkAllocationCallbacks* pAllocator, |
| 2642 | VkFence* pFence) |
| 2643 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 2644 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 2645 | AEMU_SCOPED_TRACE("vkCreateFence encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2646 | mImpl->log("start vkCreateFence"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2647 | auto stream = mImpl->stream(); |
| 2648 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2649 | auto resources = mImpl->resources(); |
| 2650 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2651 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2652 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2653 | VkFenceCreateInfo* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 2654 | VkAllocationCallbacks* local_pAllocator; |
| 2655 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2656 | local_pCreateInfo = nullptr; |
| 2657 | if (pCreateInfo) |
| 2658 | { |
| 2659 | local_pCreateInfo = (VkFenceCreateInfo*)pool->alloc(sizeof(const VkFenceCreateInfo)); |
| 2660 | deepcopy_VkFenceCreateInfo(pool, pCreateInfo, (VkFenceCreateInfo*)(local_pCreateInfo)); |
| 2661 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2662 | local_pAllocator = nullptr; |
| 2663 | if (pAllocator) |
| 2664 | { |
| 2665 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 2666 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 2667 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 2668 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 2669 | if (local_pCreateInfo) |
| 2670 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 2671 | transform_tohost_VkFenceCreateInfo(mImpl->resources(), (VkFenceCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 2672 | } |
| 2673 | if (local_pAllocator) |
| 2674 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 2675 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 2676 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2677 | countingStream->rewind(); |
| 2678 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2679 | uint64_t cgen_var_161; |
| 2680 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_161, 1); |
| 2681 | countingStream->write((uint64_t*)&cgen_var_161, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2682 | marshal_VkFenceCreateInfo(countingStream, (VkFenceCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2683 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2684 | uint64_t cgen_var_162 = (uint64_t)(uintptr_t)local_pAllocator; |
| 2685 | countingStream->putBe64(cgen_var_162); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2686 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2687 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2688 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2689 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2690 | uint64_t cgen_var_163; |
| 2691 | countingStream->handleMapping()->mapHandles_VkFence_u64(pFence, &cgen_var_163, 1); |
| 2692 | countingStream->write((uint64_t*)&cgen_var_163, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2693 | } |
| 2694 | uint32_t packetSize_vkCreateFence = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 2695 | countingStream->rewind(); |
| 2696 | uint32_t opcode_vkCreateFence = OP_vkCreateFence; |
| 2697 | stream->write(&opcode_vkCreateFence, sizeof(uint32_t)); |
| 2698 | stream->write(&packetSize_vkCreateFence, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2699 | uint64_t cgen_var_164; |
| 2700 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_164, 1); |
| 2701 | stream->write((uint64_t*)&cgen_var_164, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2702 | marshal_VkFenceCreateInfo(stream, (VkFenceCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2703 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2704 | uint64_t cgen_var_165 = (uint64_t)(uintptr_t)local_pAllocator; |
| 2705 | stream->putBe64(cgen_var_165); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2706 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2707 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2708 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2709 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2710 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2711 | uint64_t cgen_var_166; |
| 2712 | stream->handleMapping()->mapHandles_VkFence_u64(pFence, &cgen_var_166, 1); |
| 2713 | stream->write((uint64_t*)&cgen_var_166, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2714 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 2715 | AEMU_SCOPED_TRACE("vkCreateFence readParams"); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2716 | stream->setHandleMapping(resources->createMapping()); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2717 | uint64_t cgen_var_167; |
| 2718 | stream->read((uint64_t*)&cgen_var_167, 8); |
| 2719 | stream->handleMapping()->mapHandles_u64_VkFence(&cgen_var_167, (VkFence*)pFence, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2720 | stream->unsetHandleMapping(); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 2721 | AEMU_SCOPED_TRACE("vkCreateFence returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2722 | VkResult vkCreateFence_VkResult_return = (VkResult)0; |
| 2723 | stream->read(&vkCreateFence_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2724 | countingStream->clearPool(); |
| 2725 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2726 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2727 | mImpl->log("finish vkCreateFence");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2728 | return vkCreateFence_VkResult_return; |
| 2729 | } |
| 2730 | |
| 2731 | void VkEncoder::vkDestroyFence( |
| 2732 | VkDevice device, |
| 2733 | VkFence fence, |
| 2734 | const VkAllocationCallbacks* pAllocator) |
| 2735 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 2736 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 2737 | AEMU_SCOPED_TRACE("vkDestroyFence encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2738 | mImpl->log("start vkDestroyFence"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2739 | auto stream = mImpl->stream(); |
| 2740 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2741 | auto resources = mImpl->resources(); |
| 2742 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2743 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2744 | VkDevice local_device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 2745 | VkFence local_fence; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2746 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 2747 | local_device = device; |
| 2748 | local_fence = fence; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2749 | local_pAllocator = nullptr; |
| 2750 | if (pAllocator) |
| 2751 | { |
| 2752 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 2753 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 2754 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 2755 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 2756 | if (local_pAllocator) |
| 2757 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 2758 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 2759 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2760 | countingStream->rewind(); |
| 2761 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2762 | uint64_t cgen_var_168; |
| 2763 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_168, 1); |
| 2764 | countingStream->write((uint64_t*)&cgen_var_168, 1 * 8); |
| 2765 | uint64_t cgen_var_169; |
| 2766 | countingStream->handleMapping()->mapHandles_VkFence_u64(&local_fence, &cgen_var_169, 1); |
| 2767 | countingStream->write((uint64_t*)&cgen_var_169, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2768 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2769 | uint64_t cgen_var_170 = (uint64_t)(uintptr_t)local_pAllocator; |
| 2770 | countingStream->putBe64(cgen_var_170); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2771 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2772 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2773 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2774 | } |
| 2775 | } |
| 2776 | uint32_t packetSize_vkDestroyFence = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 2777 | countingStream->rewind(); |
| 2778 | uint32_t opcode_vkDestroyFence = OP_vkDestroyFence; |
| 2779 | stream->write(&opcode_vkDestroyFence, sizeof(uint32_t)); |
| 2780 | stream->write(&packetSize_vkDestroyFence, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2781 | uint64_t cgen_var_171; |
| 2782 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_171, 1); |
| 2783 | stream->write((uint64_t*)&cgen_var_171, 1 * 8); |
| 2784 | uint64_t cgen_var_172; |
| 2785 | stream->handleMapping()->mapHandles_VkFence_u64(&local_fence, &cgen_var_172, 1); |
| 2786 | stream->write((uint64_t*)&cgen_var_172, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2787 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2788 | uint64_t cgen_var_173 = (uint64_t)(uintptr_t)local_pAllocator; |
| 2789 | stream->putBe64(cgen_var_173); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2790 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2791 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2792 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2793 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 2794 | AEMU_SCOPED_TRACE("vkDestroyFence readParams"); |
| 2795 | AEMU_SCOPED_TRACE("vkDestroyFence returnUnmarshal"); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2796 | resources->destroyMapping()->mapHandles_VkFence((VkFence*)&fence); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2797 | mImpl->log("finish vkDestroyFence");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2798 | } |
| 2799 | |
| 2800 | VkResult VkEncoder::vkResetFences( |
| 2801 | VkDevice device, |
| 2802 | uint32_t fenceCount, |
| 2803 | const VkFence* pFences) |
| 2804 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 2805 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 2806 | AEMU_SCOPED_TRACE("vkResetFences encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2807 | mImpl->log("start vkResetFences"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2808 | auto stream = mImpl->stream(); |
| 2809 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2810 | auto resources = mImpl->resources(); |
| 2811 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2812 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2813 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2814 | uint32_t local_fenceCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2815 | VkFence* local_pFences; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 2816 | local_device = device; |
| 2817 | local_fenceCount = fenceCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2818 | local_pFences = nullptr; |
| 2819 | if (pFences) |
| 2820 | { |
| 2821 | local_pFences = (VkFence*)pool->dupArray(pFences, ((fenceCount)) * sizeof(const VkFence)); |
| 2822 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2823 | countingStream->rewind(); |
| 2824 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2825 | uint64_t cgen_var_174; |
| 2826 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_174, 1); |
| 2827 | countingStream->write((uint64_t*)&cgen_var_174, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2828 | countingStream->write((uint32_t*)&local_fenceCount, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2829 | if (((fenceCount))) |
| 2830 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2831 | uint64_t* cgen_var_175; |
| 2832 | countingStream->alloc((void**)&cgen_var_175, ((fenceCount)) * 8); |
| 2833 | countingStream->handleMapping()->mapHandles_VkFence_u64(local_pFences, cgen_var_175, ((fenceCount))); |
| 2834 | countingStream->write((uint64_t*)cgen_var_175, ((fenceCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2835 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2836 | } |
| 2837 | uint32_t packetSize_vkResetFences = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 2838 | countingStream->rewind(); |
| 2839 | uint32_t opcode_vkResetFences = OP_vkResetFences; |
| 2840 | stream->write(&opcode_vkResetFences, sizeof(uint32_t)); |
| 2841 | stream->write(&packetSize_vkResetFences, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2842 | uint64_t cgen_var_176; |
| 2843 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_176, 1); |
| 2844 | stream->write((uint64_t*)&cgen_var_176, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2845 | stream->write((uint32_t*)&local_fenceCount, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2846 | if (((fenceCount))) |
| 2847 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2848 | uint64_t* cgen_var_177; |
| 2849 | stream->alloc((void**)&cgen_var_177, ((fenceCount)) * 8); |
| 2850 | stream->handleMapping()->mapHandles_VkFence_u64(local_pFences, cgen_var_177, ((fenceCount))); |
| 2851 | stream->write((uint64_t*)cgen_var_177, ((fenceCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2852 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 2853 | AEMU_SCOPED_TRACE("vkResetFences readParams"); |
| 2854 | AEMU_SCOPED_TRACE("vkResetFences returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2855 | VkResult vkResetFences_VkResult_return = (VkResult)0; |
| 2856 | stream->read(&vkResetFences_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2857 | countingStream->clearPool(); |
| 2858 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2859 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2860 | mImpl->log("finish vkResetFences");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2861 | return vkResetFences_VkResult_return; |
| 2862 | } |
| 2863 | |
| 2864 | VkResult VkEncoder::vkGetFenceStatus( |
| 2865 | VkDevice device, |
| 2866 | VkFence fence) |
| 2867 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 2868 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 2869 | AEMU_SCOPED_TRACE("vkGetFenceStatus encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2870 | mImpl->log("start vkGetFenceStatus"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2871 | auto stream = mImpl->stream(); |
| 2872 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2873 | auto resources = mImpl->resources(); |
| 2874 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2875 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2876 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2877 | VkFence local_fence; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 2878 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2879 | local_fence = fence; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2880 | countingStream->rewind(); |
| 2881 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2882 | uint64_t cgen_var_178; |
| 2883 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_178, 1); |
| 2884 | countingStream->write((uint64_t*)&cgen_var_178, 1 * 8); |
| 2885 | uint64_t cgen_var_179; |
| 2886 | countingStream->handleMapping()->mapHandles_VkFence_u64(&local_fence, &cgen_var_179, 1); |
| 2887 | countingStream->write((uint64_t*)&cgen_var_179, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2888 | } |
| 2889 | uint32_t packetSize_vkGetFenceStatus = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 2890 | countingStream->rewind(); |
| 2891 | uint32_t opcode_vkGetFenceStatus = OP_vkGetFenceStatus; |
| 2892 | stream->write(&opcode_vkGetFenceStatus, sizeof(uint32_t)); |
| 2893 | stream->write(&packetSize_vkGetFenceStatus, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2894 | uint64_t cgen_var_180; |
| 2895 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_180, 1); |
| 2896 | stream->write((uint64_t*)&cgen_var_180, 1 * 8); |
| 2897 | uint64_t cgen_var_181; |
| 2898 | stream->handleMapping()->mapHandles_VkFence_u64(&local_fence, &cgen_var_181, 1); |
| 2899 | stream->write((uint64_t*)&cgen_var_181, 1 * 8); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 2900 | AEMU_SCOPED_TRACE("vkGetFenceStatus readParams"); |
| 2901 | AEMU_SCOPED_TRACE("vkGetFenceStatus returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2902 | VkResult vkGetFenceStatus_VkResult_return = (VkResult)0; |
| 2903 | stream->read(&vkGetFenceStatus_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2904 | countingStream->clearPool(); |
| 2905 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2906 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2907 | mImpl->log("finish vkGetFenceStatus");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2908 | return vkGetFenceStatus_VkResult_return; |
| 2909 | } |
| 2910 | |
| 2911 | VkResult VkEncoder::vkWaitForFences( |
| 2912 | VkDevice device, |
| 2913 | uint32_t fenceCount, |
| 2914 | const VkFence* pFences, |
| 2915 | VkBool32 waitAll, |
| 2916 | uint64_t timeout) |
| 2917 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 2918 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 2919 | AEMU_SCOPED_TRACE("vkWaitForFences encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2920 | mImpl->log("start vkWaitForFences"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2921 | auto stream = mImpl->stream(); |
| 2922 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2923 | auto resources = mImpl->resources(); |
| 2924 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2925 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2926 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2927 | uint32_t local_fenceCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2928 | VkFence* local_pFences; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 2929 | VkBool32 local_waitAll; |
| 2930 | uint64_t local_timeout; |
| 2931 | local_device = device; |
| 2932 | local_fenceCount = fenceCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2933 | local_pFences = nullptr; |
| 2934 | if (pFences) |
| 2935 | { |
| 2936 | local_pFences = (VkFence*)pool->dupArray(pFences, ((fenceCount)) * sizeof(const VkFence)); |
| 2937 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2938 | local_waitAll = waitAll; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2939 | local_timeout = timeout; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2940 | countingStream->rewind(); |
| 2941 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2942 | uint64_t cgen_var_182; |
| 2943 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_182, 1); |
| 2944 | countingStream->write((uint64_t*)&cgen_var_182, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2945 | countingStream->write((uint32_t*)&local_fenceCount, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2946 | if (((fenceCount))) |
| 2947 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2948 | uint64_t* cgen_var_183; |
| 2949 | countingStream->alloc((void**)&cgen_var_183, ((fenceCount)) * 8); |
| 2950 | countingStream->handleMapping()->mapHandles_VkFence_u64(local_pFences, cgen_var_183, ((fenceCount))); |
| 2951 | countingStream->write((uint64_t*)cgen_var_183, ((fenceCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2952 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2953 | countingStream->write((VkBool32*)&local_waitAll, sizeof(VkBool32)); |
| 2954 | countingStream->write((uint64_t*)&local_timeout, sizeof(uint64_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2955 | } |
| 2956 | uint32_t packetSize_vkWaitForFences = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 2957 | countingStream->rewind(); |
| 2958 | uint32_t opcode_vkWaitForFences = OP_vkWaitForFences; |
| 2959 | stream->write(&opcode_vkWaitForFences, sizeof(uint32_t)); |
| 2960 | stream->write(&packetSize_vkWaitForFences, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2961 | uint64_t cgen_var_184; |
| 2962 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_184, 1); |
| 2963 | stream->write((uint64_t*)&cgen_var_184, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2964 | stream->write((uint32_t*)&local_fenceCount, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2965 | if (((fenceCount))) |
| 2966 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2967 | uint64_t* cgen_var_185; |
| 2968 | stream->alloc((void**)&cgen_var_185, ((fenceCount)) * 8); |
| 2969 | stream->handleMapping()->mapHandles_VkFence_u64(local_pFences, cgen_var_185, ((fenceCount))); |
| 2970 | stream->write((uint64_t*)cgen_var_185, ((fenceCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2971 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2972 | stream->write((VkBool32*)&local_waitAll, sizeof(VkBool32)); |
| 2973 | stream->write((uint64_t*)&local_timeout, sizeof(uint64_t)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 2974 | AEMU_SCOPED_TRACE("vkWaitForFences readParams"); |
| 2975 | AEMU_SCOPED_TRACE("vkWaitForFences returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2976 | VkResult vkWaitForFences_VkResult_return = (VkResult)0; |
| 2977 | stream->read(&vkWaitForFences_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2978 | countingStream->clearPool(); |
| 2979 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2980 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2981 | mImpl->log("finish vkWaitForFences");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2982 | return vkWaitForFences_VkResult_return; |
| 2983 | } |
| 2984 | |
| 2985 | VkResult VkEncoder::vkCreateSemaphore( |
| 2986 | VkDevice device, |
| 2987 | const VkSemaphoreCreateInfo* pCreateInfo, |
| 2988 | const VkAllocationCallbacks* pAllocator, |
| 2989 | VkSemaphore* pSemaphore) |
| 2990 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 2991 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 2992 | AEMU_SCOPED_TRACE("vkCreateSemaphore encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2993 | mImpl->log("start vkCreateSemaphore"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2994 | auto stream = mImpl->stream(); |
| 2995 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2996 | auto resources = mImpl->resources(); |
| 2997 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2998 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2999 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3000 | VkSemaphoreCreateInfo* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 3001 | VkAllocationCallbacks* local_pAllocator; |
| 3002 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3003 | local_pCreateInfo = nullptr; |
| 3004 | if (pCreateInfo) |
| 3005 | { |
| 3006 | local_pCreateInfo = (VkSemaphoreCreateInfo*)pool->alloc(sizeof(const VkSemaphoreCreateInfo)); |
| 3007 | deepcopy_VkSemaphoreCreateInfo(pool, pCreateInfo, (VkSemaphoreCreateInfo*)(local_pCreateInfo)); |
| 3008 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3009 | local_pAllocator = nullptr; |
| 3010 | if (pAllocator) |
| 3011 | { |
| 3012 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 3013 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 3014 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 3015 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 3016 | if (local_pCreateInfo) |
| 3017 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 3018 | transform_tohost_VkSemaphoreCreateInfo(mImpl->resources(), (VkSemaphoreCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 3019 | } |
| 3020 | if (local_pAllocator) |
| 3021 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 3022 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 3023 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3024 | countingStream->rewind(); |
| 3025 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3026 | uint64_t cgen_var_186; |
| 3027 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_186, 1); |
| 3028 | countingStream->write((uint64_t*)&cgen_var_186, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3029 | marshal_VkSemaphoreCreateInfo(countingStream, (VkSemaphoreCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3030 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3031 | uint64_t cgen_var_187 = (uint64_t)(uintptr_t)local_pAllocator; |
| 3032 | countingStream->putBe64(cgen_var_187); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3033 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3034 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3035 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3036 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3037 | uint64_t cgen_var_188; |
| 3038 | countingStream->handleMapping()->mapHandles_VkSemaphore_u64(pSemaphore, &cgen_var_188, 1); |
| 3039 | countingStream->write((uint64_t*)&cgen_var_188, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3040 | } |
| 3041 | uint32_t packetSize_vkCreateSemaphore = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 3042 | countingStream->rewind(); |
| 3043 | uint32_t opcode_vkCreateSemaphore = OP_vkCreateSemaphore; |
| 3044 | stream->write(&opcode_vkCreateSemaphore, sizeof(uint32_t)); |
| 3045 | stream->write(&packetSize_vkCreateSemaphore, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3046 | uint64_t cgen_var_189; |
| 3047 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_189, 1); |
| 3048 | stream->write((uint64_t*)&cgen_var_189, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3049 | marshal_VkSemaphoreCreateInfo(stream, (VkSemaphoreCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3050 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3051 | uint64_t cgen_var_190 = (uint64_t)(uintptr_t)local_pAllocator; |
| 3052 | stream->putBe64(cgen_var_190); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3053 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3054 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3055 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3056 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3057 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3058 | uint64_t cgen_var_191; |
| 3059 | stream->handleMapping()->mapHandles_VkSemaphore_u64(pSemaphore, &cgen_var_191, 1); |
| 3060 | stream->write((uint64_t*)&cgen_var_191, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3061 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 3062 | AEMU_SCOPED_TRACE("vkCreateSemaphore readParams"); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3063 | stream->setHandleMapping(resources->createMapping()); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3064 | uint64_t cgen_var_192; |
| 3065 | stream->read((uint64_t*)&cgen_var_192, 8); |
| 3066 | stream->handleMapping()->mapHandles_u64_VkSemaphore(&cgen_var_192, (VkSemaphore*)pSemaphore, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3067 | stream->unsetHandleMapping(); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 3068 | AEMU_SCOPED_TRACE("vkCreateSemaphore returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3069 | VkResult vkCreateSemaphore_VkResult_return = (VkResult)0; |
| 3070 | stream->read(&vkCreateSemaphore_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3071 | countingStream->clearPool(); |
| 3072 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3073 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3074 | mImpl->log("finish vkCreateSemaphore");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3075 | return vkCreateSemaphore_VkResult_return; |
| 3076 | } |
| 3077 | |
| 3078 | void VkEncoder::vkDestroySemaphore( |
| 3079 | VkDevice device, |
| 3080 | VkSemaphore semaphore, |
| 3081 | const VkAllocationCallbacks* pAllocator) |
| 3082 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 3083 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 3084 | AEMU_SCOPED_TRACE("vkDestroySemaphore encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3085 | mImpl->log("start vkDestroySemaphore"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3086 | auto stream = mImpl->stream(); |
| 3087 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3088 | auto resources = mImpl->resources(); |
| 3089 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3090 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3091 | VkDevice local_device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 3092 | VkSemaphore local_semaphore; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3093 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 3094 | local_device = device; |
| 3095 | local_semaphore = semaphore; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3096 | local_pAllocator = nullptr; |
| 3097 | if (pAllocator) |
| 3098 | { |
| 3099 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 3100 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 3101 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 3102 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 3103 | if (local_pAllocator) |
| 3104 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 3105 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 3106 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3107 | countingStream->rewind(); |
| 3108 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3109 | uint64_t cgen_var_193; |
| 3110 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_193, 1); |
| 3111 | countingStream->write((uint64_t*)&cgen_var_193, 1 * 8); |
| 3112 | uint64_t cgen_var_194; |
| 3113 | countingStream->handleMapping()->mapHandles_VkSemaphore_u64(&local_semaphore, &cgen_var_194, 1); |
| 3114 | countingStream->write((uint64_t*)&cgen_var_194, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3115 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3116 | uint64_t cgen_var_195 = (uint64_t)(uintptr_t)local_pAllocator; |
| 3117 | countingStream->putBe64(cgen_var_195); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3118 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3119 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3120 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3121 | } |
| 3122 | } |
| 3123 | uint32_t packetSize_vkDestroySemaphore = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 3124 | countingStream->rewind(); |
| 3125 | uint32_t opcode_vkDestroySemaphore = OP_vkDestroySemaphore; |
| 3126 | stream->write(&opcode_vkDestroySemaphore, sizeof(uint32_t)); |
| 3127 | stream->write(&packetSize_vkDestroySemaphore, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3128 | uint64_t cgen_var_196; |
| 3129 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_196, 1); |
| 3130 | stream->write((uint64_t*)&cgen_var_196, 1 * 8); |
| 3131 | uint64_t cgen_var_197; |
| 3132 | stream->handleMapping()->mapHandles_VkSemaphore_u64(&local_semaphore, &cgen_var_197, 1); |
| 3133 | stream->write((uint64_t*)&cgen_var_197, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3134 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3135 | uint64_t cgen_var_198 = (uint64_t)(uintptr_t)local_pAllocator; |
| 3136 | stream->putBe64(cgen_var_198); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3137 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3138 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3139 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3140 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 3141 | AEMU_SCOPED_TRACE("vkDestroySemaphore readParams"); |
| 3142 | AEMU_SCOPED_TRACE("vkDestroySemaphore returnUnmarshal"); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3143 | resources->destroyMapping()->mapHandles_VkSemaphore((VkSemaphore*)&semaphore); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3144 | mImpl->log("finish vkDestroySemaphore");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3145 | } |
| 3146 | |
| 3147 | VkResult VkEncoder::vkCreateEvent( |
| 3148 | VkDevice device, |
| 3149 | const VkEventCreateInfo* pCreateInfo, |
| 3150 | const VkAllocationCallbacks* pAllocator, |
| 3151 | VkEvent* pEvent) |
| 3152 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 3153 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 3154 | AEMU_SCOPED_TRACE("vkCreateEvent encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3155 | mImpl->log("start vkCreateEvent"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3156 | auto stream = mImpl->stream(); |
| 3157 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3158 | auto resources = mImpl->resources(); |
| 3159 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3160 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3161 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3162 | VkEventCreateInfo* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 3163 | VkAllocationCallbacks* local_pAllocator; |
| 3164 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3165 | local_pCreateInfo = nullptr; |
| 3166 | if (pCreateInfo) |
| 3167 | { |
| 3168 | local_pCreateInfo = (VkEventCreateInfo*)pool->alloc(sizeof(const VkEventCreateInfo)); |
| 3169 | deepcopy_VkEventCreateInfo(pool, pCreateInfo, (VkEventCreateInfo*)(local_pCreateInfo)); |
| 3170 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3171 | local_pAllocator = nullptr; |
| 3172 | if (pAllocator) |
| 3173 | { |
| 3174 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 3175 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 3176 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 3177 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 3178 | if (local_pCreateInfo) |
| 3179 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 3180 | transform_tohost_VkEventCreateInfo(mImpl->resources(), (VkEventCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 3181 | } |
| 3182 | if (local_pAllocator) |
| 3183 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 3184 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 3185 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3186 | countingStream->rewind(); |
| 3187 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3188 | uint64_t cgen_var_199; |
| 3189 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_199, 1); |
| 3190 | countingStream->write((uint64_t*)&cgen_var_199, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3191 | marshal_VkEventCreateInfo(countingStream, (VkEventCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3192 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3193 | uint64_t cgen_var_200 = (uint64_t)(uintptr_t)local_pAllocator; |
| 3194 | countingStream->putBe64(cgen_var_200); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3195 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3196 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3197 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3198 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3199 | uint64_t cgen_var_201; |
| 3200 | countingStream->handleMapping()->mapHandles_VkEvent_u64(pEvent, &cgen_var_201, 1); |
| 3201 | countingStream->write((uint64_t*)&cgen_var_201, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3202 | } |
| 3203 | uint32_t packetSize_vkCreateEvent = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 3204 | countingStream->rewind(); |
| 3205 | uint32_t opcode_vkCreateEvent = OP_vkCreateEvent; |
| 3206 | stream->write(&opcode_vkCreateEvent, sizeof(uint32_t)); |
| 3207 | stream->write(&packetSize_vkCreateEvent, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3208 | uint64_t cgen_var_202; |
| 3209 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_202, 1); |
| 3210 | stream->write((uint64_t*)&cgen_var_202, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3211 | marshal_VkEventCreateInfo(stream, (VkEventCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3212 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3213 | uint64_t cgen_var_203 = (uint64_t)(uintptr_t)local_pAllocator; |
| 3214 | stream->putBe64(cgen_var_203); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3215 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3216 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3217 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3218 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3219 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3220 | uint64_t cgen_var_204; |
| 3221 | stream->handleMapping()->mapHandles_VkEvent_u64(pEvent, &cgen_var_204, 1); |
| 3222 | stream->write((uint64_t*)&cgen_var_204, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3223 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 3224 | AEMU_SCOPED_TRACE("vkCreateEvent readParams"); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3225 | stream->setHandleMapping(resources->createMapping()); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3226 | uint64_t cgen_var_205; |
| 3227 | stream->read((uint64_t*)&cgen_var_205, 8); |
| 3228 | stream->handleMapping()->mapHandles_u64_VkEvent(&cgen_var_205, (VkEvent*)pEvent, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3229 | stream->unsetHandleMapping(); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 3230 | AEMU_SCOPED_TRACE("vkCreateEvent returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3231 | VkResult vkCreateEvent_VkResult_return = (VkResult)0; |
| 3232 | stream->read(&vkCreateEvent_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3233 | countingStream->clearPool(); |
| 3234 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3235 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3236 | mImpl->log("finish vkCreateEvent");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3237 | return vkCreateEvent_VkResult_return; |
| 3238 | } |
| 3239 | |
| 3240 | void VkEncoder::vkDestroyEvent( |
| 3241 | VkDevice device, |
| 3242 | VkEvent event, |
| 3243 | const VkAllocationCallbacks* pAllocator) |
| 3244 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 3245 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 3246 | AEMU_SCOPED_TRACE("vkDestroyEvent encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3247 | mImpl->log("start vkDestroyEvent"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3248 | auto stream = mImpl->stream(); |
| 3249 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3250 | auto resources = mImpl->resources(); |
| 3251 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3252 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3253 | VkDevice local_device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 3254 | VkEvent local_event; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3255 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 3256 | local_device = device; |
| 3257 | local_event = event; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3258 | local_pAllocator = nullptr; |
| 3259 | if (pAllocator) |
| 3260 | { |
| 3261 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 3262 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 3263 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 3264 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 3265 | if (local_pAllocator) |
| 3266 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 3267 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 3268 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3269 | countingStream->rewind(); |
| 3270 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3271 | uint64_t cgen_var_206; |
| 3272 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_206, 1); |
| 3273 | countingStream->write((uint64_t*)&cgen_var_206, 1 * 8); |
| 3274 | uint64_t cgen_var_207; |
| 3275 | countingStream->handleMapping()->mapHandles_VkEvent_u64(&local_event, &cgen_var_207, 1); |
| 3276 | countingStream->write((uint64_t*)&cgen_var_207, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3277 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3278 | uint64_t cgen_var_208 = (uint64_t)(uintptr_t)local_pAllocator; |
| 3279 | countingStream->putBe64(cgen_var_208); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3280 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3281 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3282 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3283 | } |
| 3284 | } |
| 3285 | uint32_t packetSize_vkDestroyEvent = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 3286 | countingStream->rewind(); |
| 3287 | uint32_t opcode_vkDestroyEvent = OP_vkDestroyEvent; |
| 3288 | stream->write(&opcode_vkDestroyEvent, sizeof(uint32_t)); |
| 3289 | stream->write(&packetSize_vkDestroyEvent, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3290 | uint64_t cgen_var_209; |
| 3291 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_209, 1); |
| 3292 | stream->write((uint64_t*)&cgen_var_209, 1 * 8); |
| 3293 | uint64_t cgen_var_210; |
| 3294 | stream->handleMapping()->mapHandles_VkEvent_u64(&local_event, &cgen_var_210, 1); |
| 3295 | stream->write((uint64_t*)&cgen_var_210, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3296 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3297 | uint64_t cgen_var_211 = (uint64_t)(uintptr_t)local_pAllocator; |
| 3298 | stream->putBe64(cgen_var_211); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3299 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3300 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3301 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3302 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 3303 | AEMU_SCOPED_TRACE("vkDestroyEvent readParams"); |
| 3304 | AEMU_SCOPED_TRACE("vkDestroyEvent returnUnmarshal"); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3305 | resources->destroyMapping()->mapHandles_VkEvent((VkEvent*)&event); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3306 | mImpl->log("finish vkDestroyEvent");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3307 | } |
| 3308 | |
| 3309 | VkResult VkEncoder::vkGetEventStatus( |
| 3310 | VkDevice device, |
| 3311 | VkEvent event) |
| 3312 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 3313 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 3314 | AEMU_SCOPED_TRACE("vkGetEventStatus encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3315 | mImpl->log("start vkGetEventStatus"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3316 | auto stream = mImpl->stream(); |
| 3317 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3318 | auto resources = mImpl->resources(); |
| 3319 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3320 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3321 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3322 | VkEvent local_event; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 3323 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3324 | local_event = event; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3325 | countingStream->rewind(); |
| 3326 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3327 | uint64_t cgen_var_212; |
| 3328 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_212, 1); |
| 3329 | countingStream->write((uint64_t*)&cgen_var_212, 1 * 8); |
| 3330 | uint64_t cgen_var_213; |
| 3331 | countingStream->handleMapping()->mapHandles_VkEvent_u64(&local_event, &cgen_var_213, 1); |
| 3332 | countingStream->write((uint64_t*)&cgen_var_213, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3333 | } |
| 3334 | uint32_t packetSize_vkGetEventStatus = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 3335 | countingStream->rewind(); |
| 3336 | uint32_t opcode_vkGetEventStatus = OP_vkGetEventStatus; |
| 3337 | stream->write(&opcode_vkGetEventStatus, sizeof(uint32_t)); |
| 3338 | stream->write(&packetSize_vkGetEventStatus, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3339 | uint64_t cgen_var_214; |
| 3340 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_214, 1); |
| 3341 | stream->write((uint64_t*)&cgen_var_214, 1 * 8); |
| 3342 | uint64_t cgen_var_215; |
| 3343 | stream->handleMapping()->mapHandles_VkEvent_u64(&local_event, &cgen_var_215, 1); |
| 3344 | stream->write((uint64_t*)&cgen_var_215, 1 * 8); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 3345 | AEMU_SCOPED_TRACE("vkGetEventStatus readParams"); |
| 3346 | AEMU_SCOPED_TRACE("vkGetEventStatus returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3347 | VkResult vkGetEventStatus_VkResult_return = (VkResult)0; |
| 3348 | stream->read(&vkGetEventStatus_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3349 | countingStream->clearPool(); |
| 3350 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3351 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3352 | mImpl->log("finish vkGetEventStatus");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3353 | return vkGetEventStatus_VkResult_return; |
| 3354 | } |
| 3355 | |
| 3356 | VkResult VkEncoder::vkSetEvent( |
| 3357 | VkDevice device, |
| 3358 | VkEvent event) |
| 3359 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 3360 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 3361 | AEMU_SCOPED_TRACE("vkSetEvent encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3362 | mImpl->log("start vkSetEvent"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3363 | auto stream = mImpl->stream(); |
| 3364 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3365 | auto resources = mImpl->resources(); |
| 3366 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3367 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3368 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3369 | VkEvent local_event; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 3370 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3371 | local_event = event; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3372 | countingStream->rewind(); |
| 3373 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3374 | uint64_t cgen_var_216; |
| 3375 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_216, 1); |
| 3376 | countingStream->write((uint64_t*)&cgen_var_216, 1 * 8); |
| 3377 | uint64_t cgen_var_217; |
| 3378 | countingStream->handleMapping()->mapHandles_VkEvent_u64(&local_event, &cgen_var_217, 1); |
| 3379 | countingStream->write((uint64_t*)&cgen_var_217, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3380 | } |
| 3381 | uint32_t packetSize_vkSetEvent = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 3382 | countingStream->rewind(); |
| 3383 | uint32_t opcode_vkSetEvent = OP_vkSetEvent; |
| 3384 | stream->write(&opcode_vkSetEvent, sizeof(uint32_t)); |
| 3385 | stream->write(&packetSize_vkSetEvent, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3386 | uint64_t cgen_var_218; |
| 3387 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_218, 1); |
| 3388 | stream->write((uint64_t*)&cgen_var_218, 1 * 8); |
| 3389 | uint64_t cgen_var_219; |
| 3390 | stream->handleMapping()->mapHandles_VkEvent_u64(&local_event, &cgen_var_219, 1); |
| 3391 | stream->write((uint64_t*)&cgen_var_219, 1 * 8); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 3392 | AEMU_SCOPED_TRACE("vkSetEvent readParams"); |
| 3393 | AEMU_SCOPED_TRACE("vkSetEvent returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3394 | VkResult vkSetEvent_VkResult_return = (VkResult)0; |
| 3395 | stream->read(&vkSetEvent_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3396 | countingStream->clearPool(); |
| 3397 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3398 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3399 | mImpl->log("finish vkSetEvent");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3400 | return vkSetEvent_VkResult_return; |
| 3401 | } |
| 3402 | |
| 3403 | VkResult VkEncoder::vkResetEvent( |
| 3404 | VkDevice device, |
| 3405 | VkEvent event) |
| 3406 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 3407 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 3408 | AEMU_SCOPED_TRACE("vkResetEvent encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3409 | mImpl->log("start vkResetEvent"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3410 | auto stream = mImpl->stream(); |
| 3411 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3412 | auto resources = mImpl->resources(); |
| 3413 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3414 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3415 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3416 | VkEvent local_event; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 3417 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3418 | local_event = event; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3419 | countingStream->rewind(); |
| 3420 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3421 | uint64_t cgen_var_220; |
| 3422 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_220, 1); |
| 3423 | countingStream->write((uint64_t*)&cgen_var_220, 1 * 8); |
| 3424 | uint64_t cgen_var_221; |
| 3425 | countingStream->handleMapping()->mapHandles_VkEvent_u64(&local_event, &cgen_var_221, 1); |
| 3426 | countingStream->write((uint64_t*)&cgen_var_221, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3427 | } |
| 3428 | uint32_t packetSize_vkResetEvent = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 3429 | countingStream->rewind(); |
| 3430 | uint32_t opcode_vkResetEvent = OP_vkResetEvent; |
| 3431 | stream->write(&opcode_vkResetEvent, sizeof(uint32_t)); |
| 3432 | stream->write(&packetSize_vkResetEvent, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3433 | uint64_t cgen_var_222; |
| 3434 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_222, 1); |
| 3435 | stream->write((uint64_t*)&cgen_var_222, 1 * 8); |
| 3436 | uint64_t cgen_var_223; |
| 3437 | stream->handleMapping()->mapHandles_VkEvent_u64(&local_event, &cgen_var_223, 1); |
| 3438 | stream->write((uint64_t*)&cgen_var_223, 1 * 8); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 3439 | AEMU_SCOPED_TRACE("vkResetEvent readParams"); |
| 3440 | AEMU_SCOPED_TRACE("vkResetEvent returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3441 | VkResult vkResetEvent_VkResult_return = (VkResult)0; |
| 3442 | stream->read(&vkResetEvent_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3443 | countingStream->clearPool(); |
| 3444 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3445 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3446 | mImpl->log("finish vkResetEvent");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3447 | return vkResetEvent_VkResult_return; |
| 3448 | } |
| 3449 | |
| 3450 | VkResult VkEncoder::vkCreateQueryPool( |
| 3451 | VkDevice device, |
| 3452 | const VkQueryPoolCreateInfo* pCreateInfo, |
| 3453 | const VkAllocationCallbacks* pAllocator, |
| 3454 | VkQueryPool* pQueryPool) |
| 3455 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 3456 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 3457 | AEMU_SCOPED_TRACE("vkCreateQueryPool encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3458 | mImpl->log("start vkCreateQueryPool"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3459 | auto stream = mImpl->stream(); |
| 3460 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3461 | auto resources = mImpl->resources(); |
| 3462 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3463 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3464 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3465 | VkQueryPoolCreateInfo* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 3466 | VkAllocationCallbacks* local_pAllocator; |
| 3467 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3468 | local_pCreateInfo = nullptr; |
| 3469 | if (pCreateInfo) |
| 3470 | { |
| 3471 | local_pCreateInfo = (VkQueryPoolCreateInfo*)pool->alloc(sizeof(const VkQueryPoolCreateInfo)); |
| 3472 | deepcopy_VkQueryPoolCreateInfo(pool, pCreateInfo, (VkQueryPoolCreateInfo*)(local_pCreateInfo)); |
| 3473 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3474 | local_pAllocator = nullptr; |
| 3475 | if (pAllocator) |
| 3476 | { |
| 3477 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 3478 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 3479 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 3480 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 3481 | if (local_pCreateInfo) |
| 3482 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 3483 | transform_tohost_VkQueryPoolCreateInfo(mImpl->resources(), (VkQueryPoolCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 3484 | } |
| 3485 | if (local_pAllocator) |
| 3486 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 3487 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 3488 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3489 | countingStream->rewind(); |
| 3490 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3491 | uint64_t cgen_var_224; |
| 3492 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_224, 1); |
| 3493 | countingStream->write((uint64_t*)&cgen_var_224, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3494 | marshal_VkQueryPoolCreateInfo(countingStream, (VkQueryPoolCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3495 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3496 | uint64_t cgen_var_225 = (uint64_t)(uintptr_t)local_pAllocator; |
| 3497 | countingStream->putBe64(cgen_var_225); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3498 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3499 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3500 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3501 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3502 | uint64_t cgen_var_226; |
| 3503 | countingStream->handleMapping()->mapHandles_VkQueryPool_u64(pQueryPool, &cgen_var_226, 1); |
| 3504 | countingStream->write((uint64_t*)&cgen_var_226, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3505 | } |
| 3506 | uint32_t packetSize_vkCreateQueryPool = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 3507 | countingStream->rewind(); |
| 3508 | uint32_t opcode_vkCreateQueryPool = OP_vkCreateQueryPool; |
| 3509 | stream->write(&opcode_vkCreateQueryPool, sizeof(uint32_t)); |
| 3510 | stream->write(&packetSize_vkCreateQueryPool, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3511 | uint64_t cgen_var_227; |
| 3512 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_227, 1); |
| 3513 | stream->write((uint64_t*)&cgen_var_227, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3514 | marshal_VkQueryPoolCreateInfo(stream, (VkQueryPoolCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3515 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3516 | uint64_t cgen_var_228 = (uint64_t)(uintptr_t)local_pAllocator; |
| 3517 | stream->putBe64(cgen_var_228); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3518 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3519 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3520 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3521 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3522 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3523 | uint64_t cgen_var_229; |
| 3524 | stream->handleMapping()->mapHandles_VkQueryPool_u64(pQueryPool, &cgen_var_229, 1); |
| 3525 | stream->write((uint64_t*)&cgen_var_229, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3526 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 3527 | AEMU_SCOPED_TRACE("vkCreateQueryPool readParams"); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3528 | stream->setHandleMapping(resources->createMapping()); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3529 | uint64_t cgen_var_230; |
| 3530 | stream->read((uint64_t*)&cgen_var_230, 8); |
| 3531 | stream->handleMapping()->mapHandles_u64_VkQueryPool(&cgen_var_230, (VkQueryPool*)pQueryPool, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3532 | stream->unsetHandleMapping(); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 3533 | AEMU_SCOPED_TRACE("vkCreateQueryPool returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3534 | VkResult vkCreateQueryPool_VkResult_return = (VkResult)0; |
| 3535 | stream->read(&vkCreateQueryPool_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3536 | countingStream->clearPool(); |
| 3537 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3538 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3539 | mImpl->log("finish vkCreateQueryPool");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3540 | return vkCreateQueryPool_VkResult_return; |
| 3541 | } |
| 3542 | |
| 3543 | void VkEncoder::vkDestroyQueryPool( |
| 3544 | VkDevice device, |
| 3545 | VkQueryPool queryPool, |
| 3546 | const VkAllocationCallbacks* pAllocator) |
| 3547 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 3548 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 3549 | AEMU_SCOPED_TRACE("vkDestroyQueryPool encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3550 | mImpl->log("start vkDestroyQueryPool"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3551 | auto stream = mImpl->stream(); |
| 3552 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3553 | auto resources = mImpl->resources(); |
| 3554 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3555 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3556 | VkDevice local_device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 3557 | VkQueryPool local_queryPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3558 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 3559 | local_device = device; |
| 3560 | local_queryPool = queryPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3561 | local_pAllocator = nullptr; |
| 3562 | if (pAllocator) |
| 3563 | { |
| 3564 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 3565 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 3566 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 3567 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 3568 | if (local_pAllocator) |
| 3569 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 3570 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 3571 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3572 | countingStream->rewind(); |
| 3573 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3574 | uint64_t cgen_var_231; |
| 3575 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_231, 1); |
| 3576 | countingStream->write((uint64_t*)&cgen_var_231, 1 * 8); |
| 3577 | uint64_t cgen_var_232; |
| 3578 | countingStream->handleMapping()->mapHandles_VkQueryPool_u64(&local_queryPool, &cgen_var_232, 1); |
| 3579 | countingStream->write((uint64_t*)&cgen_var_232, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3580 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3581 | uint64_t cgen_var_233 = (uint64_t)(uintptr_t)local_pAllocator; |
| 3582 | countingStream->putBe64(cgen_var_233); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3583 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3584 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3585 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3586 | } |
| 3587 | } |
| 3588 | uint32_t packetSize_vkDestroyQueryPool = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 3589 | countingStream->rewind(); |
| 3590 | uint32_t opcode_vkDestroyQueryPool = OP_vkDestroyQueryPool; |
| 3591 | stream->write(&opcode_vkDestroyQueryPool, sizeof(uint32_t)); |
| 3592 | stream->write(&packetSize_vkDestroyQueryPool, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3593 | uint64_t cgen_var_234; |
| 3594 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_234, 1); |
| 3595 | stream->write((uint64_t*)&cgen_var_234, 1 * 8); |
| 3596 | uint64_t cgen_var_235; |
| 3597 | stream->handleMapping()->mapHandles_VkQueryPool_u64(&local_queryPool, &cgen_var_235, 1); |
| 3598 | stream->write((uint64_t*)&cgen_var_235, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3599 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3600 | uint64_t cgen_var_236 = (uint64_t)(uintptr_t)local_pAllocator; |
| 3601 | stream->putBe64(cgen_var_236); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3602 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3603 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3604 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3605 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 3606 | AEMU_SCOPED_TRACE("vkDestroyQueryPool readParams"); |
| 3607 | AEMU_SCOPED_TRACE("vkDestroyQueryPool returnUnmarshal"); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3608 | resources->destroyMapping()->mapHandles_VkQueryPool((VkQueryPool*)&queryPool); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3609 | mImpl->log("finish vkDestroyQueryPool");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3610 | } |
| 3611 | |
| 3612 | VkResult VkEncoder::vkGetQueryPoolResults( |
| 3613 | VkDevice device, |
| 3614 | VkQueryPool queryPool, |
| 3615 | uint32_t firstQuery, |
| 3616 | uint32_t queryCount, |
| 3617 | size_t dataSize, |
| 3618 | void* pData, |
| 3619 | VkDeviceSize stride, |
| 3620 | VkQueryResultFlags flags) |
| 3621 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 3622 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 3623 | AEMU_SCOPED_TRACE("vkGetQueryPoolResults encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3624 | mImpl->log("start vkGetQueryPoolResults"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3625 | auto stream = mImpl->stream(); |
| 3626 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3627 | auto resources = mImpl->resources(); |
| 3628 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3629 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3630 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3631 | VkQueryPool local_queryPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3632 | uint32_t local_firstQuery; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3633 | uint32_t local_queryCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3634 | size_t local_dataSize; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3635 | VkDeviceSize local_stride; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3636 | VkQueryResultFlags local_flags; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 3637 | local_device = device; |
| 3638 | local_queryPool = queryPool; |
| 3639 | local_firstQuery = firstQuery; |
| 3640 | local_queryCount = queryCount; |
| 3641 | local_dataSize = dataSize; |
| 3642 | local_stride = stride; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3643 | local_flags = flags; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3644 | countingStream->rewind(); |
| 3645 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3646 | uint64_t cgen_var_237; |
| 3647 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_237, 1); |
| 3648 | countingStream->write((uint64_t*)&cgen_var_237, 1 * 8); |
| 3649 | uint64_t cgen_var_238; |
| 3650 | countingStream->handleMapping()->mapHandles_VkQueryPool_u64(&local_queryPool, &cgen_var_238, 1); |
| 3651 | countingStream->write((uint64_t*)&cgen_var_238, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3652 | countingStream->write((uint32_t*)&local_firstQuery, sizeof(uint32_t)); |
| 3653 | countingStream->write((uint32_t*)&local_queryCount, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3654 | uint64_t cgen_var_239 = (uint64_t)local_dataSize; |
| 3655 | countingStream->putBe64(cgen_var_239); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3656 | countingStream->write((void*)pData, ((dataSize)) * sizeof(uint8_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3657 | countingStream->write((VkDeviceSize*)&local_stride, sizeof(VkDeviceSize)); |
| 3658 | countingStream->write((VkQueryResultFlags*)&local_flags, sizeof(VkQueryResultFlags)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3659 | } |
| 3660 | uint32_t packetSize_vkGetQueryPoolResults = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 3661 | countingStream->rewind(); |
| 3662 | uint32_t opcode_vkGetQueryPoolResults = OP_vkGetQueryPoolResults; |
| 3663 | stream->write(&opcode_vkGetQueryPoolResults, sizeof(uint32_t)); |
| 3664 | stream->write(&packetSize_vkGetQueryPoolResults, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3665 | uint64_t cgen_var_240; |
| 3666 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_240, 1); |
| 3667 | stream->write((uint64_t*)&cgen_var_240, 1 * 8); |
| 3668 | uint64_t cgen_var_241; |
| 3669 | stream->handleMapping()->mapHandles_VkQueryPool_u64(&local_queryPool, &cgen_var_241, 1); |
| 3670 | stream->write((uint64_t*)&cgen_var_241, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3671 | stream->write((uint32_t*)&local_firstQuery, sizeof(uint32_t)); |
| 3672 | stream->write((uint32_t*)&local_queryCount, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3673 | uint64_t cgen_var_242 = (uint64_t)local_dataSize; |
| 3674 | stream->putBe64(cgen_var_242); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3675 | stream->write((void*)pData, ((dataSize)) * sizeof(uint8_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3676 | stream->write((VkDeviceSize*)&local_stride, sizeof(VkDeviceSize)); |
| 3677 | stream->write((VkQueryResultFlags*)&local_flags, sizeof(VkQueryResultFlags)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 3678 | AEMU_SCOPED_TRACE("vkGetQueryPoolResults readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3679 | stream->read((void*)pData, ((dataSize)) * sizeof(uint8_t)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 3680 | AEMU_SCOPED_TRACE("vkGetQueryPoolResults returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3681 | VkResult vkGetQueryPoolResults_VkResult_return = (VkResult)0; |
| 3682 | stream->read(&vkGetQueryPoolResults_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3683 | countingStream->clearPool(); |
| 3684 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3685 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3686 | mImpl->log("finish vkGetQueryPoolResults");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3687 | return vkGetQueryPoolResults_VkResult_return; |
| 3688 | } |
| 3689 | |
| 3690 | VkResult VkEncoder::vkCreateBuffer( |
| 3691 | VkDevice device, |
| 3692 | const VkBufferCreateInfo* pCreateInfo, |
| 3693 | const VkAllocationCallbacks* pAllocator, |
| 3694 | VkBuffer* pBuffer) |
| 3695 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 3696 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 3697 | AEMU_SCOPED_TRACE("vkCreateBuffer encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3698 | mImpl->log("start vkCreateBuffer"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3699 | auto stream = mImpl->stream(); |
| 3700 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3701 | auto resources = mImpl->resources(); |
| 3702 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3703 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3704 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3705 | VkBufferCreateInfo* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 3706 | VkAllocationCallbacks* local_pAllocator; |
| 3707 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3708 | local_pCreateInfo = nullptr; |
| 3709 | if (pCreateInfo) |
| 3710 | { |
| 3711 | local_pCreateInfo = (VkBufferCreateInfo*)pool->alloc(sizeof(const VkBufferCreateInfo)); |
| 3712 | deepcopy_VkBufferCreateInfo(pool, pCreateInfo, (VkBufferCreateInfo*)(local_pCreateInfo)); |
| 3713 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3714 | local_pAllocator = nullptr; |
| 3715 | if (pAllocator) |
| 3716 | { |
| 3717 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 3718 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 3719 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 3720 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 3721 | if (local_pCreateInfo) |
| 3722 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 3723 | transform_tohost_VkBufferCreateInfo(mImpl->resources(), (VkBufferCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 3724 | } |
| 3725 | if (local_pAllocator) |
| 3726 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 3727 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 3728 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3729 | countingStream->rewind(); |
| 3730 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3731 | uint64_t cgen_var_243; |
| 3732 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_243, 1); |
| 3733 | countingStream->write((uint64_t*)&cgen_var_243, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3734 | marshal_VkBufferCreateInfo(countingStream, (VkBufferCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3735 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3736 | uint64_t cgen_var_244 = (uint64_t)(uintptr_t)local_pAllocator; |
| 3737 | countingStream->putBe64(cgen_var_244); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3738 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3739 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3740 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3741 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3742 | uint64_t cgen_var_245; |
| 3743 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(pBuffer, &cgen_var_245, 1); |
| 3744 | countingStream->write((uint64_t*)&cgen_var_245, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3745 | } |
| 3746 | uint32_t packetSize_vkCreateBuffer = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 3747 | countingStream->rewind(); |
| 3748 | uint32_t opcode_vkCreateBuffer = OP_vkCreateBuffer; |
| 3749 | stream->write(&opcode_vkCreateBuffer, sizeof(uint32_t)); |
| 3750 | stream->write(&packetSize_vkCreateBuffer, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3751 | uint64_t cgen_var_246; |
| 3752 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_246, 1); |
| 3753 | stream->write((uint64_t*)&cgen_var_246, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3754 | marshal_VkBufferCreateInfo(stream, (VkBufferCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3755 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3756 | uint64_t cgen_var_247 = (uint64_t)(uintptr_t)local_pAllocator; |
| 3757 | stream->putBe64(cgen_var_247); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3758 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3759 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3760 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3761 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3762 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3763 | uint64_t cgen_var_248; |
| 3764 | stream->handleMapping()->mapHandles_VkBuffer_u64(pBuffer, &cgen_var_248, 1); |
| 3765 | stream->write((uint64_t*)&cgen_var_248, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3766 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 3767 | AEMU_SCOPED_TRACE("vkCreateBuffer readParams"); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3768 | stream->setHandleMapping(resources->createMapping()); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3769 | uint64_t cgen_var_249; |
| 3770 | stream->read((uint64_t*)&cgen_var_249, 8); |
| 3771 | stream->handleMapping()->mapHandles_u64_VkBuffer(&cgen_var_249, (VkBuffer*)pBuffer, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3772 | stream->unsetHandleMapping(); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 3773 | AEMU_SCOPED_TRACE("vkCreateBuffer returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3774 | VkResult vkCreateBuffer_VkResult_return = (VkResult)0; |
| 3775 | stream->read(&vkCreateBuffer_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3776 | countingStream->clearPool(); |
| 3777 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3778 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3779 | mImpl->log("finish vkCreateBuffer");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3780 | return vkCreateBuffer_VkResult_return; |
| 3781 | } |
| 3782 | |
| 3783 | void VkEncoder::vkDestroyBuffer( |
| 3784 | VkDevice device, |
| 3785 | VkBuffer buffer, |
| 3786 | const VkAllocationCallbacks* pAllocator) |
| 3787 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 3788 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 3789 | AEMU_SCOPED_TRACE("vkDestroyBuffer encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3790 | mImpl->log("start vkDestroyBuffer"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3791 | auto stream = mImpl->stream(); |
| 3792 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3793 | auto resources = mImpl->resources(); |
| 3794 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3795 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3796 | VkDevice local_device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 3797 | VkBuffer local_buffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3798 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 3799 | local_device = device; |
| 3800 | local_buffer = buffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3801 | local_pAllocator = nullptr; |
| 3802 | if (pAllocator) |
| 3803 | { |
| 3804 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 3805 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 3806 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 3807 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 3808 | if (local_pAllocator) |
| 3809 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 3810 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 3811 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3812 | countingStream->rewind(); |
| 3813 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3814 | uint64_t cgen_var_250; |
| 3815 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_250, 1); |
| 3816 | countingStream->write((uint64_t*)&cgen_var_250, 1 * 8); |
| 3817 | uint64_t cgen_var_251; |
| 3818 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_251, 1); |
| 3819 | countingStream->write((uint64_t*)&cgen_var_251, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3820 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3821 | uint64_t cgen_var_252 = (uint64_t)(uintptr_t)local_pAllocator; |
| 3822 | countingStream->putBe64(cgen_var_252); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3823 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3824 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3825 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3826 | } |
| 3827 | } |
| 3828 | uint32_t packetSize_vkDestroyBuffer = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 3829 | countingStream->rewind(); |
| 3830 | uint32_t opcode_vkDestroyBuffer = OP_vkDestroyBuffer; |
| 3831 | stream->write(&opcode_vkDestroyBuffer, sizeof(uint32_t)); |
| 3832 | stream->write(&packetSize_vkDestroyBuffer, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3833 | uint64_t cgen_var_253; |
| 3834 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_253, 1); |
| 3835 | stream->write((uint64_t*)&cgen_var_253, 1 * 8); |
| 3836 | uint64_t cgen_var_254; |
| 3837 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_254, 1); |
| 3838 | stream->write((uint64_t*)&cgen_var_254, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3839 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3840 | uint64_t cgen_var_255 = (uint64_t)(uintptr_t)local_pAllocator; |
| 3841 | stream->putBe64(cgen_var_255); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3842 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3843 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3844 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3845 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 3846 | AEMU_SCOPED_TRACE("vkDestroyBuffer readParams"); |
| 3847 | AEMU_SCOPED_TRACE("vkDestroyBuffer returnUnmarshal"); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3848 | resources->destroyMapping()->mapHandles_VkBuffer((VkBuffer*)&buffer); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3849 | mImpl->log("finish vkDestroyBuffer");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3850 | } |
| 3851 | |
| 3852 | VkResult VkEncoder::vkCreateBufferView( |
| 3853 | VkDevice device, |
| 3854 | const VkBufferViewCreateInfo* pCreateInfo, |
| 3855 | const VkAllocationCallbacks* pAllocator, |
| 3856 | VkBufferView* pView) |
| 3857 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 3858 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 3859 | AEMU_SCOPED_TRACE("vkCreateBufferView encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3860 | mImpl->log("start vkCreateBufferView"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3861 | auto stream = mImpl->stream(); |
| 3862 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3863 | auto resources = mImpl->resources(); |
| 3864 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3865 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3866 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3867 | VkBufferViewCreateInfo* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 3868 | VkAllocationCallbacks* local_pAllocator; |
| 3869 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3870 | local_pCreateInfo = nullptr; |
| 3871 | if (pCreateInfo) |
| 3872 | { |
| 3873 | local_pCreateInfo = (VkBufferViewCreateInfo*)pool->alloc(sizeof(const VkBufferViewCreateInfo)); |
| 3874 | deepcopy_VkBufferViewCreateInfo(pool, pCreateInfo, (VkBufferViewCreateInfo*)(local_pCreateInfo)); |
| 3875 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3876 | local_pAllocator = nullptr; |
| 3877 | if (pAllocator) |
| 3878 | { |
| 3879 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 3880 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 3881 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 3882 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 3883 | if (local_pCreateInfo) |
| 3884 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 3885 | transform_tohost_VkBufferViewCreateInfo(mImpl->resources(), (VkBufferViewCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 3886 | } |
| 3887 | if (local_pAllocator) |
| 3888 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 3889 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 3890 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3891 | countingStream->rewind(); |
| 3892 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3893 | uint64_t cgen_var_256; |
| 3894 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_256, 1); |
| 3895 | countingStream->write((uint64_t*)&cgen_var_256, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3896 | marshal_VkBufferViewCreateInfo(countingStream, (VkBufferViewCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3897 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3898 | uint64_t cgen_var_257 = (uint64_t)(uintptr_t)local_pAllocator; |
| 3899 | countingStream->putBe64(cgen_var_257); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3900 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3901 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3902 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3903 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3904 | uint64_t cgen_var_258; |
| 3905 | countingStream->handleMapping()->mapHandles_VkBufferView_u64(pView, &cgen_var_258, 1); |
| 3906 | countingStream->write((uint64_t*)&cgen_var_258, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3907 | } |
| 3908 | uint32_t packetSize_vkCreateBufferView = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 3909 | countingStream->rewind(); |
| 3910 | uint32_t opcode_vkCreateBufferView = OP_vkCreateBufferView; |
| 3911 | stream->write(&opcode_vkCreateBufferView, sizeof(uint32_t)); |
| 3912 | stream->write(&packetSize_vkCreateBufferView, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3913 | uint64_t cgen_var_259; |
| 3914 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_259, 1); |
| 3915 | stream->write((uint64_t*)&cgen_var_259, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3916 | marshal_VkBufferViewCreateInfo(stream, (VkBufferViewCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3917 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3918 | uint64_t cgen_var_260 = (uint64_t)(uintptr_t)local_pAllocator; |
| 3919 | stream->putBe64(cgen_var_260); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3920 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3921 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3922 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3923 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3924 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3925 | uint64_t cgen_var_261; |
| 3926 | stream->handleMapping()->mapHandles_VkBufferView_u64(pView, &cgen_var_261, 1); |
| 3927 | stream->write((uint64_t*)&cgen_var_261, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3928 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 3929 | AEMU_SCOPED_TRACE("vkCreateBufferView readParams"); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3930 | stream->setHandleMapping(resources->createMapping()); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3931 | uint64_t cgen_var_262; |
| 3932 | stream->read((uint64_t*)&cgen_var_262, 8); |
| 3933 | stream->handleMapping()->mapHandles_u64_VkBufferView(&cgen_var_262, (VkBufferView*)pView, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3934 | stream->unsetHandleMapping(); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 3935 | AEMU_SCOPED_TRACE("vkCreateBufferView returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3936 | VkResult vkCreateBufferView_VkResult_return = (VkResult)0; |
| 3937 | stream->read(&vkCreateBufferView_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3938 | countingStream->clearPool(); |
| 3939 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3940 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3941 | mImpl->log("finish vkCreateBufferView");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3942 | return vkCreateBufferView_VkResult_return; |
| 3943 | } |
| 3944 | |
| 3945 | void VkEncoder::vkDestroyBufferView( |
| 3946 | VkDevice device, |
| 3947 | VkBufferView bufferView, |
| 3948 | const VkAllocationCallbacks* pAllocator) |
| 3949 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 3950 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 3951 | AEMU_SCOPED_TRACE("vkDestroyBufferView encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3952 | mImpl->log("start vkDestroyBufferView"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3953 | auto stream = mImpl->stream(); |
| 3954 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3955 | auto resources = mImpl->resources(); |
| 3956 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3957 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3958 | VkDevice local_device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 3959 | VkBufferView local_bufferView; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3960 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 3961 | local_device = device; |
| 3962 | local_bufferView = bufferView; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3963 | local_pAllocator = nullptr; |
| 3964 | if (pAllocator) |
| 3965 | { |
| 3966 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 3967 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 3968 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 3969 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 3970 | if (local_pAllocator) |
| 3971 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 3972 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 3973 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3974 | countingStream->rewind(); |
| 3975 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3976 | uint64_t cgen_var_263; |
| 3977 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_263, 1); |
| 3978 | countingStream->write((uint64_t*)&cgen_var_263, 1 * 8); |
| 3979 | uint64_t cgen_var_264; |
| 3980 | countingStream->handleMapping()->mapHandles_VkBufferView_u64(&local_bufferView, &cgen_var_264, 1); |
| 3981 | countingStream->write((uint64_t*)&cgen_var_264, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3982 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3983 | uint64_t cgen_var_265 = (uint64_t)(uintptr_t)local_pAllocator; |
| 3984 | countingStream->putBe64(cgen_var_265); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3985 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3986 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3987 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3988 | } |
| 3989 | } |
| 3990 | uint32_t packetSize_vkDestroyBufferView = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 3991 | countingStream->rewind(); |
| 3992 | uint32_t opcode_vkDestroyBufferView = OP_vkDestroyBufferView; |
| 3993 | stream->write(&opcode_vkDestroyBufferView, sizeof(uint32_t)); |
| 3994 | stream->write(&packetSize_vkDestroyBufferView, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3995 | uint64_t cgen_var_266; |
| 3996 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_266, 1); |
| 3997 | stream->write((uint64_t*)&cgen_var_266, 1 * 8); |
| 3998 | uint64_t cgen_var_267; |
| 3999 | stream->handleMapping()->mapHandles_VkBufferView_u64(&local_bufferView, &cgen_var_267, 1); |
| 4000 | stream->write((uint64_t*)&cgen_var_267, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4001 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4002 | uint64_t cgen_var_268 = (uint64_t)(uintptr_t)local_pAllocator; |
| 4003 | stream->putBe64(cgen_var_268); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4004 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4005 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4006 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4007 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 4008 | AEMU_SCOPED_TRACE("vkDestroyBufferView readParams"); |
| 4009 | AEMU_SCOPED_TRACE("vkDestroyBufferView returnUnmarshal"); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4010 | resources->destroyMapping()->mapHandles_VkBufferView((VkBufferView*)&bufferView); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 4011 | mImpl->log("finish vkDestroyBufferView");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4012 | } |
| 4013 | |
| 4014 | VkResult VkEncoder::vkCreateImage( |
| 4015 | VkDevice device, |
| 4016 | const VkImageCreateInfo* pCreateInfo, |
| 4017 | const VkAllocationCallbacks* pAllocator, |
| 4018 | VkImage* pImage) |
| 4019 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 4020 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 4021 | AEMU_SCOPED_TRACE("vkCreateImage encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 4022 | mImpl->log("start vkCreateImage"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4023 | auto stream = mImpl->stream(); |
| 4024 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4025 | auto resources = mImpl->resources(); |
| 4026 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4027 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4028 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4029 | VkImageCreateInfo* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 4030 | VkAllocationCallbacks* local_pAllocator; |
| 4031 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4032 | local_pCreateInfo = nullptr; |
| 4033 | if (pCreateInfo) |
| 4034 | { |
| 4035 | local_pCreateInfo = (VkImageCreateInfo*)pool->alloc(sizeof(const VkImageCreateInfo)); |
| 4036 | deepcopy_VkImageCreateInfo(pool, pCreateInfo, (VkImageCreateInfo*)(local_pCreateInfo)); |
| 4037 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4038 | local_pAllocator = nullptr; |
| 4039 | if (pAllocator) |
| 4040 | { |
| 4041 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 4042 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 4043 | } |
| Lingfeng Yang | def88ba | 2018-12-13 12:43:17 -0800 | [diff] [blame] | 4044 | mImpl->resources()->unwrap_VkNativeBufferANDROID(pCreateInfo, local_pCreateInfo); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 4045 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 4046 | if (local_pCreateInfo) |
| 4047 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 4048 | transform_tohost_VkImageCreateInfo(mImpl->resources(), (VkImageCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 4049 | } |
| 4050 | if (local_pAllocator) |
| 4051 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 4052 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 4053 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4054 | countingStream->rewind(); |
| 4055 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4056 | uint64_t cgen_var_269; |
| 4057 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_269, 1); |
| 4058 | countingStream->write((uint64_t*)&cgen_var_269, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4059 | marshal_VkImageCreateInfo(countingStream, (VkImageCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4060 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4061 | uint64_t cgen_var_270 = (uint64_t)(uintptr_t)local_pAllocator; |
| 4062 | countingStream->putBe64(cgen_var_270); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4063 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4064 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4065 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4066 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4067 | uint64_t cgen_var_271; |
| 4068 | countingStream->handleMapping()->mapHandles_VkImage_u64(pImage, &cgen_var_271, 1); |
| 4069 | countingStream->write((uint64_t*)&cgen_var_271, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4070 | } |
| 4071 | uint32_t packetSize_vkCreateImage = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 4072 | countingStream->rewind(); |
| 4073 | uint32_t opcode_vkCreateImage = OP_vkCreateImage; |
| 4074 | stream->write(&opcode_vkCreateImage, sizeof(uint32_t)); |
| 4075 | stream->write(&packetSize_vkCreateImage, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4076 | uint64_t cgen_var_272; |
| 4077 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_272, 1); |
| 4078 | stream->write((uint64_t*)&cgen_var_272, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4079 | marshal_VkImageCreateInfo(stream, (VkImageCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4080 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4081 | uint64_t cgen_var_273 = (uint64_t)(uintptr_t)local_pAllocator; |
| 4082 | stream->putBe64(cgen_var_273); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4083 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4084 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4085 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4086 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4087 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4088 | uint64_t cgen_var_274; |
| 4089 | stream->handleMapping()->mapHandles_VkImage_u64(pImage, &cgen_var_274, 1); |
| 4090 | stream->write((uint64_t*)&cgen_var_274, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4091 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 4092 | AEMU_SCOPED_TRACE("vkCreateImage readParams"); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4093 | stream->setHandleMapping(resources->createMapping()); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4094 | uint64_t cgen_var_275; |
| 4095 | stream->read((uint64_t*)&cgen_var_275, 8); |
| 4096 | stream->handleMapping()->mapHandles_u64_VkImage(&cgen_var_275, (VkImage*)pImage, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4097 | stream->unsetHandleMapping(); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 4098 | AEMU_SCOPED_TRACE("vkCreateImage returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4099 | VkResult vkCreateImage_VkResult_return = (VkResult)0; |
| 4100 | stream->read(&vkCreateImage_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4101 | countingStream->clearPool(); |
| 4102 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4103 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 4104 | mImpl->log("finish vkCreateImage");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4105 | return vkCreateImage_VkResult_return; |
| 4106 | } |
| 4107 | |
| 4108 | void VkEncoder::vkDestroyImage( |
| 4109 | VkDevice device, |
| 4110 | VkImage image, |
| 4111 | const VkAllocationCallbacks* pAllocator) |
| 4112 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 4113 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 4114 | AEMU_SCOPED_TRACE("vkDestroyImage encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 4115 | mImpl->log("start vkDestroyImage"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4116 | auto stream = mImpl->stream(); |
| 4117 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4118 | auto resources = mImpl->resources(); |
| 4119 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4120 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4121 | VkDevice local_device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 4122 | VkImage local_image; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4123 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 4124 | local_device = device; |
| 4125 | local_image = image; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4126 | local_pAllocator = nullptr; |
| 4127 | if (pAllocator) |
| 4128 | { |
| 4129 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 4130 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 4131 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 4132 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 4133 | if (local_pAllocator) |
| 4134 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 4135 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 4136 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4137 | countingStream->rewind(); |
| 4138 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4139 | uint64_t cgen_var_276; |
| 4140 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_276, 1); |
| 4141 | countingStream->write((uint64_t*)&cgen_var_276, 1 * 8); |
| 4142 | uint64_t cgen_var_277; |
| 4143 | countingStream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_277, 1); |
| 4144 | countingStream->write((uint64_t*)&cgen_var_277, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4145 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4146 | uint64_t cgen_var_278 = (uint64_t)(uintptr_t)local_pAllocator; |
| 4147 | countingStream->putBe64(cgen_var_278); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4148 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4149 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4150 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4151 | } |
| 4152 | } |
| 4153 | uint32_t packetSize_vkDestroyImage = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 4154 | countingStream->rewind(); |
| 4155 | uint32_t opcode_vkDestroyImage = OP_vkDestroyImage; |
| 4156 | stream->write(&opcode_vkDestroyImage, sizeof(uint32_t)); |
| 4157 | stream->write(&packetSize_vkDestroyImage, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4158 | uint64_t cgen_var_279; |
| 4159 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_279, 1); |
| 4160 | stream->write((uint64_t*)&cgen_var_279, 1 * 8); |
| 4161 | uint64_t cgen_var_280; |
| 4162 | stream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_280, 1); |
| 4163 | stream->write((uint64_t*)&cgen_var_280, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4164 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4165 | uint64_t cgen_var_281 = (uint64_t)(uintptr_t)local_pAllocator; |
| 4166 | stream->putBe64(cgen_var_281); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4167 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4168 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4169 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4170 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 4171 | AEMU_SCOPED_TRACE("vkDestroyImage readParams"); |
| 4172 | AEMU_SCOPED_TRACE("vkDestroyImage returnUnmarshal"); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4173 | resources->destroyMapping()->mapHandles_VkImage((VkImage*)&image); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 4174 | mImpl->log("finish vkDestroyImage");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4175 | } |
| 4176 | |
| 4177 | void VkEncoder::vkGetImageSubresourceLayout( |
| 4178 | VkDevice device, |
| 4179 | VkImage image, |
| 4180 | const VkImageSubresource* pSubresource, |
| 4181 | VkSubresourceLayout* pLayout) |
| 4182 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 4183 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 4184 | AEMU_SCOPED_TRACE("vkGetImageSubresourceLayout encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 4185 | mImpl->log("start vkGetImageSubresourceLayout"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4186 | auto stream = mImpl->stream(); |
| 4187 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4188 | auto resources = mImpl->resources(); |
| 4189 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4190 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4191 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4192 | VkImage local_image; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4193 | VkImageSubresource* local_pSubresource; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 4194 | local_device = device; |
| 4195 | local_image = image; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4196 | local_pSubresource = nullptr; |
| 4197 | if (pSubresource) |
| 4198 | { |
| 4199 | local_pSubresource = (VkImageSubresource*)pool->alloc(sizeof(const VkImageSubresource)); |
| 4200 | deepcopy_VkImageSubresource(pool, pSubresource, (VkImageSubresource*)(local_pSubresource)); |
| 4201 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 4202 | if (local_pSubresource) |
| 4203 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 4204 | transform_tohost_VkImageSubresource(mImpl->resources(), (VkImageSubresource*)(local_pSubresource)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 4205 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4206 | countingStream->rewind(); |
| 4207 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4208 | uint64_t cgen_var_282; |
| 4209 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_282, 1); |
| 4210 | countingStream->write((uint64_t*)&cgen_var_282, 1 * 8); |
| 4211 | uint64_t cgen_var_283; |
| 4212 | countingStream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_283, 1); |
| 4213 | countingStream->write((uint64_t*)&cgen_var_283, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4214 | marshal_VkImageSubresource(countingStream, (VkImageSubresource*)(local_pSubresource)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4215 | marshal_VkSubresourceLayout(countingStream, (VkSubresourceLayout*)(pLayout)); |
| 4216 | } |
| 4217 | uint32_t packetSize_vkGetImageSubresourceLayout = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 4218 | countingStream->rewind(); |
| 4219 | uint32_t opcode_vkGetImageSubresourceLayout = OP_vkGetImageSubresourceLayout; |
| 4220 | stream->write(&opcode_vkGetImageSubresourceLayout, sizeof(uint32_t)); |
| 4221 | stream->write(&packetSize_vkGetImageSubresourceLayout, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4222 | uint64_t cgen_var_284; |
| 4223 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_284, 1); |
| 4224 | stream->write((uint64_t*)&cgen_var_284, 1 * 8); |
| 4225 | uint64_t cgen_var_285; |
| 4226 | stream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_285, 1); |
| 4227 | stream->write((uint64_t*)&cgen_var_285, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4228 | marshal_VkImageSubresource(stream, (VkImageSubresource*)(local_pSubresource)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4229 | marshal_VkSubresourceLayout(stream, (VkSubresourceLayout*)(pLayout)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 4230 | AEMU_SCOPED_TRACE("vkGetImageSubresourceLayout readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4231 | unmarshal_VkSubresourceLayout(stream, (VkSubresourceLayout*)(pLayout)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 4232 | if (pLayout) |
| 4233 | { |
| 4234 | transform_fromhost_VkSubresourceLayout(mImpl->resources(), (VkSubresourceLayout*)(pLayout)); |
| 4235 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 4236 | AEMU_SCOPED_TRACE("vkGetImageSubresourceLayout returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 4237 | mImpl->log("finish vkGetImageSubresourceLayout");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4238 | } |
| 4239 | |
| 4240 | VkResult VkEncoder::vkCreateImageView( |
| 4241 | VkDevice device, |
| 4242 | const VkImageViewCreateInfo* pCreateInfo, |
| 4243 | const VkAllocationCallbacks* pAllocator, |
| 4244 | VkImageView* pView) |
| 4245 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 4246 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 4247 | AEMU_SCOPED_TRACE("vkCreateImageView encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 4248 | mImpl->log("start vkCreateImageView"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4249 | auto stream = mImpl->stream(); |
| 4250 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4251 | auto resources = mImpl->resources(); |
| 4252 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4253 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4254 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4255 | VkImageViewCreateInfo* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 4256 | VkAllocationCallbacks* local_pAllocator; |
| 4257 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4258 | local_pCreateInfo = nullptr; |
| 4259 | if (pCreateInfo) |
| 4260 | { |
| 4261 | local_pCreateInfo = (VkImageViewCreateInfo*)pool->alloc(sizeof(const VkImageViewCreateInfo)); |
| 4262 | deepcopy_VkImageViewCreateInfo(pool, pCreateInfo, (VkImageViewCreateInfo*)(local_pCreateInfo)); |
| 4263 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4264 | local_pAllocator = nullptr; |
| 4265 | if (pAllocator) |
| 4266 | { |
| 4267 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 4268 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 4269 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 4270 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 4271 | if (local_pCreateInfo) |
| 4272 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 4273 | transform_tohost_VkImageViewCreateInfo(mImpl->resources(), (VkImageViewCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 4274 | } |
| 4275 | if (local_pAllocator) |
| 4276 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 4277 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 4278 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4279 | countingStream->rewind(); |
| 4280 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4281 | uint64_t cgen_var_286; |
| 4282 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_286, 1); |
| 4283 | countingStream->write((uint64_t*)&cgen_var_286, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4284 | marshal_VkImageViewCreateInfo(countingStream, (VkImageViewCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4285 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4286 | uint64_t cgen_var_287 = (uint64_t)(uintptr_t)local_pAllocator; |
| 4287 | countingStream->putBe64(cgen_var_287); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4288 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4289 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4290 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4291 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4292 | uint64_t cgen_var_288; |
| 4293 | countingStream->handleMapping()->mapHandles_VkImageView_u64(pView, &cgen_var_288, 1); |
| 4294 | countingStream->write((uint64_t*)&cgen_var_288, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4295 | } |
| 4296 | uint32_t packetSize_vkCreateImageView = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 4297 | countingStream->rewind(); |
| 4298 | uint32_t opcode_vkCreateImageView = OP_vkCreateImageView; |
| 4299 | stream->write(&opcode_vkCreateImageView, sizeof(uint32_t)); |
| 4300 | stream->write(&packetSize_vkCreateImageView, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4301 | uint64_t cgen_var_289; |
| 4302 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_289, 1); |
| 4303 | stream->write((uint64_t*)&cgen_var_289, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4304 | marshal_VkImageViewCreateInfo(stream, (VkImageViewCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4305 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4306 | uint64_t cgen_var_290 = (uint64_t)(uintptr_t)local_pAllocator; |
| 4307 | stream->putBe64(cgen_var_290); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4308 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4309 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4310 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4311 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4312 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4313 | uint64_t cgen_var_291; |
| 4314 | stream->handleMapping()->mapHandles_VkImageView_u64(pView, &cgen_var_291, 1); |
| 4315 | stream->write((uint64_t*)&cgen_var_291, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4316 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 4317 | AEMU_SCOPED_TRACE("vkCreateImageView readParams"); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4318 | stream->setHandleMapping(resources->createMapping()); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4319 | uint64_t cgen_var_292; |
| 4320 | stream->read((uint64_t*)&cgen_var_292, 8); |
| 4321 | stream->handleMapping()->mapHandles_u64_VkImageView(&cgen_var_292, (VkImageView*)pView, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4322 | stream->unsetHandleMapping(); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 4323 | AEMU_SCOPED_TRACE("vkCreateImageView returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4324 | VkResult vkCreateImageView_VkResult_return = (VkResult)0; |
| 4325 | stream->read(&vkCreateImageView_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4326 | countingStream->clearPool(); |
| 4327 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4328 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 4329 | mImpl->log("finish vkCreateImageView");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4330 | return vkCreateImageView_VkResult_return; |
| 4331 | } |
| 4332 | |
| 4333 | void VkEncoder::vkDestroyImageView( |
| 4334 | VkDevice device, |
| 4335 | VkImageView imageView, |
| 4336 | const VkAllocationCallbacks* pAllocator) |
| 4337 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 4338 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 4339 | AEMU_SCOPED_TRACE("vkDestroyImageView encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 4340 | mImpl->log("start vkDestroyImageView"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4341 | auto stream = mImpl->stream(); |
| 4342 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4343 | auto resources = mImpl->resources(); |
| 4344 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4345 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4346 | VkDevice local_device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 4347 | VkImageView local_imageView; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4348 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 4349 | local_device = device; |
| 4350 | local_imageView = imageView; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4351 | local_pAllocator = nullptr; |
| 4352 | if (pAllocator) |
| 4353 | { |
| 4354 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 4355 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 4356 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 4357 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 4358 | if (local_pAllocator) |
| 4359 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 4360 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 4361 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4362 | countingStream->rewind(); |
| 4363 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4364 | uint64_t cgen_var_293; |
| 4365 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_293, 1); |
| 4366 | countingStream->write((uint64_t*)&cgen_var_293, 1 * 8); |
| 4367 | uint64_t cgen_var_294; |
| 4368 | countingStream->handleMapping()->mapHandles_VkImageView_u64(&local_imageView, &cgen_var_294, 1); |
| 4369 | countingStream->write((uint64_t*)&cgen_var_294, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4370 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4371 | uint64_t cgen_var_295 = (uint64_t)(uintptr_t)local_pAllocator; |
| 4372 | countingStream->putBe64(cgen_var_295); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4373 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4374 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4375 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4376 | } |
| 4377 | } |
| 4378 | uint32_t packetSize_vkDestroyImageView = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 4379 | countingStream->rewind(); |
| 4380 | uint32_t opcode_vkDestroyImageView = OP_vkDestroyImageView; |
| 4381 | stream->write(&opcode_vkDestroyImageView, sizeof(uint32_t)); |
| 4382 | stream->write(&packetSize_vkDestroyImageView, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4383 | uint64_t cgen_var_296; |
| 4384 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_296, 1); |
| 4385 | stream->write((uint64_t*)&cgen_var_296, 1 * 8); |
| 4386 | uint64_t cgen_var_297; |
| 4387 | stream->handleMapping()->mapHandles_VkImageView_u64(&local_imageView, &cgen_var_297, 1); |
| 4388 | stream->write((uint64_t*)&cgen_var_297, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4389 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4390 | uint64_t cgen_var_298 = (uint64_t)(uintptr_t)local_pAllocator; |
| 4391 | stream->putBe64(cgen_var_298); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4392 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4393 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4394 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4395 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 4396 | AEMU_SCOPED_TRACE("vkDestroyImageView readParams"); |
| 4397 | AEMU_SCOPED_TRACE("vkDestroyImageView returnUnmarshal"); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4398 | resources->destroyMapping()->mapHandles_VkImageView((VkImageView*)&imageView); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 4399 | mImpl->log("finish vkDestroyImageView");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4400 | } |
| 4401 | |
| 4402 | VkResult VkEncoder::vkCreateShaderModule( |
| 4403 | VkDevice device, |
| 4404 | const VkShaderModuleCreateInfo* pCreateInfo, |
| 4405 | const VkAllocationCallbacks* pAllocator, |
| 4406 | VkShaderModule* pShaderModule) |
| 4407 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 4408 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 4409 | AEMU_SCOPED_TRACE("vkCreateShaderModule encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 4410 | mImpl->log("start vkCreateShaderModule"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4411 | auto stream = mImpl->stream(); |
| 4412 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4413 | auto resources = mImpl->resources(); |
| 4414 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4415 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4416 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4417 | VkShaderModuleCreateInfo* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 4418 | VkAllocationCallbacks* local_pAllocator; |
| 4419 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4420 | local_pCreateInfo = nullptr; |
| 4421 | if (pCreateInfo) |
| 4422 | { |
| 4423 | local_pCreateInfo = (VkShaderModuleCreateInfo*)pool->alloc(sizeof(const VkShaderModuleCreateInfo)); |
| 4424 | deepcopy_VkShaderModuleCreateInfo(pool, pCreateInfo, (VkShaderModuleCreateInfo*)(local_pCreateInfo)); |
| 4425 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4426 | local_pAllocator = nullptr; |
| 4427 | if (pAllocator) |
| 4428 | { |
| 4429 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 4430 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 4431 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 4432 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 4433 | if (local_pCreateInfo) |
| 4434 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 4435 | transform_tohost_VkShaderModuleCreateInfo(mImpl->resources(), (VkShaderModuleCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 4436 | } |
| 4437 | if (local_pAllocator) |
| 4438 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 4439 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 4440 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4441 | countingStream->rewind(); |
| 4442 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4443 | uint64_t cgen_var_299; |
| 4444 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_299, 1); |
| 4445 | countingStream->write((uint64_t*)&cgen_var_299, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4446 | marshal_VkShaderModuleCreateInfo(countingStream, (VkShaderModuleCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4447 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4448 | uint64_t cgen_var_300 = (uint64_t)(uintptr_t)local_pAllocator; |
| 4449 | countingStream->putBe64(cgen_var_300); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4450 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4451 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4452 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4453 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4454 | uint64_t cgen_var_301; |
| 4455 | countingStream->handleMapping()->mapHandles_VkShaderModule_u64(pShaderModule, &cgen_var_301, 1); |
| 4456 | countingStream->write((uint64_t*)&cgen_var_301, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4457 | } |
| 4458 | uint32_t packetSize_vkCreateShaderModule = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 4459 | countingStream->rewind(); |
| 4460 | uint32_t opcode_vkCreateShaderModule = OP_vkCreateShaderModule; |
| 4461 | stream->write(&opcode_vkCreateShaderModule, sizeof(uint32_t)); |
| 4462 | stream->write(&packetSize_vkCreateShaderModule, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4463 | uint64_t cgen_var_302; |
| 4464 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_302, 1); |
| 4465 | stream->write((uint64_t*)&cgen_var_302, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4466 | marshal_VkShaderModuleCreateInfo(stream, (VkShaderModuleCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4467 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4468 | uint64_t cgen_var_303 = (uint64_t)(uintptr_t)local_pAllocator; |
| 4469 | stream->putBe64(cgen_var_303); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4470 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4471 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4472 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4473 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4474 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4475 | uint64_t cgen_var_304; |
| 4476 | stream->handleMapping()->mapHandles_VkShaderModule_u64(pShaderModule, &cgen_var_304, 1); |
| 4477 | stream->write((uint64_t*)&cgen_var_304, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4478 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 4479 | AEMU_SCOPED_TRACE("vkCreateShaderModule readParams"); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4480 | stream->setHandleMapping(resources->createMapping()); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4481 | uint64_t cgen_var_305; |
| 4482 | stream->read((uint64_t*)&cgen_var_305, 8); |
| 4483 | stream->handleMapping()->mapHandles_u64_VkShaderModule(&cgen_var_305, (VkShaderModule*)pShaderModule, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4484 | stream->unsetHandleMapping(); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 4485 | AEMU_SCOPED_TRACE("vkCreateShaderModule returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4486 | VkResult vkCreateShaderModule_VkResult_return = (VkResult)0; |
| 4487 | stream->read(&vkCreateShaderModule_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4488 | countingStream->clearPool(); |
| 4489 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4490 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 4491 | mImpl->log("finish vkCreateShaderModule");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4492 | return vkCreateShaderModule_VkResult_return; |
| 4493 | } |
| 4494 | |
| 4495 | void VkEncoder::vkDestroyShaderModule( |
| 4496 | VkDevice device, |
| 4497 | VkShaderModule shaderModule, |
| 4498 | const VkAllocationCallbacks* pAllocator) |
| 4499 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 4500 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 4501 | AEMU_SCOPED_TRACE("vkDestroyShaderModule encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 4502 | mImpl->log("start vkDestroyShaderModule"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4503 | auto stream = mImpl->stream(); |
| 4504 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4505 | auto resources = mImpl->resources(); |
| 4506 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4507 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4508 | VkDevice local_device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 4509 | VkShaderModule local_shaderModule; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4510 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 4511 | local_device = device; |
| 4512 | local_shaderModule = shaderModule; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4513 | local_pAllocator = nullptr; |
| 4514 | if (pAllocator) |
| 4515 | { |
| 4516 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 4517 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 4518 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 4519 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 4520 | if (local_pAllocator) |
| 4521 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 4522 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 4523 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4524 | countingStream->rewind(); |
| 4525 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4526 | uint64_t cgen_var_306; |
| 4527 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_306, 1); |
| 4528 | countingStream->write((uint64_t*)&cgen_var_306, 1 * 8); |
| 4529 | uint64_t cgen_var_307; |
| 4530 | countingStream->handleMapping()->mapHandles_VkShaderModule_u64(&local_shaderModule, &cgen_var_307, 1); |
| 4531 | countingStream->write((uint64_t*)&cgen_var_307, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4532 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4533 | uint64_t cgen_var_308 = (uint64_t)(uintptr_t)local_pAllocator; |
| 4534 | countingStream->putBe64(cgen_var_308); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4535 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4536 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4537 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4538 | } |
| 4539 | } |
| 4540 | uint32_t packetSize_vkDestroyShaderModule = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 4541 | countingStream->rewind(); |
| 4542 | uint32_t opcode_vkDestroyShaderModule = OP_vkDestroyShaderModule; |
| 4543 | stream->write(&opcode_vkDestroyShaderModule, sizeof(uint32_t)); |
| 4544 | stream->write(&packetSize_vkDestroyShaderModule, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4545 | uint64_t cgen_var_309; |
| 4546 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_309, 1); |
| 4547 | stream->write((uint64_t*)&cgen_var_309, 1 * 8); |
| 4548 | uint64_t cgen_var_310; |
| 4549 | stream->handleMapping()->mapHandles_VkShaderModule_u64(&local_shaderModule, &cgen_var_310, 1); |
| 4550 | stream->write((uint64_t*)&cgen_var_310, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4551 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4552 | uint64_t cgen_var_311 = (uint64_t)(uintptr_t)local_pAllocator; |
| 4553 | stream->putBe64(cgen_var_311); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4554 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4555 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4556 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4557 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 4558 | AEMU_SCOPED_TRACE("vkDestroyShaderModule readParams"); |
| 4559 | AEMU_SCOPED_TRACE("vkDestroyShaderModule returnUnmarshal"); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4560 | resources->destroyMapping()->mapHandles_VkShaderModule((VkShaderModule*)&shaderModule); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 4561 | mImpl->log("finish vkDestroyShaderModule");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4562 | } |
| 4563 | |
| 4564 | VkResult VkEncoder::vkCreatePipelineCache( |
| 4565 | VkDevice device, |
| 4566 | const VkPipelineCacheCreateInfo* pCreateInfo, |
| 4567 | const VkAllocationCallbacks* pAllocator, |
| 4568 | VkPipelineCache* pPipelineCache) |
| 4569 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 4570 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 4571 | AEMU_SCOPED_TRACE("vkCreatePipelineCache encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 4572 | mImpl->log("start vkCreatePipelineCache"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4573 | auto stream = mImpl->stream(); |
| 4574 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4575 | auto resources = mImpl->resources(); |
| 4576 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4577 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4578 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4579 | VkPipelineCacheCreateInfo* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 4580 | VkAllocationCallbacks* local_pAllocator; |
| 4581 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4582 | local_pCreateInfo = nullptr; |
| 4583 | if (pCreateInfo) |
| 4584 | { |
| 4585 | local_pCreateInfo = (VkPipelineCacheCreateInfo*)pool->alloc(sizeof(const VkPipelineCacheCreateInfo)); |
| 4586 | deepcopy_VkPipelineCacheCreateInfo(pool, pCreateInfo, (VkPipelineCacheCreateInfo*)(local_pCreateInfo)); |
| 4587 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4588 | local_pAllocator = nullptr; |
| 4589 | if (pAllocator) |
| 4590 | { |
| 4591 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 4592 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 4593 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 4594 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 4595 | if (local_pCreateInfo) |
| 4596 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 4597 | transform_tohost_VkPipelineCacheCreateInfo(mImpl->resources(), (VkPipelineCacheCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 4598 | } |
| 4599 | if (local_pAllocator) |
| 4600 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 4601 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 4602 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4603 | countingStream->rewind(); |
| 4604 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4605 | uint64_t cgen_var_312; |
| 4606 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_312, 1); |
| 4607 | countingStream->write((uint64_t*)&cgen_var_312, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4608 | marshal_VkPipelineCacheCreateInfo(countingStream, (VkPipelineCacheCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4609 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4610 | uint64_t cgen_var_313 = (uint64_t)(uintptr_t)local_pAllocator; |
| 4611 | countingStream->putBe64(cgen_var_313); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4612 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4613 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4614 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4615 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4616 | uint64_t cgen_var_314; |
| 4617 | countingStream->handleMapping()->mapHandles_VkPipelineCache_u64(pPipelineCache, &cgen_var_314, 1); |
| 4618 | countingStream->write((uint64_t*)&cgen_var_314, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4619 | } |
| 4620 | uint32_t packetSize_vkCreatePipelineCache = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 4621 | countingStream->rewind(); |
| 4622 | uint32_t opcode_vkCreatePipelineCache = OP_vkCreatePipelineCache; |
| 4623 | stream->write(&opcode_vkCreatePipelineCache, sizeof(uint32_t)); |
| 4624 | stream->write(&packetSize_vkCreatePipelineCache, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4625 | uint64_t cgen_var_315; |
| 4626 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_315, 1); |
| 4627 | stream->write((uint64_t*)&cgen_var_315, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4628 | marshal_VkPipelineCacheCreateInfo(stream, (VkPipelineCacheCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4629 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4630 | uint64_t cgen_var_316 = (uint64_t)(uintptr_t)local_pAllocator; |
| 4631 | stream->putBe64(cgen_var_316); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4632 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4633 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4634 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4635 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4636 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4637 | uint64_t cgen_var_317; |
| 4638 | stream->handleMapping()->mapHandles_VkPipelineCache_u64(pPipelineCache, &cgen_var_317, 1); |
| 4639 | stream->write((uint64_t*)&cgen_var_317, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4640 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 4641 | AEMU_SCOPED_TRACE("vkCreatePipelineCache readParams"); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4642 | stream->setHandleMapping(resources->createMapping()); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4643 | uint64_t cgen_var_318; |
| 4644 | stream->read((uint64_t*)&cgen_var_318, 8); |
| 4645 | stream->handleMapping()->mapHandles_u64_VkPipelineCache(&cgen_var_318, (VkPipelineCache*)pPipelineCache, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4646 | stream->unsetHandleMapping(); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 4647 | AEMU_SCOPED_TRACE("vkCreatePipelineCache returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4648 | VkResult vkCreatePipelineCache_VkResult_return = (VkResult)0; |
| 4649 | stream->read(&vkCreatePipelineCache_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4650 | countingStream->clearPool(); |
| 4651 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4652 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 4653 | mImpl->log("finish vkCreatePipelineCache");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4654 | return vkCreatePipelineCache_VkResult_return; |
| 4655 | } |
| 4656 | |
| 4657 | void VkEncoder::vkDestroyPipelineCache( |
| 4658 | VkDevice device, |
| 4659 | VkPipelineCache pipelineCache, |
| 4660 | const VkAllocationCallbacks* pAllocator) |
| 4661 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 4662 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 4663 | AEMU_SCOPED_TRACE("vkDestroyPipelineCache encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 4664 | mImpl->log("start vkDestroyPipelineCache"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4665 | auto stream = mImpl->stream(); |
| 4666 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4667 | auto resources = mImpl->resources(); |
| 4668 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4669 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4670 | VkDevice local_device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 4671 | VkPipelineCache local_pipelineCache; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4672 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 4673 | local_device = device; |
| 4674 | local_pipelineCache = pipelineCache; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4675 | local_pAllocator = nullptr; |
| 4676 | if (pAllocator) |
| 4677 | { |
| 4678 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 4679 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 4680 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 4681 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 4682 | if (local_pAllocator) |
| 4683 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 4684 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 4685 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4686 | countingStream->rewind(); |
| 4687 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4688 | uint64_t cgen_var_319; |
| 4689 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_319, 1); |
| 4690 | countingStream->write((uint64_t*)&cgen_var_319, 1 * 8); |
| 4691 | uint64_t cgen_var_320; |
| 4692 | countingStream->handleMapping()->mapHandles_VkPipelineCache_u64(&local_pipelineCache, &cgen_var_320, 1); |
| 4693 | countingStream->write((uint64_t*)&cgen_var_320, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4694 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4695 | uint64_t cgen_var_321 = (uint64_t)(uintptr_t)local_pAllocator; |
| 4696 | countingStream->putBe64(cgen_var_321); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4697 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4698 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4699 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4700 | } |
| 4701 | } |
| 4702 | uint32_t packetSize_vkDestroyPipelineCache = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 4703 | countingStream->rewind(); |
| 4704 | uint32_t opcode_vkDestroyPipelineCache = OP_vkDestroyPipelineCache; |
| 4705 | stream->write(&opcode_vkDestroyPipelineCache, sizeof(uint32_t)); |
| 4706 | stream->write(&packetSize_vkDestroyPipelineCache, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4707 | uint64_t cgen_var_322; |
| 4708 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_322, 1); |
| 4709 | stream->write((uint64_t*)&cgen_var_322, 1 * 8); |
| 4710 | uint64_t cgen_var_323; |
| 4711 | stream->handleMapping()->mapHandles_VkPipelineCache_u64(&local_pipelineCache, &cgen_var_323, 1); |
| 4712 | stream->write((uint64_t*)&cgen_var_323, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4713 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4714 | uint64_t cgen_var_324 = (uint64_t)(uintptr_t)local_pAllocator; |
| 4715 | stream->putBe64(cgen_var_324); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4716 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4717 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4718 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4719 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 4720 | AEMU_SCOPED_TRACE("vkDestroyPipelineCache readParams"); |
| 4721 | AEMU_SCOPED_TRACE("vkDestroyPipelineCache returnUnmarshal"); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4722 | resources->destroyMapping()->mapHandles_VkPipelineCache((VkPipelineCache*)&pipelineCache); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 4723 | mImpl->log("finish vkDestroyPipelineCache");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4724 | } |
| 4725 | |
| 4726 | VkResult VkEncoder::vkGetPipelineCacheData( |
| 4727 | VkDevice device, |
| 4728 | VkPipelineCache pipelineCache, |
| 4729 | size_t* pDataSize, |
| 4730 | void* pData) |
| 4731 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 4732 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 4733 | AEMU_SCOPED_TRACE("vkGetPipelineCacheData encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 4734 | mImpl->log("start vkGetPipelineCacheData"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4735 | auto stream = mImpl->stream(); |
| 4736 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4737 | auto resources = mImpl->resources(); |
| 4738 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4739 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4740 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4741 | VkPipelineCache local_pipelineCache; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 4742 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4743 | local_pipelineCache = pipelineCache; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4744 | countingStream->rewind(); |
| 4745 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4746 | uint64_t cgen_var_325; |
| 4747 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_325, 1); |
| 4748 | countingStream->write((uint64_t*)&cgen_var_325, 1 * 8); |
| 4749 | uint64_t cgen_var_326; |
| 4750 | countingStream->handleMapping()->mapHandles_VkPipelineCache_u64(&local_pipelineCache, &cgen_var_326, 1); |
| 4751 | countingStream->write((uint64_t*)&cgen_var_326, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4752 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4753 | uint64_t cgen_var_327 = (uint64_t)(uintptr_t)pDataSize; |
| 4754 | countingStream->putBe64(cgen_var_327); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4755 | if (pDataSize) |
| 4756 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4757 | uint64_t cgen_var_328 = (uint64_t)(*pDataSize); |
| 4758 | countingStream->putBe64(cgen_var_328); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4759 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4760 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4761 | uint64_t cgen_var_329 = (uint64_t)(uintptr_t)pData; |
| 4762 | countingStream->putBe64(cgen_var_329); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4763 | if (pData) |
| 4764 | { |
| 4765 | countingStream->write((void*)pData, (*(pDataSize)) * sizeof(uint8_t)); |
| 4766 | } |
| 4767 | } |
| 4768 | uint32_t packetSize_vkGetPipelineCacheData = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 4769 | countingStream->rewind(); |
| 4770 | uint32_t opcode_vkGetPipelineCacheData = OP_vkGetPipelineCacheData; |
| 4771 | stream->write(&opcode_vkGetPipelineCacheData, sizeof(uint32_t)); |
| 4772 | stream->write(&packetSize_vkGetPipelineCacheData, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4773 | uint64_t cgen_var_330; |
| 4774 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_330, 1); |
| 4775 | stream->write((uint64_t*)&cgen_var_330, 1 * 8); |
| 4776 | uint64_t cgen_var_331; |
| 4777 | stream->handleMapping()->mapHandles_VkPipelineCache_u64(&local_pipelineCache, &cgen_var_331, 1); |
| 4778 | stream->write((uint64_t*)&cgen_var_331, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4779 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4780 | uint64_t cgen_var_332 = (uint64_t)(uintptr_t)pDataSize; |
| 4781 | stream->putBe64(cgen_var_332); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4782 | if (pDataSize) |
| 4783 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4784 | uint64_t cgen_var_333 = (uint64_t)(*pDataSize); |
| 4785 | stream->putBe64(cgen_var_333); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4786 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4787 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4788 | uint64_t cgen_var_334 = (uint64_t)(uintptr_t)pData; |
| 4789 | stream->putBe64(cgen_var_334); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4790 | if (pData) |
| 4791 | { |
| 4792 | stream->write((void*)pData, (*(pDataSize)) * sizeof(uint8_t)); |
| 4793 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 4794 | AEMU_SCOPED_TRACE("vkGetPipelineCacheData readParams"); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4795 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4796 | size_t* check_pDataSize; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4797 | check_pDataSize = (size_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4798 | if (pDataSize) |
| 4799 | { |
| 4800 | if (!(check_pDataSize)) |
| 4801 | { |
| 4802 | fprintf(stderr, "fatal: pDataSize inconsistent between guest and host\n"); |
| 4803 | } |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 4804 | (*pDataSize) = (size_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4805 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4806 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4807 | void* check_pData; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4808 | check_pData = (void*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4809 | if (pData) |
| 4810 | { |
| 4811 | if (!(check_pData)) |
| 4812 | { |
| 4813 | fprintf(stderr, "fatal: pData inconsistent between guest and host\n"); |
| 4814 | } |
| 4815 | stream->read((void*)pData, (*(pDataSize)) * sizeof(uint8_t)); |
| 4816 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 4817 | AEMU_SCOPED_TRACE("vkGetPipelineCacheData returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4818 | VkResult vkGetPipelineCacheData_VkResult_return = (VkResult)0; |
| 4819 | stream->read(&vkGetPipelineCacheData_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4820 | countingStream->clearPool(); |
| 4821 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4822 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 4823 | mImpl->log("finish vkGetPipelineCacheData");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4824 | return vkGetPipelineCacheData_VkResult_return; |
| 4825 | } |
| 4826 | |
| 4827 | VkResult VkEncoder::vkMergePipelineCaches( |
| 4828 | VkDevice device, |
| 4829 | VkPipelineCache dstCache, |
| 4830 | uint32_t srcCacheCount, |
| 4831 | const VkPipelineCache* pSrcCaches) |
| 4832 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 4833 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 4834 | AEMU_SCOPED_TRACE("vkMergePipelineCaches encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 4835 | mImpl->log("start vkMergePipelineCaches"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4836 | auto stream = mImpl->stream(); |
| 4837 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4838 | auto resources = mImpl->resources(); |
| 4839 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4840 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4841 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4842 | VkPipelineCache local_dstCache; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4843 | uint32_t local_srcCacheCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4844 | VkPipelineCache* local_pSrcCaches; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 4845 | local_device = device; |
| 4846 | local_dstCache = dstCache; |
| 4847 | local_srcCacheCount = srcCacheCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4848 | local_pSrcCaches = nullptr; |
| 4849 | if (pSrcCaches) |
| 4850 | { |
| 4851 | local_pSrcCaches = (VkPipelineCache*)pool->dupArray(pSrcCaches, ((srcCacheCount)) * sizeof(const VkPipelineCache)); |
| 4852 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4853 | countingStream->rewind(); |
| 4854 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4855 | uint64_t cgen_var_338; |
| 4856 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_338, 1); |
| 4857 | countingStream->write((uint64_t*)&cgen_var_338, 1 * 8); |
| 4858 | uint64_t cgen_var_339; |
| 4859 | countingStream->handleMapping()->mapHandles_VkPipelineCache_u64(&local_dstCache, &cgen_var_339, 1); |
| 4860 | countingStream->write((uint64_t*)&cgen_var_339, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4861 | countingStream->write((uint32_t*)&local_srcCacheCount, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4862 | if (((srcCacheCount))) |
| 4863 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4864 | uint64_t* cgen_var_340; |
| 4865 | countingStream->alloc((void**)&cgen_var_340, ((srcCacheCount)) * 8); |
| 4866 | countingStream->handleMapping()->mapHandles_VkPipelineCache_u64(local_pSrcCaches, cgen_var_340, ((srcCacheCount))); |
| 4867 | countingStream->write((uint64_t*)cgen_var_340, ((srcCacheCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4868 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4869 | } |
| 4870 | uint32_t packetSize_vkMergePipelineCaches = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 4871 | countingStream->rewind(); |
| 4872 | uint32_t opcode_vkMergePipelineCaches = OP_vkMergePipelineCaches; |
| 4873 | stream->write(&opcode_vkMergePipelineCaches, sizeof(uint32_t)); |
| 4874 | stream->write(&packetSize_vkMergePipelineCaches, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4875 | uint64_t cgen_var_341; |
| 4876 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_341, 1); |
| 4877 | stream->write((uint64_t*)&cgen_var_341, 1 * 8); |
| 4878 | uint64_t cgen_var_342; |
| 4879 | stream->handleMapping()->mapHandles_VkPipelineCache_u64(&local_dstCache, &cgen_var_342, 1); |
| 4880 | stream->write((uint64_t*)&cgen_var_342, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4881 | stream->write((uint32_t*)&local_srcCacheCount, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4882 | if (((srcCacheCount))) |
| 4883 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4884 | uint64_t* cgen_var_343; |
| 4885 | stream->alloc((void**)&cgen_var_343, ((srcCacheCount)) * 8); |
| 4886 | stream->handleMapping()->mapHandles_VkPipelineCache_u64(local_pSrcCaches, cgen_var_343, ((srcCacheCount))); |
| 4887 | stream->write((uint64_t*)cgen_var_343, ((srcCacheCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4888 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 4889 | AEMU_SCOPED_TRACE("vkMergePipelineCaches readParams"); |
| 4890 | AEMU_SCOPED_TRACE("vkMergePipelineCaches returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4891 | VkResult vkMergePipelineCaches_VkResult_return = (VkResult)0; |
| 4892 | stream->read(&vkMergePipelineCaches_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4893 | countingStream->clearPool(); |
| 4894 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4895 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 4896 | mImpl->log("finish vkMergePipelineCaches");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4897 | return vkMergePipelineCaches_VkResult_return; |
| 4898 | } |
| 4899 | |
| 4900 | VkResult VkEncoder::vkCreateGraphicsPipelines( |
| 4901 | VkDevice device, |
| 4902 | VkPipelineCache pipelineCache, |
| 4903 | uint32_t createInfoCount, |
| 4904 | const VkGraphicsPipelineCreateInfo* pCreateInfos, |
| 4905 | const VkAllocationCallbacks* pAllocator, |
| 4906 | VkPipeline* pPipelines) |
| 4907 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 4908 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 4909 | AEMU_SCOPED_TRACE("vkCreateGraphicsPipelines encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 4910 | mImpl->log("start vkCreateGraphicsPipelines"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4911 | auto stream = mImpl->stream(); |
| 4912 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4913 | auto resources = mImpl->resources(); |
| 4914 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4915 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4916 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4917 | VkPipelineCache local_pipelineCache; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4918 | uint32_t local_createInfoCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4919 | VkGraphicsPipelineCreateInfo* local_pCreateInfos; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 4920 | VkAllocationCallbacks* local_pAllocator; |
| 4921 | local_device = device; |
| 4922 | local_pipelineCache = pipelineCache; |
| 4923 | local_createInfoCount = createInfoCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4924 | local_pCreateInfos = nullptr; |
| 4925 | if (pCreateInfos) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4926 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4927 | local_pCreateInfos = (VkGraphicsPipelineCreateInfo*)pool->alloc(((createInfoCount)) * sizeof(const VkGraphicsPipelineCreateInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4928 | for (uint32_t i = 0; i < (uint32_t)((createInfoCount)); ++i) |
| 4929 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4930 | deepcopy_VkGraphicsPipelineCreateInfo(pool, pCreateInfos + i, (VkGraphicsPipelineCreateInfo*)(local_pCreateInfos + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4931 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4932 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4933 | local_pAllocator = nullptr; |
| 4934 | if (pAllocator) |
| 4935 | { |
| 4936 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 4937 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 4938 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 4939 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 4940 | if (local_pCreateInfos) |
| 4941 | { |
| 4942 | for (uint32_t i = 0; i < (uint32_t)((createInfoCount)); ++i) |
| 4943 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 4944 | transform_tohost_VkGraphicsPipelineCreateInfo(mImpl->resources(), (VkGraphicsPipelineCreateInfo*)(local_pCreateInfos + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 4945 | } |
| 4946 | } |
| 4947 | if (local_pAllocator) |
| 4948 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 4949 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 4950 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4951 | countingStream->rewind(); |
| 4952 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4953 | uint64_t cgen_var_344; |
| 4954 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_344, 1); |
| 4955 | countingStream->write((uint64_t*)&cgen_var_344, 1 * 8); |
| 4956 | uint64_t cgen_var_345; |
| 4957 | countingStream->handleMapping()->mapHandles_VkPipelineCache_u64(&local_pipelineCache, &cgen_var_345, 1); |
| 4958 | countingStream->write((uint64_t*)&cgen_var_345, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4959 | countingStream->write((uint32_t*)&local_createInfoCount, sizeof(uint32_t)); |
| 4960 | for (uint32_t i = 0; i < (uint32_t)((createInfoCount)); ++i) |
| 4961 | { |
| 4962 | marshal_VkGraphicsPipelineCreateInfo(countingStream, (VkGraphicsPipelineCreateInfo*)(local_pCreateInfos + i)); |
| 4963 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4964 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4965 | uint64_t cgen_var_346 = (uint64_t)(uintptr_t)local_pAllocator; |
| 4966 | countingStream->putBe64(cgen_var_346); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4967 | if (local_pAllocator) |
| 4968 | { |
| 4969 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4970 | } |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4971 | if (((createInfoCount))) |
| 4972 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4973 | uint64_t* cgen_var_347; |
| 4974 | countingStream->alloc((void**)&cgen_var_347, ((createInfoCount)) * 8); |
| 4975 | countingStream->handleMapping()->mapHandles_VkPipeline_u64(pPipelines, cgen_var_347, ((createInfoCount))); |
| 4976 | countingStream->write((uint64_t*)cgen_var_347, ((createInfoCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4977 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4978 | } |
| 4979 | uint32_t packetSize_vkCreateGraphicsPipelines = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 4980 | countingStream->rewind(); |
| 4981 | uint32_t opcode_vkCreateGraphicsPipelines = OP_vkCreateGraphicsPipelines; |
| 4982 | stream->write(&opcode_vkCreateGraphicsPipelines, sizeof(uint32_t)); |
| 4983 | stream->write(&packetSize_vkCreateGraphicsPipelines, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4984 | uint64_t cgen_var_348; |
| 4985 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_348, 1); |
| 4986 | stream->write((uint64_t*)&cgen_var_348, 1 * 8); |
| 4987 | uint64_t cgen_var_349; |
| 4988 | stream->handleMapping()->mapHandles_VkPipelineCache_u64(&local_pipelineCache, &cgen_var_349, 1); |
| 4989 | stream->write((uint64_t*)&cgen_var_349, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4990 | stream->write((uint32_t*)&local_createInfoCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4991 | for (uint32_t i = 0; i < (uint32_t)((createInfoCount)); ++i) |
| 4992 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4993 | marshal_VkGraphicsPipelineCreateInfo(stream, (VkGraphicsPipelineCreateInfo*)(local_pCreateInfos + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4994 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4995 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4996 | uint64_t cgen_var_350 = (uint64_t)(uintptr_t)local_pAllocator; |
| 4997 | stream->putBe64(cgen_var_350); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4998 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4999 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5000 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5001 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5002 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5003 | if (((createInfoCount))) |
| 5004 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5005 | uint64_t* cgen_var_351; |
| 5006 | stream->alloc((void**)&cgen_var_351, ((createInfoCount)) * 8); |
| 5007 | stream->handleMapping()->mapHandles_VkPipeline_u64(pPipelines, cgen_var_351, ((createInfoCount))); |
| 5008 | stream->write((uint64_t*)cgen_var_351, ((createInfoCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5009 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5010 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 5011 | AEMU_SCOPED_TRACE("vkCreateGraphicsPipelines readParams"); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5012 | stream->setHandleMapping(resources->createMapping()); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5013 | if (((createInfoCount))) |
| 5014 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5015 | uint64_t* cgen_var_352; |
| 5016 | stream->alloc((void**)&cgen_var_352, ((createInfoCount)) * 8); |
| 5017 | stream->read((uint64_t*)cgen_var_352, ((createInfoCount)) * 8); |
| 5018 | stream->handleMapping()->mapHandles_u64_VkPipeline(cgen_var_352, (VkPipeline*)pPipelines, ((createInfoCount))); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5019 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5020 | stream->unsetHandleMapping(); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 5021 | AEMU_SCOPED_TRACE("vkCreateGraphicsPipelines returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5022 | VkResult vkCreateGraphicsPipelines_VkResult_return = (VkResult)0; |
| 5023 | stream->read(&vkCreateGraphicsPipelines_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5024 | countingStream->clearPool(); |
| 5025 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5026 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 5027 | mImpl->log("finish vkCreateGraphicsPipelines");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5028 | return vkCreateGraphicsPipelines_VkResult_return; |
| 5029 | } |
| 5030 | |
| 5031 | VkResult VkEncoder::vkCreateComputePipelines( |
| 5032 | VkDevice device, |
| 5033 | VkPipelineCache pipelineCache, |
| 5034 | uint32_t createInfoCount, |
| 5035 | const VkComputePipelineCreateInfo* pCreateInfos, |
| 5036 | const VkAllocationCallbacks* pAllocator, |
| 5037 | VkPipeline* pPipelines) |
| 5038 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 5039 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 5040 | AEMU_SCOPED_TRACE("vkCreateComputePipelines encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 5041 | mImpl->log("start vkCreateComputePipelines"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5042 | auto stream = mImpl->stream(); |
| 5043 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5044 | auto resources = mImpl->resources(); |
| 5045 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5046 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5047 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5048 | VkPipelineCache local_pipelineCache; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5049 | uint32_t local_createInfoCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5050 | VkComputePipelineCreateInfo* local_pCreateInfos; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 5051 | VkAllocationCallbacks* local_pAllocator; |
| 5052 | local_device = device; |
| 5053 | local_pipelineCache = pipelineCache; |
| 5054 | local_createInfoCount = createInfoCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5055 | local_pCreateInfos = nullptr; |
| 5056 | if (pCreateInfos) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5057 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5058 | local_pCreateInfos = (VkComputePipelineCreateInfo*)pool->alloc(((createInfoCount)) * sizeof(const VkComputePipelineCreateInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5059 | for (uint32_t i = 0; i < (uint32_t)((createInfoCount)); ++i) |
| 5060 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5061 | deepcopy_VkComputePipelineCreateInfo(pool, pCreateInfos + i, (VkComputePipelineCreateInfo*)(local_pCreateInfos + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5062 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5063 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5064 | local_pAllocator = nullptr; |
| 5065 | if (pAllocator) |
| 5066 | { |
| 5067 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 5068 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 5069 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 5070 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5071 | if (local_pCreateInfos) |
| 5072 | { |
| 5073 | for (uint32_t i = 0; i < (uint32_t)((createInfoCount)); ++i) |
| 5074 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 5075 | transform_tohost_VkComputePipelineCreateInfo(mImpl->resources(), (VkComputePipelineCreateInfo*)(local_pCreateInfos + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5076 | } |
| 5077 | } |
| 5078 | if (local_pAllocator) |
| 5079 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 5080 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5081 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5082 | countingStream->rewind(); |
| 5083 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5084 | uint64_t cgen_var_353; |
| 5085 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_353, 1); |
| 5086 | countingStream->write((uint64_t*)&cgen_var_353, 1 * 8); |
| 5087 | uint64_t cgen_var_354; |
| 5088 | countingStream->handleMapping()->mapHandles_VkPipelineCache_u64(&local_pipelineCache, &cgen_var_354, 1); |
| 5089 | countingStream->write((uint64_t*)&cgen_var_354, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5090 | countingStream->write((uint32_t*)&local_createInfoCount, sizeof(uint32_t)); |
| 5091 | for (uint32_t i = 0; i < (uint32_t)((createInfoCount)); ++i) |
| 5092 | { |
| 5093 | marshal_VkComputePipelineCreateInfo(countingStream, (VkComputePipelineCreateInfo*)(local_pCreateInfos + i)); |
| 5094 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 5095 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5096 | uint64_t cgen_var_355 = (uint64_t)(uintptr_t)local_pAllocator; |
| 5097 | countingStream->putBe64(cgen_var_355); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5098 | if (local_pAllocator) |
| 5099 | { |
| 5100 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5101 | } |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5102 | if (((createInfoCount))) |
| 5103 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5104 | uint64_t* cgen_var_356; |
| 5105 | countingStream->alloc((void**)&cgen_var_356, ((createInfoCount)) * 8); |
| 5106 | countingStream->handleMapping()->mapHandles_VkPipeline_u64(pPipelines, cgen_var_356, ((createInfoCount))); |
| 5107 | countingStream->write((uint64_t*)cgen_var_356, ((createInfoCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5108 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5109 | } |
| 5110 | uint32_t packetSize_vkCreateComputePipelines = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 5111 | countingStream->rewind(); |
| 5112 | uint32_t opcode_vkCreateComputePipelines = OP_vkCreateComputePipelines; |
| 5113 | stream->write(&opcode_vkCreateComputePipelines, sizeof(uint32_t)); |
| 5114 | stream->write(&packetSize_vkCreateComputePipelines, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5115 | uint64_t cgen_var_357; |
| 5116 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_357, 1); |
| 5117 | stream->write((uint64_t*)&cgen_var_357, 1 * 8); |
| 5118 | uint64_t cgen_var_358; |
| 5119 | stream->handleMapping()->mapHandles_VkPipelineCache_u64(&local_pipelineCache, &cgen_var_358, 1); |
| 5120 | stream->write((uint64_t*)&cgen_var_358, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5121 | stream->write((uint32_t*)&local_createInfoCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5122 | for (uint32_t i = 0; i < (uint32_t)((createInfoCount)); ++i) |
| 5123 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5124 | marshal_VkComputePipelineCreateInfo(stream, (VkComputePipelineCreateInfo*)(local_pCreateInfos + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5125 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 5126 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5127 | uint64_t cgen_var_359 = (uint64_t)(uintptr_t)local_pAllocator; |
| 5128 | stream->putBe64(cgen_var_359); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5129 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5130 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5131 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5132 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5133 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5134 | if (((createInfoCount))) |
| 5135 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5136 | uint64_t* cgen_var_360; |
| 5137 | stream->alloc((void**)&cgen_var_360, ((createInfoCount)) * 8); |
| 5138 | stream->handleMapping()->mapHandles_VkPipeline_u64(pPipelines, cgen_var_360, ((createInfoCount))); |
| 5139 | stream->write((uint64_t*)cgen_var_360, ((createInfoCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5140 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5141 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 5142 | AEMU_SCOPED_TRACE("vkCreateComputePipelines readParams"); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5143 | stream->setHandleMapping(resources->createMapping()); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5144 | if (((createInfoCount))) |
| 5145 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5146 | uint64_t* cgen_var_361; |
| 5147 | stream->alloc((void**)&cgen_var_361, ((createInfoCount)) * 8); |
| 5148 | stream->read((uint64_t*)cgen_var_361, ((createInfoCount)) * 8); |
| 5149 | stream->handleMapping()->mapHandles_u64_VkPipeline(cgen_var_361, (VkPipeline*)pPipelines, ((createInfoCount))); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5150 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5151 | stream->unsetHandleMapping(); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 5152 | AEMU_SCOPED_TRACE("vkCreateComputePipelines returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5153 | VkResult vkCreateComputePipelines_VkResult_return = (VkResult)0; |
| 5154 | stream->read(&vkCreateComputePipelines_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5155 | countingStream->clearPool(); |
| 5156 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5157 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 5158 | mImpl->log("finish vkCreateComputePipelines");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5159 | return vkCreateComputePipelines_VkResult_return; |
| 5160 | } |
| 5161 | |
| 5162 | void VkEncoder::vkDestroyPipeline( |
| 5163 | VkDevice device, |
| 5164 | VkPipeline pipeline, |
| 5165 | const VkAllocationCallbacks* pAllocator) |
| 5166 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 5167 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 5168 | AEMU_SCOPED_TRACE("vkDestroyPipeline encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 5169 | mImpl->log("start vkDestroyPipeline"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5170 | auto stream = mImpl->stream(); |
| 5171 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5172 | auto resources = mImpl->resources(); |
| 5173 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5174 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5175 | VkDevice local_device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 5176 | VkPipeline local_pipeline; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5177 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 5178 | local_device = device; |
| 5179 | local_pipeline = pipeline; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5180 | local_pAllocator = nullptr; |
| 5181 | if (pAllocator) |
| 5182 | { |
| 5183 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 5184 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 5185 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 5186 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5187 | if (local_pAllocator) |
| 5188 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 5189 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5190 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5191 | countingStream->rewind(); |
| 5192 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5193 | uint64_t cgen_var_362; |
| 5194 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_362, 1); |
| 5195 | countingStream->write((uint64_t*)&cgen_var_362, 1 * 8); |
| 5196 | uint64_t cgen_var_363; |
| 5197 | countingStream->handleMapping()->mapHandles_VkPipeline_u64(&local_pipeline, &cgen_var_363, 1); |
| 5198 | countingStream->write((uint64_t*)&cgen_var_363, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 5199 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5200 | uint64_t cgen_var_364 = (uint64_t)(uintptr_t)local_pAllocator; |
| 5201 | countingStream->putBe64(cgen_var_364); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5202 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5203 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5204 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5205 | } |
| 5206 | } |
| 5207 | uint32_t packetSize_vkDestroyPipeline = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 5208 | countingStream->rewind(); |
| 5209 | uint32_t opcode_vkDestroyPipeline = OP_vkDestroyPipeline; |
| 5210 | stream->write(&opcode_vkDestroyPipeline, sizeof(uint32_t)); |
| 5211 | stream->write(&packetSize_vkDestroyPipeline, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5212 | uint64_t cgen_var_365; |
| 5213 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_365, 1); |
| 5214 | stream->write((uint64_t*)&cgen_var_365, 1 * 8); |
| 5215 | uint64_t cgen_var_366; |
| 5216 | stream->handleMapping()->mapHandles_VkPipeline_u64(&local_pipeline, &cgen_var_366, 1); |
| 5217 | stream->write((uint64_t*)&cgen_var_366, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 5218 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5219 | uint64_t cgen_var_367 = (uint64_t)(uintptr_t)local_pAllocator; |
| 5220 | stream->putBe64(cgen_var_367); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5221 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5222 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5223 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5224 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 5225 | AEMU_SCOPED_TRACE("vkDestroyPipeline readParams"); |
| 5226 | AEMU_SCOPED_TRACE("vkDestroyPipeline returnUnmarshal"); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5227 | resources->destroyMapping()->mapHandles_VkPipeline((VkPipeline*)&pipeline); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 5228 | mImpl->log("finish vkDestroyPipeline");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5229 | } |
| 5230 | |
| 5231 | VkResult VkEncoder::vkCreatePipelineLayout( |
| 5232 | VkDevice device, |
| 5233 | const VkPipelineLayoutCreateInfo* pCreateInfo, |
| 5234 | const VkAllocationCallbacks* pAllocator, |
| 5235 | VkPipelineLayout* pPipelineLayout) |
| 5236 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 5237 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 5238 | AEMU_SCOPED_TRACE("vkCreatePipelineLayout encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 5239 | mImpl->log("start vkCreatePipelineLayout"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5240 | auto stream = mImpl->stream(); |
| 5241 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5242 | auto resources = mImpl->resources(); |
| 5243 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5244 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5245 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5246 | VkPipelineLayoutCreateInfo* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 5247 | VkAllocationCallbacks* local_pAllocator; |
| 5248 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5249 | local_pCreateInfo = nullptr; |
| 5250 | if (pCreateInfo) |
| 5251 | { |
| 5252 | local_pCreateInfo = (VkPipelineLayoutCreateInfo*)pool->alloc(sizeof(const VkPipelineLayoutCreateInfo)); |
| 5253 | deepcopy_VkPipelineLayoutCreateInfo(pool, pCreateInfo, (VkPipelineLayoutCreateInfo*)(local_pCreateInfo)); |
| 5254 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5255 | local_pAllocator = nullptr; |
| 5256 | if (pAllocator) |
| 5257 | { |
| 5258 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 5259 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 5260 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 5261 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5262 | if (local_pCreateInfo) |
| 5263 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 5264 | transform_tohost_VkPipelineLayoutCreateInfo(mImpl->resources(), (VkPipelineLayoutCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5265 | } |
| 5266 | if (local_pAllocator) |
| 5267 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 5268 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5269 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5270 | countingStream->rewind(); |
| 5271 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5272 | uint64_t cgen_var_368; |
| 5273 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_368, 1); |
| 5274 | countingStream->write((uint64_t*)&cgen_var_368, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5275 | marshal_VkPipelineLayoutCreateInfo(countingStream, (VkPipelineLayoutCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 5276 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5277 | uint64_t cgen_var_369 = (uint64_t)(uintptr_t)local_pAllocator; |
| 5278 | countingStream->putBe64(cgen_var_369); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5279 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5280 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5281 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5282 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5283 | uint64_t cgen_var_370; |
| 5284 | countingStream->handleMapping()->mapHandles_VkPipelineLayout_u64(pPipelineLayout, &cgen_var_370, 1); |
| 5285 | countingStream->write((uint64_t*)&cgen_var_370, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5286 | } |
| 5287 | uint32_t packetSize_vkCreatePipelineLayout = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 5288 | countingStream->rewind(); |
| 5289 | uint32_t opcode_vkCreatePipelineLayout = OP_vkCreatePipelineLayout; |
| 5290 | stream->write(&opcode_vkCreatePipelineLayout, sizeof(uint32_t)); |
| 5291 | stream->write(&packetSize_vkCreatePipelineLayout, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5292 | uint64_t cgen_var_371; |
| 5293 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_371, 1); |
| 5294 | stream->write((uint64_t*)&cgen_var_371, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5295 | marshal_VkPipelineLayoutCreateInfo(stream, (VkPipelineLayoutCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 5296 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5297 | uint64_t cgen_var_372 = (uint64_t)(uintptr_t)local_pAllocator; |
| 5298 | stream->putBe64(cgen_var_372); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5299 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5300 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5301 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5302 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5303 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5304 | uint64_t cgen_var_373; |
| 5305 | stream->handleMapping()->mapHandles_VkPipelineLayout_u64(pPipelineLayout, &cgen_var_373, 1); |
| 5306 | stream->write((uint64_t*)&cgen_var_373, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5307 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 5308 | AEMU_SCOPED_TRACE("vkCreatePipelineLayout readParams"); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5309 | stream->setHandleMapping(resources->createMapping()); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5310 | uint64_t cgen_var_374; |
| 5311 | stream->read((uint64_t*)&cgen_var_374, 8); |
| 5312 | stream->handleMapping()->mapHandles_u64_VkPipelineLayout(&cgen_var_374, (VkPipelineLayout*)pPipelineLayout, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5313 | stream->unsetHandleMapping(); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 5314 | AEMU_SCOPED_TRACE("vkCreatePipelineLayout returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5315 | VkResult vkCreatePipelineLayout_VkResult_return = (VkResult)0; |
| 5316 | stream->read(&vkCreatePipelineLayout_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5317 | countingStream->clearPool(); |
| 5318 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5319 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 5320 | mImpl->log("finish vkCreatePipelineLayout");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5321 | return vkCreatePipelineLayout_VkResult_return; |
| 5322 | } |
| 5323 | |
| 5324 | void VkEncoder::vkDestroyPipelineLayout( |
| 5325 | VkDevice device, |
| 5326 | VkPipelineLayout pipelineLayout, |
| 5327 | const VkAllocationCallbacks* pAllocator) |
| 5328 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 5329 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 5330 | AEMU_SCOPED_TRACE("vkDestroyPipelineLayout encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 5331 | mImpl->log("start vkDestroyPipelineLayout"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5332 | auto stream = mImpl->stream(); |
| 5333 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5334 | auto resources = mImpl->resources(); |
| 5335 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5336 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5337 | VkDevice local_device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 5338 | VkPipelineLayout local_pipelineLayout; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5339 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 5340 | local_device = device; |
| 5341 | local_pipelineLayout = pipelineLayout; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5342 | local_pAllocator = nullptr; |
| 5343 | if (pAllocator) |
| 5344 | { |
| 5345 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 5346 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 5347 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 5348 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5349 | if (local_pAllocator) |
| 5350 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 5351 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5352 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5353 | countingStream->rewind(); |
| 5354 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5355 | uint64_t cgen_var_375; |
| 5356 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_375, 1); |
| 5357 | countingStream->write((uint64_t*)&cgen_var_375, 1 * 8); |
| 5358 | uint64_t cgen_var_376; |
| 5359 | countingStream->handleMapping()->mapHandles_VkPipelineLayout_u64(&local_pipelineLayout, &cgen_var_376, 1); |
| 5360 | countingStream->write((uint64_t*)&cgen_var_376, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 5361 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5362 | uint64_t cgen_var_377 = (uint64_t)(uintptr_t)local_pAllocator; |
| 5363 | countingStream->putBe64(cgen_var_377); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5364 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5365 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5366 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5367 | } |
| 5368 | } |
| 5369 | uint32_t packetSize_vkDestroyPipelineLayout = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 5370 | countingStream->rewind(); |
| 5371 | uint32_t opcode_vkDestroyPipelineLayout = OP_vkDestroyPipelineLayout; |
| 5372 | stream->write(&opcode_vkDestroyPipelineLayout, sizeof(uint32_t)); |
| 5373 | stream->write(&packetSize_vkDestroyPipelineLayout, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5374 | uint64_t cgen_var_378; |
| 5375 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_378, 1); |
| 5376 | stream->write((uint64_t*)&cgen_var_378, 1 * 8); |
| 5377 | uint64_t cgen_var_379; |
| 5378 | stream->handleMapping()->mapHandles_VkPipelineLayout_u64(&local_pipelineLayout, &cgen_var_379, 1); |
| 5379 | stream->write((uint64_t*)&cgen_var_379, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 5380 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5381 | uint64_t cgen_var_380 = (uint64_t)(uintptr_t)local_pAllocator; |
| 5382 | stream->putBe64(cgen_var_380); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5383 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5384 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5385 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5386 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 5387 | AEMU_SCOPED_TRACE("vkDestroyPipelineLayout readParams"); |
| 5388 | AEMU_SCOPED_TRACE("vkDestroyPipelineLayout returnUnmarshal"); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5389 | resources->destroyMapping()->mapHandles_VkPipelineLayout((VkPipelineLayout*)&pipelineLayout); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 5390 | mImpl->log("finish vkDestroyPipelineLayout");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5391 | } |
| 5392 | |
| 5393 | VkResult VkEncoder::vkCreateSampler( |
| 5394 | VkDevice device, |
| 5395 | const VkSamplerCreateInfo* pCreateInfo, |
| 5396 | const VkAllocationCallbacks* pAllocator, |
| 5397 | VkSampler* pSampler) |
| 5398 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 5399 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 5400 | AEMU_SCOPED_TRACE("vkCreateSampler encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 5401 | mImpl->log("start vkCreateSampler"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5402 | auto stream = mImpl->stream(); |
| 5403 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5404 | auto resources = mImpl->resources(); |
| 5405 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5406 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5407 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5408 | VkSamplerCreateInfo* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 5409 | VkAllocationCallbacks* local_pAllocator; |
| 5410 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5411 | local_pCreateInfo = nullptr; |
| 5412 | if (pCreateInfo) |
| 5413 | { |
| 5414 | local_pCreateInfo = (VkSamplerCreateInfo*)pool->alloc(sizeof(const VkSamplerCreateInfo)); |
| 5415 | deepcopy_VkSamplerCreateInfo(pool, pCreateInfo, (VkSamplerCreateInfo*)(local_pCreateInfo)); |
| 5416 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5417 | local_pAllocator = nullptr; |
| 5418 | if (pAllocator) |
| 5419 | { |
| 5420 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 5421 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 5422 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 5423 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5424 | if (local_pCreateInfo) |
| 5425 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 5426 | transform_tohost_VkSamplerCreateInfo(mImpl->resources(), (VkSamplerCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5427 | } |
| 5428 | if (local_pAllocator) |
| 5429 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 5430 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5431 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5432 | countingStream->rewind(); |
| 5433 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5434 | uint64_t cgen_var_381; |
| 5435 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_381, 1); |
| 5436 | countingStream->write((uint64_t*)&cgen_var_381, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5437 | marshal_VkSamplerCreateInfo(countingStream, (VkSamplerCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 5438 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5439 | uint64_t cgen_var_382 = (uint64_t)(uintptr_t)local_pAllocator; |
| 5440 | countingStream->putBe64(cgen_var_382); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5441 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5442 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5443 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5444 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5445 | uint64_t cgen_var_383; |
| 5446 | countingStream->handleMapping()->mapHandles_VkSampler_u64(pSampler, &cgen_var_383, 1); |
| 5447 | countingStream->write((uint64_t*)&cgen_var_383, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5448 | } |
| 5449 | uint32_t packetSize_vkCreateSampler = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 5450 | countingStream->rewind(); |
| 5451 | uint32_t opcode_vkCreateSampler = OP_vkCreateSampler; |
| 5452 | stream->write(&opcode_vkCreateSampler, sizeof(uint32_t)); |
| 5453 | stream->write(&packetSize_vkCreateSampler, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5454 | uint64_t cgen_var_384; |
| 5455 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_384, 1); |
| 5456 | stream->write((uint64_t*)&cgen_var_384, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5457 | marshal_VkSamplerCreateInfo(stream, (VkSamplerCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 5458 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5459 | uint64_t cgen_var_385 = (uint64_t)(uintptr_t)local_pAllocator; |
| 5460 | stream->putBe64(cgen_var_385); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5461 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5462 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5463 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5464 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5465 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5466 | uint64_t cgen_var_386; |
| 5467 | stream->handleMapping()->mapHandles_VkSampler_u64(pSampler, &cgen_var_386, 1); |
| 5468 | stream->write((uint64_t*)&cgen_var_386, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5469 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 5470 | AEMU_SCOPED_TRACE("vkCreateSampler readParams"); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5471 | stream->setHandleMapping(resources->createMapping()); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5472 | uint64_t cgen_var_387; |
| 5473 | stream->read((uint64_t*)&cgen_var_387, 8); |
| 5474 | stream->handleMapping()->mapHandles_u64_VkSampler(&cgen_var_387, (VkSampler*)pSampler, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5475 | stream->unsetHandleMapping(); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 5476 | AEMU_SCOPED_TRACE("vkCreateSampler returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5477 | VkResult vkCreateSampler_VkResult_return = (VkResult)0; |
| 5478 | stream->read(&vkCreateSampler_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5479 | countingStream->clearPool(); |
| 5480 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5481 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 5482 | mImpl->log("finish vkCreateSampler");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5483 | return vkCreateSampler_VkResult_return; |
| 5484 | } |
| 5485 | |
| 5486 | void VkEncoder::vkDestroySampler( |
| 5487 | VkDevice device, |
| 5488 | VkSampler sampler, |
| 5489 | const VkAllocationCallbacks* pAllocator) |
| 5490 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 5491 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 5492 | AEMU_SCOPED_TRACE("vkDestroySampler encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 5493 | mImpl->log("start vkDestroySampler"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5494 | auto stream = mImpl->stream(); |
| 5495 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5496 | auto resources = mImpl->resources(); |
| 5497 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5498 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5499 | VkDevice local_device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 5500 | VkSampler local_sampler; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5501 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 5502 | local_device = device; |
| 5503 | local_sampler = sampler; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5504 | local_pAllocator = nullptr; |
| 5505 | if (pAllocator) |
| 5506 | { |
| 5507 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 5508 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 5509 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 5510 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5511 | if (local_pAllocator) |
| 5512 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 5513 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5514 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5515 | countingStream->rewind(); |
| 5516 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5517 | uint64_t cgen_var_388; |
| 5518 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_388, 1); |
| 5519 | countingStream->write((uint64_t*)&cgen_var_388, 1 * 8); |
| 5520 | uint64_t cgen_var_389; |
| 5521 | countingStream->handleMapping()->mapHandles_VkSampler_u64(&local_sampler, &cgen_var_389, 1); |
| 5522 | countingStream->write((uint64_t*)&cgen_var_389, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 5523 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5524 | uint64_t cgen_var_390 = (uint64_t)(uintptr_t)local_pAllocator; |
| 5525 | countingStream->putBe64(cgen_var_390); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5526 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5527 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5528 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5529 | } |
| 5530 | } |
| 5531 | uint32_t packetSize_vkDestroySampler = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 5532 | countingStream->rewind(); |
| 5533 | uint32_t opcode_vkDestroySampler = OP_vkDestroySampler; |
| 5534 | stream->write(&opcode_vkDestroySampler, sizeof(uint32_t)); |
| 5535 | stream->write(&packetSize_vkDestroySampler, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5536 | uint64_t cgen_var_391; |
| 5537 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_391, 1); |
| 5538 | stream->write((uint64_t*)&cgen_var_391, 1 * 8); |
| 5539 | uint64_t cgen_var_392; |
| 5540 | stream->handleMapping()->mapHandles_VkSampler_u64(&local_sampler, &cgen_var_392, 1); |
| 5541 | stream->write((uint64_t*)&cgen_var_392, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 5542 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5543 | uint64_t cgen_var_393 = (uint64_t)(uintptr_t)local_pAllocator; |
| 5544 | stream->putBe64(cgen_var_393); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5545 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5546 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5547 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5548 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 5549 | AEMU_SCOPED_TRACE("vkDestroySampler readParams"); |
| 5550 | AEMU_SCOPED_TRACE("vkDestroySampler returnUnmarshal"); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5551 | resources->destroyMapping()->mapHandles_VkSampler((VkSampler*)&sampler); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 5552 | mImpl->log("finish vkDestroySampler");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5553 | } |
| 5554 | |
| 5555 | VkResult VkEncoder::vkCreateDescriptorSetLayout( |
| 5556 | VkDevice device, |
| 5557 | const VkDescriptorSetLayoutCreateInfo* pCreateInfo, |
| 5558 | const VkAllocationCallbacks* pAllocator, |
| 5559 | VkDescriptorSetLayout* pSetLayout) |
| 5560 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 5561 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 5562 | AEMU_SCOPED_TRACE("vkCreateDescriptorSetLayout encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 5563 | mImpl->log("start vkCreateDescriptorSetLayout"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5564 | auto stream = mImpl->stream(); |
| 5565 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5566 | auto resources = mImpl->resources(); |
| 5567 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5568 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5569 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5570 | VkDescriptorSetLayoutCreateInfo* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 5571 | VkAllocationCallbacks* local_pAllocator; |
| 5572 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5573 | local_pCreateInfo = nullptr; |
| 5574 | if (pCreateInfo) |
| 5575 | { |
| 5576 | local_pCreateInfo = (VkDescriptorSetLayoutCreateInfo*)pool->alloc(sizeof(const VkDescriptorSetLayoutCreateInfo)); |
| 5577 | deepcopy_VkDescriptorSetLayoutCreateInfo(pool, pCreateInfo, (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo)); |
| 5578 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5579 | local_pAllocator = nullptr; |
| 5580 | if (pAllocator) |
| 5581 | { |
| 5582 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 5583 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 5584 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 5585 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5586 | if (local_pCreateInfo) |
| 5587 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 5588 | transform_tohost_VkDescriptorSetLayoutCreateInfo(mImpl->resources(), (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5589 | } |
| 5590 | if (local_pAllocator) |
| 5591 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 5592 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5593 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5594 | countingStream->rewind(); |
| 5595 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5596 | uint64_t cgen_var_394; |
| 5597 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_394, 1); |
| 5598 | countingStream->write((uint64_t*)&cgen_var_394, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5599 | marshal_VkDescriptorSetLayoutCreateInfo(countingStream, (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 5600 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5601 | uint64_t cgen_var_395 = (uint64_t)(uintptr_t)local_pAllocator; |
| 5602 | countingStream->putBe64(cgen_var_395); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5603 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5604 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5605 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5606 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5607 | uint64_t cgen_var_396; |
| 5608 | countingStream->handleMapping()->mapHandles_VkDescriptorSetLayout_u64(pSetLayout, &cgen_var_396, 1); |
| 5609 | countingStream->write((uint64_t*)&cgen_var_396, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5610 | } |
| 5611 | uint32_t packetSize_vkCreateDescriptorSetLayout = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 5612 | countingStream->rewind(); |
| 5613 | uint32_t opcode_vkCreateDescriptorSetLayout = OP_vkCreateDescriptorSetLayout; |
| 5614 | stream->write(&opcode_vkCreateDescriptorSetLayout, sizeof(uint32_t)); |
| 5615 | stream->write(&packetSize_vkCreateDescriptorSetLayout, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5616 | uint64_t cgen_var_397; |
| 5617 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_397, 1); |
| 5618 | stream->write((uint64_t*)&cgen_var_397, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5619 | marshal_VkDescriptorSetLayoutCreateInfo(stream, (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 5620 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5621 | uint64_t cgen_var_398 = (uint64_t)(uintptr_t)local_pAllocator; |
| 5622 | stream->putBe64(cgen_var_398); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5623 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5624 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5625 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5626 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5627 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5628 | uint64_t cgen_var_399; |
| 5629 | stream->handleMapping()->mapHandles_VkDescriptorSetLayout_u64(pSetLayout, &cgen_var_399, 1); |
| 5630 | stream->write((uint64_t*)&cgen_var_399, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5631 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 5632 | AEMU_SCOPED_TRACE("vkCreateDescriptorSetLayout readParams"); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5633 | stream->setHandleMapping(resources->createMapping()); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5634 | uint64_t cgen_var_400; |
| 5635 | stream->read((uint64_t*)&cgen_var_400, 8); |
| 5636 | stream->handleMapping()->mapHandles_u64_VkDescriptorSetLayout(&cgen_var_400, (VkDescriptorSetLayout*)pSetLayout, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5637 | stream->unsetHandleMapping(); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 5638 | AEMU_SCOPED_TRACE("vkCreateDescriptorSetLayout returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5639 | VkResult vkCreateDescriptorSetLayout_VkResult_return = (VkResult)0; |
| 5640 | stream->read(&vkCreateDescriptorSetLayout_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5641 | countingStream->clearPool(); |
| 5642 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5643 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 5644 | mImpl->log("finish vkCreateDescriptorSetLayout");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5645 | return vkCreateDescriptorSetLayout_VkResult_return; |
| 5646 | } |
| 5647 | |
| 5648 | void VkEncoder::vkDestroyDescriptorSetLayout( |
| 5649 | VkDevice device, |
| 5650 | VkDescriptorSetLayout descriptorSetLayout, |
| 5651 | const VkAllocationCallbacks* pAllocator) |
| 5652 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 5653 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 5654 | AEMU_SCOPED_TRACE("vkDestroyDescriptorSetLayout encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 5655 | mImpl->log("start vkDestroyDescriptorSetLayout"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5656 | auto stream = mImpl->stream(); |
| 5657 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5658 | auto resources = mImpl->resources(); |
| 5659 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5660 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5661 | VkDevice local_device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 5662 | VkDescriptorSetLayout local_descriptorSetLayout; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5663 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 5664 | local_device = device; |
| 5665 | local_descriptorSetLayout = descriptorSetLayout; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5666 | local_pAllocator = nullptr; |
| 5667 | if (pAllocator) |
| 5668 | { |
| 5669 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 5670 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 5671 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 5672 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5673 | if (local_pAllocator) |
| 5674 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 5675 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5676 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5677 | countingStream->rewind(); |
| 5678 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5679 | uint64_t cgen_var_401; |
| 5680 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_401, 1); |
| 5681 | countingStream->write((uint64_t*)&cgen_var_401, 1 * 8); |
| 5682 | uint64_t cgen_var_402; |
| 5683 | countingStream->handleMapping()->mapHandles_VkDescriptorSetLayout_u64(&local_descriptorSetLayout, &cgen_var_402, 1); |
| 5684 | countingStream->write((uint64_t*)&cgen_var_402, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 5685 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5686 | uint64_t cgen_var_403 = (uint64_t)(uintptr_t)local_pAllocator; |
| 5687 | countingStream->putBe64(cgen_var_403); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5688 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5689 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5690 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5691 | } |
| 5692 | } |
| 5693 | uint32_t packetSize_vkDestroyDescriptorSetLayout = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 5694 | countingStream->rewind(); |
| 5695 | uint32_t opcode_vkDestroyDescriptorSetLayout = OP_vkDestroyDescriptorSetLayout; |
| 5696 | stream->write(&opcode_vkDestroyDescriptorSetLayout, sizeof(uint32_t)); |
| 5697 | stream->write(&packetSize_vkDestroyDescriptorSetLayout, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5698 | uint64_t cgen_var_404; |
| 5699 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_404, 1); |
| 5700 | stream->write((uint64_t*)&cgen_var_404, 1 * 8); |
| 5701 | uint64_t cgen_var_405; |
| 5702 | stream->handleMapping()->mapHandles_VkDescriptorSetLayout_u64(&local_descriptorSetLayout, &cgen_var_405, 1); |
| 5703 | stream->write((uint64_t*)&cgen_var_405, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 5704 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5705 | uint64_t cgen_var_406 = (uint64_t)(uintptr_t)local_pAllocator; |
| 5706 | stream->putBe64(cgen_var_406); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5707 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5708 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5709 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5710 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 5711 | AEMU_SCOPED_TRACE("vkDestroyDescriptorSetLayout readParams"); |
| 5712 | AEMU_SCOPED_TRACE("vkDestroyDescriptorSetLayout returnUnmarshal"); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5713 | resources->destroyMapping()->mapHandles_VkDescriptorSetLayout((VkDescriptorSetLayout*)&descriptorSetLayout); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 5714 | mImpl->log("finish vkDestroyDescriptorSetLayout");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5715 | } |
| 5716 | |
| 5717 | VkResult VkEncoder::vkCreateDescriptorPool( |
| 5718 | VkDevice device, |
| 5719 | const VkDescriptorPoolCreateInfo* pCreateInfo, |
| 5720 | const VkAllocationCallbacks* pAllocator, |
| 5721 | VkDescriptorPool* pDescriptorPool) |
| 5722 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 5723 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 5724 | AEMU_SCOPED_TRACE("vkCreateDescriptorPool encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 5725 | mImpl->log("start vkCreateDescriptorPool"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5726 | auto stream = mImpl->stream(); |
| 5727 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5728 | auto resources = mImpl->resources(); |
| 5729 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5730 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5731 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5732 | VkDescriptorPoolCreateInfo* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 5733 | VkAllocationCallbacks* local_pAllocator; |
| 5734 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5735 | local_pCreateInfo = nullptr; |
| 5736 | if (pCreateInfo) |
| 5737 | { |
| 5738 | local_pCreateInfo = (VkDescriptorPoolCreateInfo*)pool->alloc(sizeof(const VkDescriptorPoolCreateInfo)); |
| 5739 | deepcopy_VkDescriptorPoolCreateInfo(pool, pCreateInfo, (VkDescriptorPoolCreateInfo*)(local_pCreateInfo)); |
| 5740 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5741 | local_pAllocator = nullptr; |
| 5742 | if (pAllocator) |
| 5743 | { |
| 5744 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 5745 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 5746 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 5747 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5748 | if (local_pCreateInfo) |
| 5749 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 5750 | transform_tohost_VkDescriptorPoolCreateInfo(mImpl->resources(), (VkDescriptorPoolCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5751 | } |
| 5752 | if (local_pAllocator) |
| 5753 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 5754 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5755 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5756 | countingStream->rewind(); |
| 5757 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5758 | uint64_t cgen_var_407; |
| 5759 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_407, 1); |
| 5760 | countingStream->write((uint64_t*)&cgen_var_407, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5761 | marshal_VkDescriptorPoolCreateInfo(countingStream, (VkDescriptorPoolCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 5762 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5763 | uint64_t cgen_var_408 = (uint64_t)(uintptr_t)local_pAllocator; |
| 5764 | countingStream->putBe64(cgen_var_408); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5765 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5766 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5767 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5768 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5769 | uint64_t cgen_var_409; |
| 5770 | countingStream->handleMapping()->mapHandles_VkDescriptorPool_u64(pDescriptorPool, &cgen_var_409, 1); |
| 5771 | countingStream->write((uint64_t*)&cgen_var_409, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5772 | } |
| 5773 | uint32_t packetSize_vkCreateDescriptorPool = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 5774 | countingStream->rewind(); |
| 5775 | uint32_t opcode_vkCreateDescriptorPool = OP_vkCreateDescriptorPool; |
| 5776 | stream->write(&opcode_vkCreateDescriptorPool, sizeof(uint32_t)); |
| 5777 | stream->write(&packetSize_vkCreateDescriptorPool, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5778 | uint64_t cgen_var_410; |
| 5779 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_410, 1); |
| 5780 | stream->write((uint64_t*)&cgen_var_410, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5781 | marshal_VkDescriptorPoolCreateInfo(stream, (VkDescriptorPoolCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 5782 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5783 | uint64_t cgen_var_411 = (uint64_t)(uintptr_t)local_pAllocator; |
| 5784 | stream->putBe64(cgen_var_411); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5785 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5786 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5787 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5788 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5789 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5790 | uint64_t cgen_var_412; |
| 5791 | stream->handleMapping()->mapHandles_VkDescriptorPool_u64(pDescriptorPool, &cgen_var_412, 1); |
| 5792 | stream->write((uint64_t*)&cgen_var_412, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5793 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 5794 | AEMU_SCOPED_TRACE("vkCreateDescriptorPool readParams"); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5795 | stream->setHandleMapping(resources->createMapping()); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5796 | uint64_t cgen_var_413; |
| 5797 | stream->read((uint64_t*)&cgen_var_413, 8); |
| 5798 | stream->handleMapping()->mapHandles_u64_VkDescriptorPool(&cgen_var_413, (VkDescriptorPool*)pDescriptorPool, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5799 | stream->unsetHandleMapping(); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 5800 | AEMU_SCOPED_TRACE("vkCreateDescriptorPool returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5801 | VkResult vkCreateDescriptorPool_VkResult_return = (VkResult)0; |
| 5802 | stream->read(&vkCreateDescriptorPool_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5803 | countingStream->clearPool(); |
| 5804 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5805 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 5806 | mImpl->log("finish vkCreateDescriptorPool");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5807 | return vkCreateDescriptorPool_VkResult_return; |
| 5808 | } |
| 5809 | |
| 5810 | void VkEncoder::vkDestroyDescriptorPool( |
| 5811 | VkDevice device, |
| 5812 | VkDescriptorPool descriptorPool, |
| 5813 | const VkAllocationCallbacks* pAllocator) |
| 5814 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 5815 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 5816 | AEMU_SCOPED_TRACE("vkDestroyDescriptorPool encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 5817 | mImpl->log("start vkDestroyDescriptorPool"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5818 | auto stream = mImpl->stream(); |
| 5819 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5820 | auto resources = mImpl->resources(); |
| 5821 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5822 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5823 | VkDevice local_device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 5824 | VkDescriptorPool local_descriptorPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5825 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 5826 | local_device = device; |
| 5827 | local_descriptorPool = descriptorPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5828 | local_pAllocator = nullptr; |
| 5829 | if (pAllocator) |
| 5830 | { |
| 5831 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 5832 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 5833 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 5834 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5835 | if (local_pAllocator) |
| 5836 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 5837 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5838 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5839 | countingStream->rewind(); |
| 5840 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5841 | uint64_t cgen_var_414; |
| 5842 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_414, 1); |
| 5843 | countingStream->write((uint64_t*)&cgen_var_414, 1 * 8); |
| 5844 | uint64_t cgen_var_415; |
| 5845 | countingStream->handleMapping()->mapHandles_VkDescriptorPool_u64(&local_descriptorPool, &cgen_var_415, 1); |
| 5846 | countingStream->write((uint64_t*)&cgen_var_415, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 5847 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5848 | uint64_t cgen_var_416 = (uint64_t)(uintptr_t)local_pAllocator; |
| 5849 | countingStream->putBe64(cgen_var_416); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5850 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5851 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5852 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5853 | } |
| 5854 | } |
| 5855 | uint32_t packetSize_vkDestroyDescriptorPool = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 5856 | countingStream->rewind(); |
| 5857 | uint32_t opcode_vkDestroyDescriptorPool = OP_vkDestroyDescriptorPool; |
| 5858 | stream->write(&opcode_vkDestroyDescriptorPool, sizeof(uint32_t)); |
| 5859 | stream->write(&packetSize_vkDestroyDescriptorPool, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5860 | uint64_t cgen_var_417; |
| 5861 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_417, 1); |
| 5862 | stream->write((uint64_t*)&cgen_var_417, 1 * 8); |
| 5863 | uint64_t cgen_var_418; |
| 5864 | stream->handleMapping()->mapHandles_VkDescriptorPool_u64(&local_descriptorPool, &cgen_var_418, 1); |
| 5865 | stream->write((uint64_t*)&cgen_var_418, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 5866 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5867 | uint64_t cgen_var_419 = (uint64_t)(uintptr_t)local_pAllocator; |
| 5868 | stream->putBe64(cgen_var_419); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5869 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5870 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5871 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5872 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 5873 | AEMU_SCOPED_TRACE("vkDestroyDescriptorPool readParams"); |
| 5874 | AEMU_SCOPED_TRACE("vkDestroyDescriptorPool returnUnmarshal"); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5875 | resources->destroyMapping()->mapHandles_VkDescriptorPool((VkDescriptorPool*)&descriptorPool); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 5876 | mImpl->log("finish vkDestroyDescriptorPool");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5877 | } |
| 5878 | |
| 5879 | VkResult VkEncoder::vkResetDescriptorPool( |
| 5880 | VkDevice device, |
| 5881 | VkDescriptorPool descriptorPool, |
| 5882 | VkDescriptorPoolResetFlags flags) |
| 5883 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 5884 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 5885 | AEMU_SCOPED_TRACE("vkResetDescriptorPool encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 5886 | mImpl->log("start vkResetDescriptorPool"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5887 | auto stream = mImpl->stream(); |
| 5888 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5889 | auto resources = mImpl->resources(); |
| 5890 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5891 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5892 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5893 | VkDescriptorPool local_descriptorPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5894 | VkDescriptorPoolResetFlags local_flags; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 5895 | local_device = device; |
| 5896 | local_descriptorPool = descriptorPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5897 | local_flags = flags; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5898 | countingStream->rewind(); |
| 5899 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5900 | uint64_t cgen_var_420; |
| 5901 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_420, 1); |
| 5902 | countingStream->write((uint64_t*)&cgen_var_420, 1 * 8); |
| 5903 | uint64_t cgen_var_421; |
| 5904 | countingStream->handleMapping()->mapHandles_VkDescriptorPool_u64(&local_descriptorPool, &cgen_var_421, 1); |
| 5905 | countingStream->write((uint64_t*)&cgen_var_421, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5906 | countingStream->write((VkDescriptorPoolResetFlags*)&local_flags, sizeof(VkDescriptorPoolResetFlags)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5907 | } |
| 5908 | uint32_t packetSize_vkResetDescriptorPool = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 5909 | countingStream->rewind(); |
| 5910 | uint32_t opcode_vkResetDescriptorPool = OP_vkResetDescriptorPool; |
| 5911 | stream->write(&opcode_vkResetDescriptorPool, sizeof(uint32_t)); |
| 5912 | stream->write(&packetSize_vkResetDescriptorPool, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5913 | uint64_t cgen_var_422; |
| 5914 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_422, 1); |
| 5915 | stream->write((uint64_t*)&cgen_var_422, 1 * 8); |
| 5916 | uint64_t cgen_var_423; |
| 5917 | stream->handleMapping()->mapHandles_VkDescriptorPool_u64(&local_descriptorPool, &cgen_var_423, 1); |
| 5918 | stream->write((uint64_t*)&cgen_var_423, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5919 | stream->write((VkDescriptorPoolResetFlags*)&local_flags, sizeof(VkDescriptorPoolResetFlags)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 5920 | AEMU_SCOPED_TRACE("vkResetDescriptorPool readParams"); |
| 5921 | AEMU_SCOPED_TRACE("vkResetDescriptorPool returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5922 | VkResult vkResetDescriptorPool_VkResult_return = (VkResult)0; |
| 5923 | stream->read(&vkResetDescriptorPool_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5924 | countingStream->clearPool(); |
| 5925 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5926 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 5927 | mImpl->log("finish vkResetDescriptorPool");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5928 | return vkResetDescriptorPool_VkResult_return; |
| 5929 | } |
| 5930 | |
| 5931 | VkResult VkEncoder::vkAllocateDescriptorSets( |
| 5932 | VkDevice device, |
| 5933 | const VkDescriptorSetAllocateInfo* pAllocateInfo, |
| 5934 | VkDescriptorSet* pDescriptorSets) |
| 5935 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 5936 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 5937 | AEMU_SCOPED_TRACE("vkAllocateDescriptorSets encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 5938 | mImpl->log("start vkAllocateDescriptorSets"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5939 | auto stream = mImpl->stream(); |
| 5940 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5941 | auto resources = mImpl->resources(); |
| 5942 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5943 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5944 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5945 | VkDescriptorSetAllocateInfo* local_pAllocateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 5946 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5947 | local_pAllocateInfo = nullptr; |
| 5948 | if (pAllocateInfo) |
| 5949 | { |
| 5950 | local_pAllocateInfo = (VkDescriptorSetAllocateInfo*)pool->alloc(sizeof(const VkDescriptorSetAllocateInfo)); |
| 5951 | deepcopy_VkDescriptorSetAllocateInfo(pool, pAllocateInfo, (VkDescriptorSetAllocateInfo*)(local_pAllocateInfo)); |
| 5952 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5953 | if (local_pAllocateInfo) |
| 5954 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 5955 | transform_tohost_VkDescriptorSetAllocateInfo(mImpl->resources(), (VkDescriptorSetAllocateInfo*)(local_pAllocateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5956 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5957 | countingStream->rewind(); |
| 5958 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5959 | uint64_t cgen_var_424; |
| 5960 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_424, 1); |
| 5961 | countingStream->write((uint64_t*)&cgen_var_424, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5962 | marshal_VkDescriptorSetAllocateInfo(countingStream, (VkDescriptorSetAllocateInfo*)(local_pAllocateInfo)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5963 | if (pAllocateInfo->descriptorSetCount) |
| 5964 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5965 | uint64_t* cgen_var_425; |
| 5966 | countingStream->alloc((void**)&cgen_var_425, pAllocateInfo->descriptorSetCount * 8); |
| 5967 | countingStream->handleMapping()->mapHandles_VkDescriptorSet_u64(pDescriptorSets, cgen_var_425, pAllocateInfo->descriptorSetCount); |
| 5968 | countingStream->write((uint64_t*)cgen_var_425, pAllocateInfo->descriptorSetCount * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5969 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5970 | } |
| 5971 | uint32_t packetSize_vkAllocateDescriptorSets = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 5972 | countingStream->rewind(); |
| 5973 | uint32_t opcode_vkAllocateDescriptorSets = OP_vkAllocateDescriptorSets; |
| 5974 | stream->write(&opcode_vkAllocateDescriptorSets, sizeof(uint32_t)); |
| 5975 | stream->write(&packetSize_vkAllocateDescriptorSets, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5976 | uint64_t cgen_var_426; |
| 5977 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_426, 1); |
| 5978 | stream->write((uint64_t*)&cgen_var_426, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5979 | marshal_VkDescriptorSetAllocateInfo(stream, (VkDescriptorSetAllocateInfo*)(local_pAllocateInfo)); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5980 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5981 | if (pAllocateInfo->descriptorSetCount) |
| 5982 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5983 | uint64_t* cgen_var_427; |
| 5984 | stream->alloc((void**)&cgen_var_427, pAllocateInfo->descriptorSetCount * 8); |
| 5985 | stream->handleMapping()->mapHandles_VkDescriptorSet_u64(pDescriptorSets, cgen_var_427, pAllocateInfo->descriptorSetCount); |
| 5986 | stream->write((uint64_t*)cgen_var_427, pAllocateInfo->descriptorSetCount * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5987 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5988 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 5989 | AEMU_SCOPED_TRACE("vkAllocateDescriptorSets readParams"); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5990 | stream->setHandleMapping(resources->createMapping()); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5991 | if (pAllocateInfo->descriptorSetCount) |
| 5992 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5993 | uint64_t* cgen_var_428; |
| 5994 | stream->alloc((void**)&cgen_var_428, pAllocateInfo->descriptorSetCount * 8); |
| 5995 | stream->read((uint64_t*)cgen_var_428, pAllocateInfo->descriptorSetCount * 8); |
| 5996 | stream->handleMapping()->mapHandles_u64_VkDescriptorSet(cgen_var_428, (VkDescriptorSet*)pDescriptorSets, pAllocateInfo->descriptorSetCount); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5997 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5998 | stream->unsetHandleMapping(); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 5999 | AEMU_SCOPED_TRACE("vkAllocateDescriptorSets returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6000 | VkResult vkAllocateDescriptorSets_VkResult_return = (VkResult)0; |
| 6001 | stream->read(&vkAllocateDescriptorSets_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6002 | countingStream->clearPool(); |
| 6003 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6004 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6005 | mImpl->log("finish vkAllocateDescriptorSets");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6006 | return vkAllocateDescriptorSets_VkResult_return; |
| 6007 | } |
| 6008 | |
| 6009 | VkResult VkEncoder::vkFreeDescriptorSets( |
| 6010 | VkDevice device, |
| 6011 | VkDescriptorPool descriptorPool, |
| 6012 | uint32_t descriptorSetCount, |
| 6013 | const VkDescriptorSet* pDescriptorSets) |
| 6014 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 6015 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 6016 | AEMU_SCOPED_TRACE("vkFreeDescriptorSets encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6017 | mImpl->log("start vkFreeDescriptorSets"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6018 | auto stream = mImpl->stream(); |
| 6019 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6020 | auto resources = mImpl->resources(); |
| 6021 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6022 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6023 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6024 | VkDescriptorPool local_descriptorPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6025 | uint32_t local_descriptorSetCount; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 6026 | VkDescriptorSet* local_pDescriptorSets; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 6027 | local_device = device; |
| 6028 | local_descriptorPool = descriptorPool; |
| 6029 | local_descriptorSetCount = descriptorSetCount; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 6030 | local_pDescriptorSets = nullptr; |
| 6031 | if (pDescriptorSets) |
| 6032 | { |
| 6033 | local_pDescriptorSets = (VkDescriptorSet*)pool->dupArray(pDescriptorSets, ((descriptorSetCount)) * sizeof(const VkDescriptorSet)); |
| 6034 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6035 | countingStream->rewind(); |
| 6036 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6037 | uint64_t cgen_var_429; |
| 6038 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_429, 1); |
| 6039 | countingStream->write((uint64_t*)&cgen_var_429, 1 * 8); |
| 6040 | uint64_t cgen_var_430; |
| 6041 | countingStream->handleMapping()->mapHandles_VkDescriptorPool_u64(&local_descriptorPool, &cgen_var_430, 1); |
| 6042 | countingStream->write((uint64_t*)&cgen_var_430, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6043 | countingStream->write((uint32_t*)&local_descriptorSetCount, sizeof(uint32_t)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 6044 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6045 | uint64_t cgen_var_431 = (uint64_t)(uintptr_t)local_pDescriptorSets; |
| 6046 | countingStream->putBe64(cgen_var_431); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 6047 | if (local_pDescriptorSets) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6048 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6049 | if (((descriptorSetCount))) |
| 6050 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6051 | uint64_t* cgen_var_432; |
| 6052 | countingStream->alloc((void**)&cgen_var_432, ((descriptorSetCount)) * 8); |
| 6053 | countingStream->handleMapping()->mapHandles_VkDescriptorSet_u64(local_pDescriptorSets, cgen_var_432, ((descriptorSetCount))); |
| 6054 | countingStream->write((uint64_t*)cgen_var_432, ((descriptorSetCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6055 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6056 | } |
| 6057 | } |
| 6058 | uint32_t packetSize_vkFreeDescriptorSets = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 6059 | countingStream->rewind(); |
| 6060 | uint32_t opcode_vkFreeDescriptorSets = OP_vkFreeDescriptorSets; |
| 6061 | stream->write(&opcode_vkFreeDescriptorSets, sizeof(uint32_t)); |
| 6062 | stream->write(&packetSize_vkFreeDescriptorSets, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6063 | uint64_t cgen_var_433; |
| 6064 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_433, 1); |
| 6065 | stream->write((uint64_t*)&cgen_var_433, 1 * 8); |
| 6066 | uint64_t cgen_var_434; |
| 6067 | stream->handleMapping()->mapHandles_VkDescriptorPool_u64(&local_descriptorPool, &cgen_var_434, 1); |
| 6068 | stream->write((uint64_t*)&cgen_var_434, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6069 | stream->write((uint32_t*)&local_descriptorSetCount, sizeof(uint32_t)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 6070 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6071 | uint64_t cgen_var_435 = (uint64_t)(uintptr_t)local_pDescriptorSets; |
| 6072 | stream->putBe64(cgen_var_435); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 6073 | if (local_pDescriptorSets) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6074 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6075 | if (((descriptorSetCount))) |
| 6076 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6077 | uint64_t* cgen_var_436; |
| 6078 | stream->alloc((void**)&cgen_var_436, ((descriptorSetCount)) * 8); |
| 6079 | stream->handleMapping()->mapHandles_VkDescriptorSet_u64(local_pDescriptorSets, cgen_var_436, ((descriptorSetCount))); |
| 6080 | stream->write((uint64_t*)cgen_var_436, ((descriptorSetCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6081 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6082 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 6083 | AEMU_SCOPED_TRACE("vkFreeDescriptorSets readParams"); |
| 6084 | AEMU_SCOPED_TRACE("vkFreeDescriptorSets returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6085 | VkResult vkFreeDescriptorSets_VkResult_return = (VkResult)0; |
| 6086 | stream->read(&vkFreeDescriptorSets_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6087 | countingStream->clearPool(); |
| 6088 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6089 | pool->freeAll(); |
| Lingfeng Yang | 6ab1b0d | 2018-11-27 23:36:03 -0800 | [diff] [blame] | 6090 | if (pDescriptorSets) |
| 6091 | { |
| 6092 | resources->destroyMapping()->mapHandles_VkDescriptorSet((VkDescriptorSet*)pDescriptorSets, ((descriptorSetCount))); |
| 6093 | } |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6094 | mImpl->log("finish vkFreeDescriptorSets");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6095 | return vkFreeDescriptorSets_VkResult_return; |
| 6096 | } |
| 6097 | |
| 6098 | void VkEncoder::vkUpdateDescriptorSets( |
| 6099 | VkDevice device, |
| 6100 | uint32_t descriptorWriteCount, |
| 6101 | const VkWriteDescriptorSet* pDescriptorWrites, |
| 6102 | uint32_t descriptorCopyCount, |
| 6103 | const VkCopyDescriptorSet* pDescriptorCopies) |
| 6104 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 6105 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 6106 | AEMU_SCOPED_TRACE("vkUpdateDescriptorSets encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6107 | mImpl->log("start vkUpdateDescriptorSets"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6108 | auto stream = mImpl->stream(); |
| 6109 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6110 | auto resources = mImpl->resources(); |
| 6111 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6112 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6113 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6114 | uint32_t local_descriptorWriteCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6115 | VkWriteDescriptorSet* local_pDescriptorWrites; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 6116 | uint32_t local_descriptorCopyCount; |
| 6117 | VkCopyDescriptorSet* local_pDescriptorCopies; |
| 6118 | local_device = device; |
| 6119 | local_descriptorWriteCount = descriptorWriteCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6120 | local_pDescriptorWrites = nullptr; |
| 6121 | if (pDescriptorWrites) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6122 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6123 | local_pDescriptorWrites = (VkWriteDescriptorSet*)pool->alloc(((descriptorWriteCount)) * sizeof(const VkWriteDescriptorSet)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6124 | for (uint32_t i = 0; i < (uint32_t)((descriptorWriteCount)); ++i) |
| 6125 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6126 | deepcopy_VkWriteDescriptorSet(pool, pDescriptorWrites + i, (VkWriteDescriptorSet*)(local_pDescriptorWrites + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6127 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6128 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6129 | local_descriptorCopyCount = descriptorCopyCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6130 | local_pDescriptorCopies = nullptr; |
| 6131 | if (pDescriptorCopies) |
| 6132 | { |
| 6133 | local_pDescriptorCopies = (VkCopyDescriptorSet*)pool->alloc(((descriptorCopyCount)) * sizeof(const VkCopyDescriptorSet)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6134 | for (uint32_t i = 0; i < (uint32_t)((descriptorCopyCount)); ++i) |
| 6135 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6136 | deepcopy_VkCopyDescriptorSet(pool, pDescriptorCopies + i, (VkCopyDescriptorSet*)(local_pDescriptorCopies + i)); |
| 6137 | } |
| 6138 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 6139 | if (local_pDescriptorWrites) |
| 6140 | { |
| 6141 | for (uint32_t i = 0; i < (uint32_t)((descriptorWriteCount)); ++i) |
| 6142 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 6143 | transform_tohost_VkWriteDescriptorSet(mImpl->resources(), (VkWriteDescriptorSet*)(local_pDescriptorWrites + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 6144 | } |
| 6145 | } |
| 6146 | if (local_pDescriptorCopies) |
| 6147 | { |
| 6148 | for (uint32_t i = 0; i < (uint32_t)((descriptorCopyCount)); ++i) |
| 6149 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 6150 | transform_tohost_VkCopyDescriptorSet(mImpl->resources(), (VkCopyDescriptorSet*)(local_pDescriptorCopies + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 6151 | } |
| 6152 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6153 | countingStream->rewind(); |
| 6154 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6155 | uint64_t cgen_var_437; |
| 6156 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_437, 1); |
| 6157 | countingStream->write((uint64_t*)&cgen_var_437, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6158 | countingStream->write((uint32_t*)&local_descriptorWriteCount, sizeof(uint32_t)); |
| 6159 | for (uint32_t i = 0; i < (uint32_t)((descriptorWriteCount)); ++i) |
| 6160 | { |
| 6161 | marshal_VkWriteDescriptorSet(countingStream, (VkWriteDescriptorSet*)(local_pDescriptorWrites + i)); |
| 6162 | } |
| 6163 | countingStream->write((uint32_t*)&local_descriptorCopyCount, sizeof(uint32_t)); |
| 6164 | for (uint32_t i = 0; i < (uint32_t)((descriptorCopyCount)); ++i) |
| 6165 | { |
| 6166 | marshal_VkCopyDescriptorSet(countingStream, (VkCopyDescriptorSet*)(local_pDescriptorCopies + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6167 | } |
| 6168 | } |
| 6169 | uint32_t packetSize_vkUpdateDescriptorSets = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 6170 | countingStream->rewind(); |
| 6171 | uint32_t opcode_vkUpdateDescriptorSets = OP_vkUpdateDescriptorSets; |
| 6172 | stream->write(&opcode_vkUpdateDescriptorSets, sizeof(uint32_t)); |
| 6173 | stream->write(&packetSize_vkUpdateDescriptorSets, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6174 | uint64_t cgen_var_438; |
| 6175 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_438, 1); |
| 6176 | stream->write((uint64_t*)&cgen_var_438, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6177 | stream->write((uint32_t*)&local_descriptorWriteCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6178 | for (uint32_t i = 0; i < (uint32_t)((descriptorWriteCount)); ++i) |
| 6179 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6180 | marshal_VkWriteDescriptorSet(stream, (VkWriteDescriptorSet*)(local_pDescriptorWrites + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6181 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6182 | stream->write((uint32_t*)&local_descriptorCopyCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6183 | for (uint32_t i = 0; i < (uint32_t)((descriptorCopyCount)); ++i) |
| 6184 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6185 | marshal_VkCopyDescriptorSet(stream, (VkCopyDescriptorSet*)(local_pDescriptorCopies + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6186 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 6187 | AEMU_SCOPED_TRACE("vkUpdateDescriptorSets readParams"); |
| 6188 | AEMU_SCOPED_TRACE("vkUpdateDescriptorSets returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6189 | mImpl->log("finish vkUpdateDescriptorSets");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6190 | } |
| 6191 | |
| 6192 | VkResult VkEncoder::vkCreateFramebuffer( |
| 6193 | VkDevice device, |
| 6194 | const VkFramebufferCreateInfo* pCreateInfo, |
| 6195 | const VkAllocationCallbacks* pAllocator, |
| 6196 | VkFramebuffer* pFramebuffer) |
| 6197 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 6198 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 6199 | AEMU_SCOPED_TRACE("vkCreateFramebuffer encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6200 | mImpl->log("start vkCreateFramebuffer"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6201 | auto stream = mImpl->stream(); |
| 6202 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6203 | auto resources = mImpl->resources(); |
| 6204 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6205 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6206 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6207 | VkFramebufferCreateInfo* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 6208 | VkAllocationCallbacks* local_pAllocator; |
| 6209 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6210 | local_pCreateInfo = nullptr; |
| 6211 | if (pCreateInfo) |
| 6212 | { |
| 6213 | local_pCreateInfo = (VkFramebufferCreateInfo*)pool->alloc(sizeof(const VkFramebufferCreateInfo)); |
| 6214 | deepcopy_VkFramebufferCreateInfo(pool, pCreateInfo, (VkFramebufferCreateInfo*)(local_pCreateInfo)); |
| 6215 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6216 | local_pAllocator = nullptr; |
| 6217 | if (pAllocator) |
| 6218 | { |
| 6219 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 6220 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 6221 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 6222 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 6223 | if (local_pCreateInfo) |
| 6224 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 6225 | transform_tohost_VkFramebufferCreateInfo(mImpl->resources(), (VkFramebufferCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 6226 | } |
| 6227 | if (local_pAllocator) |
| 6228 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 6229 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 6230 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6231 | countingStream->rewind(); |
| 6232 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6233 | uint64_t cgen_var_439; |
| 6234 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_439, 1); |
| 6235 | countingStream->write((uint64_t*)&cgen_var_439, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6236 | marshal_VkFramebufferCreateInfo(countingStream, (VkFramebufferCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 6237 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6238 | uint64_t cgen_var_440 = (uint64_t)(uintptr_t)local_pAllocator; |
| 6239 | countingStream->putBe64(cgen_var_440); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6240 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6241 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6242 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6243 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6244 | uint64_t cgen_var_441; |
| 6245 | countingStream->handleMapping()->mapHandles_VkFramebuffer_u64(pFramebuffer, &cgen_var_441, 1); |
| 6246 | countingStream->write((uint64_t*)&cgen_var_441, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6247 | } |
| 6248 | uint32_t packetSize_vkCreateFramebuffer = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 6249 | countingStream->rewind(); |
| 6250 | uint32_t opcode_vkCreateFramebuffer = OP_vkCreateFramebuffer; |
| 6251 | stream->write(&opcode_vkCreateFramebuffer, sizeof(uint32_t)); |
| 6252 | stream->write(&packetSize_vkCreateFramebuffer, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6253 | uint64_t cgen_var_442; |
| 6254 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_442, 1); |
| 6255 | stream->write((uint64_t*)&cgen_var_442, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6256 | marshal_VkFramebufferCreateInfo(stream, (VkFramebufferCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 6257 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6258 | uint64_t cgen_var_443 = (uint64_t)(uintptr_t)local_pAllocator; |
| 6259 | stream->putBe64(cgen_var_443); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6260 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6261 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6262 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6263 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6264 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6265 | uint64_t cgen_var_444; |
| 6266 | stream->handleMapping()->mapHandles_VkFramebuffer_u64(pFramebuffer, &cgen_var_444, 1); |
| 6267 | stream->write((uint64_t*)&cgen_var_444, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6268 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 6269 | AEMU_SCOPED_TRACE("vkCreateFramebuffer readParams"); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6270 | stream->setHandleMapping(resources->createMapping()); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6271 | uint64_t cgen_var_445; |
| 6272 | stream->read((uint64_t*)&cgen_var_445, 8); |
| 6273 | stream->handleMapping()->mapHandles_u64_VkFramebuffer(&cgen_var_445, (VkFramebuffer*)pFramebuffer, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6274 | stream->unsetHandleMapping(); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 6275 | AEMU_SCOPED_TRACE("vkCreateFramebuffer returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6276 | VkResult vkCreateFramebuffer_VkResult_return = (VkResult)0; |
| 6277 | stream->read(&vkCreateFramebuffer_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6278 | countingStream->clearPool(); |
| 6279 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6280 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6281 | mImpl->log("finish vkCreateFramebuffer");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6282 | return vkCreateFramebuffer_VkResult_return; |
| 6283 | } |
| 6284 | |
| 6285 | void VkEncoder::vkDestroyFramebuffer( |
| 6286 | VkDevice device, |
| 6287 | VkFramebuffer framebuffer, |
| 6288 | const VkAllocationCallbacks* pAllocator) |
| 6289 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 6290 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 6291 | AEMU_SCOPED_TRACE("vkDestroyFramebuffer encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6292 | mImpl->log("start vkDestroyFramebuffer"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6293 | auto stream = mImpl->stream(); |
| 6294 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6295 | auto resources = mImpl->resources(); |
| 6296 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6297 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6298 | VkDevice local_device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 6299 | VkFramebuffer local_framebuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6300 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 6301 | local_device = device; |
| 6302 | local_framebuffer = framebuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6303 | local_pAllocator = nullptr; |
| 6304 | if (pAllocator) |
| 6305 | { |
| 6306 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 6307 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 6308 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 6309 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 6310 | if (local_pAllocator) |
| 6311 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 6312 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 6313 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6314 | countingStream->rewind(); |
| 6315 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6316 | uint64_t cgen_var_446; |
| 6317 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_446, 1); |
| 6318 | countingStream->write((uint64_t*)&cgen_var_446, 1 * 8); |
| 6319 | uint64_t cgen_var_447; |
| 6320 | countingStream->handleMapping()->mapHandles_VkFramebuffer_u64(&local_framebuffer, &cgen_var_447, 1); |
| 6321 | countingStream->write((uint64_t*)&cgen_var_447, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 6322 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6323 | uint64_t cgen_var_448 = (uint64_t)(uintptr_t)local_pAllocator; |
| 6324 | countingStream->putBe64(cgen_var_448); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6325 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6326 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6327 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6328 | } |
| 6329 | } |
| 6330 | uint32_t packetSize_vkDestroyFramebuffer = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 6331 | countingStream->rewind(); |
| 6332 | uint32_t opcode_vkDestroyFramebuffer = OP_vkDestroyFramebuffer; |
| 6333 | stream->write(&opcode_vkDestroyFramebuffer, sizeof(uint32_t)); |
| 6334 | stream->write(&packetSize_vkDestroyFramebuffer, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6335 | uint64_t cgen_var_449; |
| 6336 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_449, 1); |
| 6337 | stream->write((uint64_t*)&cgen_var_449, 1 * 8); |
| 6338 | uint64_t cgen_var_450; |
| 6339 | stream->handleMapping()->mapHandles_VkFramebuffer_u64(&local_framebuffer, &cgen_var_450, 1); |
| 6340 | stream->write((uint64_t*)&cgen_var_450, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 6341 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6342 | uint64_t cgen_var_451 = (uint64_t)(uintptr_t)local_pAllocator; |
| 6343 | stream->putBe64(cgen_var_451); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6344 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6345 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6346 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6347 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 6348 | AEMU_SCOPED_TRACE("vkDestroyFramebuffer readParams"); |
| 6349 | AEMU_SCOPED_TRACE("vkDestroyFramebuffer returnUnmarshal"); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6350 | resources->destroyMapping()->mapHandles_VkFramebuffer((VkFramebuffer*)&framebuffer); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6351 | mImpl->log("finish vkDestroyFramebuffer");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6352 | } |
| 6353 | |
| 6354 | VkResult VkEncoder::vkCreateRenderPass( |
| 6355 | VkDevice device, |
| 6356 | const VkRenderPassCreateInfo* pCreateInfo, |
| 6357 | const VkAllocationCallbacks* pAllocator, |
| 6358 | VkRenderPass* pRenderPass) |
| 6359 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 6360 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 6361 | AEMU_SCOPED_TRACE("vkCreateRenderPass encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6362 | mImpl->log("start vkCreateRenderPass"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6363 | auto stream = mImpl->stream(); |
| 6364 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6365 | auto resources = mImpl->resources(); |
| 6366 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6367 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6368 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6369 | VkRenderPassCreateInfo* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 6370 | VkAllocationCallbacks* local_pAllocator; |
| 6371 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6372 | local_pCreateInfo = nullptr; |
| 6373 | if (pCreateInfo) |
| 6374 | { |
| 6375 | local_pCreateInfo = (VkRenderPassCreateInfo*)pool->alloc(sizeof(const VkRenderPassCreateInfo)); |
| 6376 | deepcopy_VkRenderPassCreateInfo(pool, pCreateInfo, (VkRenderPassCreateInfo*)(local_pCreateInfo)); |
| 6377 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6378 | local_pAllocator = nullptr; |
| 6379 | if (pAllocator) |
| 6380 | { |
| 6381 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 6382 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 6383 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 6384 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 6385 | if (local_pCreateInfo) |
| 6386 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 6387 | transform_tohost_VkRenderPassCreateInfo(mImpl->resources(), (VkRenderPassCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 6388 | } |
| 6389 | if (local_pAllocator) |
| 6390 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 6391 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 6392 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6393 | countingStream->rewind(); |
| 6394 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6395 | uint64_t cgen_var_452; |
| 6396 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_452, 1); |
| 6397 | countingStream->write((uint64_t*)&cgen_var_452, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6398 | marshal_VkRenderPassCreateInfo(countingStream, (VkRenderPassCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 6399 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6400 | uint64_t cgen_var_453 = (uint64_t)(uintptr_t)local_pAllocator; |
| 6401 | countingStream->putBe64(cgen_var_453); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6402 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6403 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6404 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6405 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6406 | uint64_t cgen_var_454; |
| 6407 | countingStream->handleMapping()->mapHandles_VkRenderPass_u64(pRenderPass, &cgen_var_454, 1); |
| 6408 | countingStream->write((uint64_t*)&cgen_var_454, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6409 | } |
| 6410 | uint32_t packetSize_vkCreateRenderPass = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 6411 | countingStream->rewind(); |
| 6412 | uint32_t opcode_vkCreateRenderPass = OP_vkCreateRenderPass; |
| 6413 | stream->write(&opcode_vkCreateRenderPass, sizeof(uint32_t)); |
| 6414 | stream->write(&packetSize_vkCreateRenderPass, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6415 | uint64_t cgen_var_455; |
| 6416 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_455, 1); |
| 6417 | stream->write((uint64_t*)&cgen_var_455, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6418 | marshal_VkRenderPassCreateInfo(stream, (VkRenderPassCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 6419 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6420 | uint64_t cgen_var_456 = (uint64_t)(uintptr_t)local_pAllocator; |
| 6421 | stream->putBe64(cgen_var_456); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6422 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6423 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6424 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6425 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6426 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6427 | uint64_t cgen_var_457; |
| 6428 | stream->handleMapping()->mapHandles_VkRenderPass_u64(pRenderPass, &cgen_var_457, 1); |
| 6429 | stream->write((uint64_t*)&cgen_var_457, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6430 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 6431 | AEMU_SCOPED_TRACE("vkCreateRenderPass readParams"); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6432 | stream->setHandleMapping(resources->createMapping()); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6433 | uint64_t cgen_var_458; |
| 6434 | stream->read((uint64_t*)&cgen_var_458, 8); |
| 6435 | stream->handleMapping()->mapHandles_u64_VkRenderPass(&cgen_var_458, (VkRenderPass*)pRenderPass, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6436 | stream->unsetHandleMapping(); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 6437 | AEMU_SCOPED_TRACE("vkCreateRenderPass returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6438 | VkResult vkCreateRenderPass_VkResult_return = (VkResult)0; |
| 6439 | stream->read(&vkCreateRenderPass_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6440 | countingStream->clearPool(); |
| 6441 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6442 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6443 | mImpl->log("finish vkCreateRenderPass");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6444 | return vkCreateRenderPass_VkResult_return; |
| 6445 | } |
| 6446 | |
| 6447 | void VkEncoder::vkDestroyRenderPass( |
| 6448 | VkDevice device, |
| 6449 | VkRenderPass renderPass, |
| 6450 | const VkAllocationCallbacks* pAllocator) |
| 6451 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 6452 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 6453 | AEMU_SCOPED_TRACE("vkDestroyRenderPass encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6454 | mImpl->log("start vkDestroyRenderPass"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6455 | auto stream = mImpl->stream(); |
| 6456 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6457 | auto resources = mImpl->resources(); |
| 6458 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6459 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6460 | VkDevice local_device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 6461 | VkRenderPass local_renderPass; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6462 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 6463 | local_device = device; |
| 6464 | local_renderPass = renderPass; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6465 | local_pAllocator = nullptr; |
| 6466 | if (pAllocator) |
| 6467 | { |
| 6468 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 6469 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 6470 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 6471 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 6472 | if (local_pAllocator) |
| 6473 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 6474 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 6475 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6476 | countingStream->rewind(); |
| 6477 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6478 | uint64_t cgen_var_459; |
| 6479 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_459, 1); |
| 6480 | countingStream->write((uint64_t*)&cgen_var_459, 1 * 8); |
| 6481 | uint64_t cgen_var_460; |
| 6482 | countingStream->handleMapping()->mapHandles_VkRenderPass_u64(&local_renderPass, &cgen_var_460, 1); |
| 6483 | countingStream->write((uint64_t*)&cgen_var_460, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 6484 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6485 | uint64_t cgen_var_461 = (uint64_t)(uintptr_t)local_pAllocator; |
| 6486 | countingStream->putBe64(cgen_var_461); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6487 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6488 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6489 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6490 | } |
| 6491 | } |
| 6492 | uint32_t packetSize_vkDestroyRenderPass = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 6493 | countingStream->rewind(); |
| 6494 | uint32_t opcode_vkDestroyRenderPass = OP_vkDestroyRenderPass; |
| 6495 | stream->write(&opcode_vkDestroyRenderPass, sizeof(uint32_t)); |
| 6496 | stream->write(&packetSize_vkDestroyRenderPass, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6497 | uint64_t cgen_var_462; |
| 6498 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_462, 1); |
| 6499 | stream->write((uint64_t*)&cgen_var_462, 1 * 8); |
| 6500 | uint64_t cgen_var_463; |
| 6501 | stream->handleMapping()->mapHandles_VkRenderPass_u64(&local_renderPass, &cgen_var_463, 1); |
| 6502 | stream->write((uint64_t*)&cgen_var_463, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 6503 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6504 | uint64_t cgen_var_464 = (uint64_t)(uintptr_t)local_pAllocator; |
| 6505 | stream->putBe64(cgen_var_464); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6506 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6507 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6508 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6509 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 6510 | AEMU_SCOPED_TRACE("vkDestroyRenderPass readParams"); |
| 6511 | AEMU_SCOPED_TRACE("vkDestroyRenderPass returnUnmarshal"); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6512 | resources->destroyMapping()->mapHandles_VkRenderPass((VkRenderPass*)&renderPass); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6513 | mImpl->log("finish vkDestroyRenderPass");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6514 | } |
| 6515 | |
| 6516 | void VkEncoder::vkGetRenderAreaGranularity( |
| 6517 | VkDevice device, |
| 6518 | VkRenderPass renderPass, |
| 6519 | VkExtent2D* pGranularity) |
| 6520 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 6521 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 6522 | AEMU_SCOPED_TRACE("vkGetRenderAreaGranularity encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6523 | mImpl->log("start vkGetRenderAreaGranularity"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6524 | auto stream = mImpl->stream(); |
| 6525 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6526 | auto resources = mImpl->resources(); |
| 6527 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6528 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6529 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6530 | VkRenderPass local_renderPass; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 6531 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6532 | local_renderPass = renderPass; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6533 | countingStream->rewind(); |
| 6534 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6535 | uint64_t cgen_var_465; |
| 6536 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_465, 1); |
| 6537 | countingStream->write((uint64_t*)&cgen_var_465, 1 * 8); |
| 6538 | uint64_t cgen_var_466; |
| 6539 | countingStream->handleMapping()->mapHandles_VkRenderPass_u64(&local_renderPass, &cgen_var_466, 1); |
| 6540 | countingStream->write((uint64_t*)&cgen_var_466, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6541 | marshal_VkExtent2D(countingStream, (VkExtent2D*)(pGranularity)); |
| 6542 | } |
| 6543 | uint32_t packetSize_vkGetRenderAreaGranularity = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 6544 | countingStream->rewind(); |
| 6545 | uint32_t opcode_vkGetRenderAreaGranularity = OP_vkGetRenderAreaGranularity; |
| 6546 | stream->write(&opcode_vkGetRenderAreaGranularity, sizeof(uint32_t)); |
| 6547 | stream->write(&packetSize_vkGetRenderAreaGranularity, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6548 | uint64_t cgen_var_467; |
| 6549 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_467, 1); |
| 6550 | stream->write((uint64_t*)&cgen_var_467, 1 * 8); |
| 6551 | uint64_t cgen_var_468; |
| 6552 | stream->handleMapping()->mapHandles_VkRenderPass_u64(&local_renderPass, &cgen_var_468, 1); |
| 6553 | stream->write((uint64_t*)&cgen_var_468, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6554 | marshal_VkExtent2D(stream, (VkExtent2D*)(pGranularity)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 6555 | AEMU_SCOPED_TRACE("vkGetRenderAreaGranularity readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6556 | unmarshal_VkExtent2D(stream, (VkExtent2D*)(pGranularity)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 6557 | if (pGranularity) |
| 6558 | { |
| 6559 | transform_fromhost_VkExtent2D(mImpl->resources(), (VkExtent2D*)(pGranularity)); |
| 6560 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 6561 | AEMU_SCOPED_TRACE("vkGetRenderAreaGranularity returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6562 | mImpl->log("finish vkGetRenderAreaGranularity");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6563 | } |
| 6564 | |
| 6565 | VkResult VkEncoder::vkCreateCommandPool( |
| 6566 | VkDevice device, |
| 6567 | const VkCommandPoolCreateInfo* pCreateInfo, |
| 6568 | const VkAllocationCallbacks* pAllocator, |
| 6569 | VkCommandPool* pCommandPool) |
| 6570 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 6571 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 6572 | AEMU_SCOPED_TRACE("vkCreateCommandPool encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6573 | mImpl->log("start vkCreateCommandPool"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6574 | auto stream = mImpl->stream(); |
| 6575 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6576 | auto resources = mImpl->resources(); |
| 6577 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6578 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6579 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6580 | VkCommandPoolCreateInfo* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 6581 | VkAllocationCallbacks* local_pAllocator; |
| 6582 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6583 | local_pCreateInfo = nullptr; |
| 6584 | if (pCreateInfo) |
| 6585 | { |
| 6586 | local_pCreateInfo = (VkCommandPoolCreateInfo*)pool->alloc(sizeof(const VkCommandPoolCreateInfo)); |
| 6587 | deepcopy_VkCommandPoolCreateInfo(pool, pCreateInfo, (VkCommandPoolCreateInfo*)(local_pCreateInfo)); |
| 6588 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6589 | local_pAllocator = nullptr; |
| 6590 | if (pAllocator) |
| 6591 | { |
| 6592 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 6593 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 6594 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 6595 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 6596 | if (local_pCreateInfo) |
| 6597 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 6598 | transform_tohost_VkCommandPoolCreateInfo(mImpl->resources(), (VkCommandPoolCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 6599 | } |
| 6600 | if (local_pAllocator) |
| 6601 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 6602 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 6603 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6604 | countingStream->rewind(); |
| 6605 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6606 | uint64_t cgen_var_469; |
| 6607 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_469, 1); |
| 6608 | countingStream->write((uint64_t*)&cgen_var_469, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6609 | marshal_VkCommandPoolCreateInfo(countingStream, (VkCommandPoolCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 6610 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6611 | uint64_t cgen_var_470 = (uint64_t)(uintptr_t)local_pAllocator; |
| 6612 | countingStream->putBe64(cgen_var_470); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6613 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6614 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6615 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6616 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6617 | uint64_t cgen_var_471; |
| 6618 | countingStream->handleMapping()->mapHandles_VkCommandPool_u64(pCommandPool, &cgen_var_471, 1); |
| 6619 | countingStream->write((uint64_t*)&cgen_var_471, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6620 | } |
| 6621 | uint32_t packetSize_vkCreateCommandPool = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 6622 | countingStream->rewind(); |
| 6623 | uint32_t opcode_vkCreateCommandPool = OP_vkCreateCommandPool; |
| 6624 | stream->write(&opcode_vkCreateCommandPool, sizeof(uint32_t)); |
| 6625 | stream->write(&packetSize_vkCreateCommandPool, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6626 | uint64_t cgen_var_472; |
| 6627 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_472, 1); |
| 6628 | stream->write((uint64_t*)&cgen_var_472, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6629 | marshal_VkCommandPoolCreateInfo(stream, (VkCommandPoolCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 6630 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6631 | uint64_t cgen_var_473 = (uint64_t)(uintptr_t)local_pAllocator; |
| 6632 | stream->putBe64(cgen_var_473); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6633 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6634 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6635 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6636 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6637 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6638 | uint64_t cgen_var_474; |
| 6639 | stream->handleMapping()->mapHandles_VkCommandPool_u64(pCommandPool, &cgen_var_474, 1); |
| 6640 | stream->write((uint64_t*)&cgen_var_474, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6641 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 6642 | AEMU_SCOPED_TRACE("vkCreateCommandPool readParams"); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6643 | stream->setHandleMapping(resources->createMapping()); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6644 | uint64_t cgen_var_475; |
| 6645 | stream->read((uint64_t*)&cgen_var_475, 8); |
| 6646 | stream->handleMapping()->mapHandles_u64_VkCommandPool(&cgen_var_475, (VkCommandPool*)pCommandPool, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6647 | stream->unsetHandleMapping(); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 6648 | AEMU_SCOPED_TRACE("vkCreateCommandPool returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6649 | VkResult vkCreateCommandPool_VkResult_return = (VkResult)0; |
| 6650 | stream->read(&vkCreateCommandPool_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6651 | countingStream->clearPool(); |
| 6652 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6653 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6654 | mImpl->log("finish vkCreateCommandPool");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6655 | return vkCreateCommandPool_VkResult_return; |
| 6656 | } |
| 6657 | |
| 6658 | void VkEncoder::vkDestroyCommandPool( |
| 6659 | VkDevice device, |
| 6660 | VkCommandPool commandPool, |
| 6661 | const VkAllocationCallbacks* pAllocator) |
| 6662 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 6663 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 6664 | AEMU_SCOPED_TRACE("vkDestroyCommandPool encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6665 | mImpl->log("start vkDestroyCommandPool"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6666 | auto stream = mImpl->stream(); |
| 6667 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6668 | auto resources = mImpl->resources(); |
| 6669 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6670 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6671 | VkDevice local_device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 6672 | VkCommandPool local_commandPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6673 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 6674 | local_device = device; |
| 6675 | local_commandPool = commandPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6676 | local_pAllocator = nullptr; |
| 6677 | if (pAllocator) |
| 6678 | { |
| 6679 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 6680 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 6681 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 6682 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 6683 | if (local_pAllocator) |
| 6684 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 6685 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 6686 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6687 | countingStream->rewind(); |
| 6688 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6689 | uint64_t cgen_var_476; |
| 6690 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_476, 1); |
| 6691 | countingStream->write((uint64_t*)&cgen_var_476, 1 * 8); |
| 6692 | uint64_t cgen_var_477; |
| 6693 | countingStream->handleMapping()->mapHandles_VkCommandPool_u64(&local_commandPool, &cgen_var_477, 1); |
| 6694 | countingStream->write((uint64_t*)&cgen_var_477, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 6695 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6696 | uint64_t cgen_var_478 = (uint64_t)(uintptr_t)local_pAllocator; |
| 6697 | countingStream->putBe64(cgen_var_478); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6698 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6699 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6700 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6701 | } |
| 6702 | } |
| 6703 | uint32_t packetSize_vkDestroyCommandPool = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 6704 | countingStream->rewind(); |
| 6705 | uint32_t opcode_vkDestroyCommandPool = OP_vkDestroyCommandPool; |
| 6706 | stream->write(&opcode_vkDestroyCommandPool, sizeof(uint32_t)); |
| 6707 | stream->write(&packetSize_vkDestroyCommandPool, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6708 | uint64_t cgen_var_479; |
| 6709 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_479, 1); |
| 6710 | stream->write((uint64_t*)&cgen_var_479, 1 * 8); |
| 6711 | uint64_t cgen_var_480; |
| 6712 | stream->handleMapping()->mapHandles_VkCommandPool_u64(&local_commandPool, &cgen_var_480, 1); |
| 6713 | stream->write((uint64_t*)&cgen_var_480, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 6714 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6715 | uint64_t cgen_var_481 = (uint64_t)(uintptr_t)local_pAllocator; |
| 6716 | stream->putBe64(cgen_var_481); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6717 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6718 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6719 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6720 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 6721 | AEMU_SCOPED_TRACE("vkDestroyCommandPool readParams"); |
| 6722 | AEMU_SCOPED_TRACE("vkDestroyCommandPool returnUnmarshal"); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6723 | resources->destroyMapping()->mapHandles_VkCommandPool((VkCommandPool*)&commandPool); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6724 | mImpl->log("finish vkDestroyCommandPool");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6725 | } |
| 6726 | |
| 6727 | VkResult VkEncoder::vkResetCommandPool( |
| 6728 | VkDevice device, |
| 6729 | VkCommandPool commandPool, |
| 6730 | VkCommandPoolResetFlags flags) |
| 6731 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 6732 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 6733 | AEMU_SCOPED_TRACE("vkResetCommandPool encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6734 | mImpl->log("start vkResetCommandPool"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6735 | auto stream = mImpl->stream(); |
| 6736 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6737 | auto resources = mImpl->resources(); |
| 6738 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6739 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6740 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6741 | VkCommandPool local_commandPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6742 | VkCommandPoolResetFlags local_flags; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 6743 | local_device = device; |
| 6744 | local_commandPool = commandPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6745 | local_flags = flags; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6746 | countingStream->rewind(); |
| 6747 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6748 | uint64_t cgen_var_482; |
| 6749 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_482, 1); |
| 6750 | countingStream->write((uint64_t*)&cgen_var_482, 1 * 8); |
| 6751 | uint64_t cgen_var_483; |
| 6752 | countingStream->handleMapping()->mapHandles_VkCommandPool_u64(&local_commandPool, &cgen_var_483, 1); |
| 6753 | countingStream->write((uint64_t*)&cgen_var_483, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6754 | countingStream->write((VkCommandPoolResetFlags*)&local_flags, sizeof(VkCommandPoolResetFlags)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6755 | } |
| 6756 | uint32_t packetSize_vkResetCommandPool = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 6757 | countingStream->rewind(); |
| 6758 | uint32_t opcode_vkResetCommandPool = OP_vkResetCommandPool; |
| 6759 | stream->write(&opcode_vkResetCommandPool, sizeof(uint32_t)); |
| 6760 | stream->write(&packetSize_vkResetCommandPool, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6761 | uint64_t cgen_var_484; |
| 6762 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_484, 1); |
| 6763 | stream->write((uint64_t*)&cgen_var_484, 1 * 8); |
| 6764 | uint64_t cgen_var_485; |
| 6765 | stream->handleMapping()->mapHandles_VkCommandPool_u64(&local_commandPool, &cgen_var_485, 1); |
| 6766 | stream->write((uint64_t*)&cgen_var_485, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6767 | stream->write((VkCommandPoolResetFlags*)&local_flags, sizeof(VkCommandPoolResetFlags)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 6768 | AEMU_SCOPED_TRACE("vkResetCommandPool readParams"); |
| 6769 | AEMU_SCOPED_TRACE("vkResetCommandPool returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6770 | VkResult vkResetCommandPool_VkResult_return = (VkResult)0; |
| 6771 | stream->read(&vkResetCommandPool_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6772 | countingStream->clearPool(); |
| 6773 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6774 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6775 | mImpl->log("finish vkResetCommandPool");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6776 | return vkResetCommandPool_VkResult_return; |
| 6777 | } |
| 6778 | |
| 6779 | VkResult VkEncoder::vkAllocateCommandBuffers( |
| 6780 | VkDevice device, |
| 6781 | const VkCommandBufferAllocateInfo* pAllocateInfo, |
| 6782 | VkCommandBuffer* pCommandBuffers) |
| 6783 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 6784 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 6785 | AEMU_SCOPED_TRACE("vkAllocateCommandBuffers encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6786 | mImpl->log("start vkAllocateCommandBuffers"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6787 | auto stream = mImpl->stream(); |
| 6788 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6789 | auto resources = mImpl->resources(); |
| 6790 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6791 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6792 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6793 | VkCommandBufferAllocateInfo* local_pAllocateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 6794 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6795 | local_pAllocateInfo = nullptr; |
| 6796 | if (pAllocateInfo) |
| 6797 | { |
| 6798 | local_pAllocateInfo = (VkCommandBufferAllocateInfo*)pool->alloc(sizeof(const VkCommandBufferAllocateInfo)); |
| 6799 | deepcopy_VkCommandBufferAllocateInfo(pool, pAllocateInfo, (VkCommandBufferAllocateInfo*)(local_pAllocateInfo)); |
| 6800 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 6801 | if (local_pAllocateInfo) |
| 6802 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 6803 | transform_tohost_VkCommandBufferAllocateInfo(mImpl->resources(), (VkCommandBufferAllocateInfo*)(local_pAllocateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 6804 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6805 | countingStream->rewind(); |
| 6806 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6807 | uint64_t cgen_var_486; |
| 6808 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_486, 1); |
| 6809 | countingStream->write((uint64_t*)&cgen_var_486, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6810 | marshal_VkCommandBufferAllocateInfo(countingStream, (VkCommandBufferAllocateInfo*)(local_pAllocateInfo)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6811 | if (pAllocateInfo->commandBufferCount) |
| 6812 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6813 | uint64_t* cgen_var_487; |
| 6814 | countingStream->alloc((void**)&cgen_var_487, pAllocateInfo->commandBufferCount * 8); |
| 6815 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(pCommandBuffers, cgen_var_487, pAllocateInfo->commandBufferCount); |
| 6816 | countingStream->write((uint64_t*)cgen_var_487, pAllocateInfo->commandBufferCount * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6817 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6818 | } |
| 6819 | uint32_t packetSize_vkAllocateCommandBuffers = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 6820 | countingStream->rewind(); |
| 6821 | uint32_t opcode_vkAllocateCommandBuffers = OP_vkAllocateCommandBuffers; |
| 6822 | stream->write(&opcode_vkAllocateCommandBuffers, sizeof(uint32_t)); |
| 6823 | stream->write(&packetSize_vkAllocateCommandBuffers, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6824 | uint64_t cgen_var_488; |
| 6825 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_488, 1); |
| 6826 | stream->write((uint64_t*)&cgen_var_488, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6827 | marshal_VkCommandBufferAllocateInfo(stream, (VkCommandBufferAllocateInfo*)(local_pAllocateInfo)); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6828 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6829 | if (pAllocateInfo->commandBufferCount) |
| 6830 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6831 | uint64_t* cgen_var_489; |
| 6832 | stream->alloc((void**)&cgen_var_489, pAllocateInfo->commandBufferCount * 8); |
| 6833 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(pCommandBuffers, cgen_var_489, pAllocateInfo->commandBufferCount); |
| 6834 | stream->write((uint64_t*)cgen_var_489, pAllocateInfo->commandBufferCount * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6835 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6836 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 6837 | AEMU_SCOPED_TRACE("vkAllocateCommandBuffers readParams"); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6838 | stream->setHandleMapping(resources->createMapping()); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6839 | if (pAllocateInfo->commandBufferCount) |
| 6840 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6841 | uint64_t* cgen_var_490; |
| 6842 | stream->alloc((void**)&cgen_var_490, pAllocateInfo->commandBufferCount * 8); |
| 6843 | stream->read((uint64_t*)cgen_var_490, pAllocateInfo->commandBufferCount * 8); |
| 6844 | stream->handleMapping()->mapHandles_u64_VkCommandBuffer(cgen_var_490, (VkCommandBuffer*)pCommandBuffers, pAllocateInfo->commandBufferCount); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6845 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6846 | stream->unsetHandleMapping(); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 6847 | AEMU_SCOPED_TRACE("vkAllocateCommandBuffers returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6848 | VkResult vkAllocateCommandBuffers_VkResult_return = (VkResult)0; |
| 6849 | stream->read(&vkAllocateCommandBuffers_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6850 | countingStream->clearPool(); |
| 6851 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6852 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6853 | mImpl->log("finish vkAllocateCommandBuffers");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6854 | return vkAllocateCommandBuffers_VkResult_return; |
| 6855 | } |
| 6856 | |
| 6857 | void VkEncoder::vkFreeCommandBuffers( |
| 6858 | VkDevice device, |
| 6859 | VkCommandPool commandPool, |
| 6860 | uint32_t commandBufferCount, |
| 6861 | const VkCommandBuffer* pCommandBuffers) |
| 6862 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 6863 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 6864 | AEMU_SCOPED_TRACE("vkFreeCommandBuffers encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6865 | mImpl->log("start vkFreeCommandBuffers"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6866 | auto stream = mImpl->stream(); |
| 6867 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6868 | auto resources = mImpl->resources(); |
| 6869 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6870 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6871 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6872 | VkCommandPool local_commandPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6873 | uint32_t local_commandBufferCount; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 6874 | VkCommandBuffer* local_pCommandBuffers; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 6875 | local_device = device; |
| 6876 | local_commandPool = commandPool; |
| 6877 | local_commandBufferCount = commandBufferCount; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 6878 | local_pCommandBuffers = nullptr; |
| 6879 | if (pCommandBuffers) |
| 6880 | { |
| 6881 | local_pCommandBuffers = (VkCommandBuffer*)pool->dupArray(pCommandBuffers, ((commandBufferCount)) * sizeof(const VkCommandBuffer)); |
| 6882 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6883 | countingStream->rewind(); |
| 6884 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6885 | uint64_t cgen_var_491; |
| 6886 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_491, 1); |
| 6887 | countingStream->write((uint64_t*)&cgen_var_491, 1 * 8); |
| 6888 | uint64_t cgen_var_492; |
| 6889 | countingStream->handleMapping()->mapHandles_VkCommandPool_u64(&local_commandPool, &cgen_var_492, 1); |
| 6890 | countingStream->write((uint64_t*)&cgen_var_492, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6891 | countingStream->write((uint32_t*)&local_commandBufferCount, sizeof(uint32_t)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 6892 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6893 | uint64_t cgen_var_493 = (uint64_t)(uintptr_t)local_pCommandBuffers; |
| 6894 | countingStream->putBe64(cgen_var_493); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 6895 | if (local_pCommandBuffers) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6896 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6897 | if (((commandBufferCount))) |
| 6898 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6899 | uint64_t* cgen_var_494; |
| 6900 | countingStream->alloc((void**)&cgen_var_494, ((commandBufferCount)) * 8); |
| 6901 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(local_pCommandBuffers, cgen_var_494, ((commandBufferCount))); |
| 6902 | countingStream->write((uint64_t*)cgen_var_494, ((commandBufferCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6903 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6904 | } |
| 6905 | } |
| 6906 | uint32_t packetSize_vkFreeCommandBuffers = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 6907 | countingStream->rewind(); |
| 6908 | uint32_t opcode_vkFreeCommandBuffers = OP_vkFreeCommandBuffers; |
| 6909 | stream->write(&opcode_vkFreeCommandBuffers, sizeof(uint32_t)); |
| 6910 | stream->write(&packetSize_vkFreeCommandBuffers, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6911 | uint64_t cgen_var_495; |
| 6912 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_495, 1); |
| 6913 | stream->write((uint64_t*)&cgen_var_495, 1 * 8); |
| 6914 | uint64_t cgen_var_496; |
| 6915 | stream->handleMapping()->mapHandles_VkCommandPool_u64(&local_commandPool, &cgen_var_496, 1); |
| 6916 | stream->write((uint64_t*)&cgen_var_496, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6917 | stream->write((uint32_t*)&local_commandBufferCount, sizeof(uint32_t)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 6918 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6919 | uint64_t cgen_var_497 = (uint64_t)(uintptr_t)local_pCommandBuffers; |
| 6920 | stream->putBe64(cgen_var_497); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 6921 | if (local_pCommandBuffers) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6922 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6923 | if (((commandBufferCount))) |
| 6924 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6925 | uint64_t* cgen_var_498; |
| 6926 | stream->alloc((void**)&cgen_var_498, ((commandBufferCount)) * 8); |
| 6927 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(local_pCommandBuffers, cgen_var_498, ((commandBufferCount))); |
| 6928 | stream->write((uint64_t*)cgen_var_498, ((commandBufferCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6929 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6930 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 6931 | AEMU_SCOPED_TRACE("vkFreeCommandBuffers readParams"); |
| 6932 | AEMU_SCOPED_TRACE("vkFreeCommandBuffers returnUnmarshal"); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6933 | if (pCommandBuffers) |
| 6934 | { |
| 6935 | resources->destroyMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)pCommandBuffers, ((commandBufferCount))); |
| 6936 | } |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6937 | mImpl->log("finish vkFreeCommandBuffers");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6938 | } |
| 6939 | |
| 6940 | VkResult VkEncoder::vkBeginCommandBuffer( |
| 6941 | VkCommandBuffer commandBuffer, |
| 6942 | const VkCommandBufferBeginInfo* pBeginInfo) |
| 6943 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 6944 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 6945 | AEMU_SCOPED_TRACE("vkBeginCommandBuffer encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6946 | mImpl->log("start vkBeginCommandBuffer"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6947 | auto stream = mImpl->stream(); |
| 6948 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6949 | auto resources = mImpl->resources(); |
| 6950 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6951 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6952 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6953 | VkCommandBufferBeginInfo* local_pBeginInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 6954 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6955 | local_pBeginInfo = nullptr; |
| 6956 | if (pBeginInfo) |
| 6957 | { |
| 6958 | local_pBeginInfo = (VkCommandBufferBeginInfo*)pool->alloc(sizeof(const VkCommandBufferBeginInfo)); |
| 6959 | deepcopy_VkCommandBufferBeginInfo(pool, pBeginInfo, (VkCommandBufferBeginInfo*)(local_pBeginInfo)); |
| 6960 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 6961 | if (local_pBeginInfo) |
| 6962 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 6963 | transform_tohost_VkCommandBufferBeginInfo(mImpl->resources(), (VkCommandBufferBeginInfo*)(local_pBeginInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 6964 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6965 | countingStream->rewind(); |
| 6966 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6967 | uint64_t cgen_var_499; |
| 6968 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_499, 1); |
| 6969 | countingStream->write((uint64_t*)&cgen_var_499, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6970 | marshal_VkCommandBufferBeginInfo(countingStream, (VkCommandBufferBeginInfo*)(local_pBeginInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6971 | } |
| 6972 | uint32_t packetSize_vkBeginCommandBuffer = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 6973 | countingStream->rewind(); |
| 6974 | uint32_t opcode_vkBeginCommandBuffer = OP_vkBeginCommandBuffer; |
| 6975 | stream->write(&opcode_vkBeginCommandBuffer, sizeof(uint32_t)); |
| 6976 | stream->write(&packetSize_vkBeginCommandBuffer, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6977 | uint64_t cgen_var_500; |
| 6978 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_500, 1); |
| 6979 | stream->write((uint64_t*)&cgen_var_500, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6980 | marshal_VkCommandBufferBeginInfo(stream, (VkCommandBufferBeginInfo*)(local_pBeginInfo)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 6981 | AEMU_SCOPED_TRACE("vkBeginCommandBuffer readParams"); |
| 6982 | AEMU_SCOPED_TRACE("vkBeginCommandBuffer returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6983 | VkResult vkBeginCommandBuffer_VkResult_return = (VkResult)0; |
| 6984 | stream->read(&vkBeginCommandBuffer_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6985 | countingStream->clearPool(); |
| 6986 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6987 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6988 | mImpl->log("finish vkBeginCommandBuffer");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6989 | return vkBeginCommandBuffer_VkResult_return; |
| 6990 | } |
| 6991 | |
| 6992 | VkResult VkEncoder::vkEndCommandBuffer( |
| 6993 | VkCommandBuffer commandBuffer) |
| 6994 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 6995 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 6996 | AEMU_SCOPED_TRACE("vkEndCommandBuffer encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6997 | mImpl->log("start vkEndCommandBuffer"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6998 | auto stream = mImpl->stream(); |
| 6999 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7000 | auto resources = mImpl->resources(); |
| 7001 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 7002 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7003 | VkCommandBuffer local_commandBuffer; |
| 7004 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7005 | countingStream->rewind(); |
| 7006 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7007 | uint64_t cgen_var_501; |
| 7008 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_501, 1); |
| 7009 | countingStream->write((uint64_t*)&cgen_var_501, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7010 | } |
| 7011 | uint32_t packetSize_vkEndCommandBuffer = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7012 | countingStream->rewind(); |
| 7013 | uint32_t opcode_vkEndCommandBuffer = OP_vkEndCommandBuffer; |
| 7014 | stream->write(&opcode_vkEndCommandBuffer, sizeof(uint32_t)); |
| 7015 | stream->write(&packetSize_vkEndCommandBuffer, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7016 | uint64_t cgen_var_502; |
| 7017 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_502, 1); |
| 7018 | stream->write((uint64_t*)&cgen_var_502, 1 * 8); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 7019 | AEMU_SCOPED_TRACE("vkEndCommandBuffer readParams"); |
| 7020 | AEMU_SCOPED_TRACE("vkEndCommandBuffer returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7021 | VkResult vkEndCommandBuffer_VkResult_return = (VkResult)0; |
| 7022 | stream->read(&vkEndCommandBuffer_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 7023 | countingStream->clearPool(); |
| 7024 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 7025 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7026 | mImpl->log("finish vkEndCommandBuffer");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7027 | return vkEndCommandBuffer_VkResult_return; |
| 7028 | } |
| 7029 | |
| 7030 | VkResult VkEncoder::vkResetCommandBuffer( |
| 7031 | VkCommandBuffer commandBuffer, |
| 7032 | VkCommandBufferResetFlags flags) |
| 7033 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 7034 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 7035 | AEMU_SCOPED_TRACE("vkResetCommandBuffer encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7036 | mImpl->log("start vkResetCommandBuffer"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7037 | auto stream = mImpl->stream(); |
| 7038 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7039 | auto resources = mImpl->resources(); |
| 7040 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 7041 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7042 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7043 | VkCommandBufferResetFlags local_flags; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 7044 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7045 | local_flags = flags; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7046 | countingStream->rewind(); |
| 7047 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7048 | uint64_t cgen_var_503; |
| 7049 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_503, 1); |
| 7050 | countingStream->write((uint64_t*)&cgen_var_503, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7051 | countingStream->write((VkCommandBufferResetFlags*)&local_flags, sizeof(VkCommandBufferResetFlags)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7052 | } |
| 7053 | uint32_t packetSize_vkResetCommandBuffer = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7054 | countingStream->rewind(); |
| 7055 | uint32_t opcode_vkResetCommandBuffer = OP_vkResetCommandBuffer; |
| 7056 | stream->write(&opcode_vkResetCommandBuffer, sizeof(uint32_t)); |
| 7057 | stream->write(&packetSize_vkResetCommandBuffer, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7058 | uint64_t cgen_var_504; |
| 7059 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_504, 1); |
| 7060 | stream->write((uint64_t*)&cgen_var_504, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7061 | stream->write((VkCommandBufferResetFlags*)&local_flags, sizeof(VkCommandBufferResetFlags)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 7062 | AEMU_SCOPED_TRACE("vkResetCommandBuffer readParams"); |
| 7063 | AEMU_SCOPED_TRACE("vkResetCommandBuffer returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7064 | VkResult vkResetCommandBuffer_VkResult_return = (VkResult)0; |
| 7065 | stream->read(&vkResetCommandBuffer_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 7066 | countingStream->clearPool(); |
| 7067 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 7068 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7069 | mImpl->log("finish vkResetCommandBuffer");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7070 | return vkResetCommandBuffer_VkResult_return; |
| 7071 | } |
| 7072 | |
| 7073 | void VkEncoder::vkCmdBindPipeline( |
| 7074 | VkCommandBuffer commandBuffer, |
| 7075 | VkPipelineBindPoint pipelineBindPoint, |
| 7076 | VkPipeline pipeline) |
| 7077 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 7078 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 7079 | AEMU_SCOPED_TRACE("vkCmdBindPipeline encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7080 | mImpl->log("start vkCmdBindPipeline"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7081 | auto stream = mImpl->stream(); |
| 7082 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7083 | auto resources = mImpl->resources(); |
| 7084 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 7085 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7086 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7087 | VkPipelineBindPoint local_pipelineBindPoint; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7088 | VkPipeline local_pipeline; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 7089 | local_commandBuffer = commandBuffer; |
| 7090 | local_pipelineBindPoint = pipelineBindPoint; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7091 | local_pipeline = pipeline; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7092 | countingStream->rewind(); |
| 7093 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7094 | uint64_t cgen_var_505; |
| 7095 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_505, 1); |
| 7096 | countingStream->write((uint64_t*)&cgen_var_505, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7097 | countingStream->write((VkPipelineBindPoint*)&local_pipelineBindPoint, sizeof(VkPipelineBindPoint)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7098 | uint64_t cgen_var_506; |
| 7099 | countingStream->handleMapping()->mapHandles_VkPipeline_u64(&local_pipeline, &cgen_var_506, 1); |
| 7100 | countingStream->write((uint64_t*)&cgen_var_506, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7101 | } |
| 7102 | uint32_t packetSize_vkCmdBindPipeline = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7103 | countingStream->rewind(); |
| 7104 | uint32_t opcode_vkCmdBindPipeline = OP_vkCmdBindPipeline; |
| 7105 | stream->write(&opcode_vkCmdBindPipeline, sizeof(uint32_t)); |
| 7106 | stream->write(&packetSize_vkCmdBindPipeline, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7107 | uint64_t cgen_var_507; |
| 7108 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_507, 1); |
| 7109 | stream->write((uint64_t*)&cgen_var_507, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7110 | stream->write((VkPipelineBindPoint*)&local_pipelineBindPoint, sizeof(VkPipelineBindPoint)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7111 | uint64_t cgen_var_508; |
| 7112 | stream->handleMapping()->mapHandles_VkPipeline_u64(&local_pipeline, &cgen_var_508, 1); |
| 7113 | stream->write((uint64_t*)&cgen_var_508, 1 * 8); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 7114 | AEMU_SCOPED_TRACE("vkCmdBindPipeline readParams"); |
| 7115 | AEMU_SCOPED_TRACE("vkCmdBindPipeline returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7116 | mImpl->log("finish vkCmdBindPipeline");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7117 | } |
| 7118 | |
| 7119 | void VkEncoder::vkCmdSetViewport( |
| 7120 | VkCommandBuffer commandBuffer, |
| 7121 | uint32_t firstViewport, |
| 7122 | uint32_t viewportCount, |
| 7123 | const VkViewport* pViewports) |
| 7124 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 7125 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 7126 | AEMU_SCOPED_TRACE("vkCmdSetViewport encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7127 | mImpl->log("start vkCmdSetViewport"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7128 | auto stream = mImpl->stream(); |
| 7129 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7130 | auto resources = mImpl->resources(); |
| 7131 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 7132 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7133 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7134 | uint32_t local_firstViewport; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7135 | uint32_t local_viewportCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7136 | VkViewport* local_pViewports; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 7137 | local_commandBuffer = commandBuffer; |
| 7138 | local_firstViewport = firstViewport; |
| 7139 | local_viewportCount = viewportCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7140 | local_pViewports = nullptr; |
| 7141 | if (pViewports) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7142 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7143 | local_pViewports = (VkViewport*)pool->alloc(((viewportCount)) * sizeof(const VkViewport)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7144 | for (uint32_t i = 0; i < (uint32_t)((viewportCount)); ++i) |
| 7145 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7146 | deepcopy_VkViewport(pool, pViewports + i, (VkViewport*)(local_pViewports + i)); |
| 7147 | } |
| 7148 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 7149 | if (local_pViewports) |
| 7150 | { |
| 7151 | for (uint32_t i = 0; i < (uint32_t)((viewportCount)); ++i) |
| 7152 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 7153 | transform_tohost_VkViewport(mImpl->resources(), (VkViewport*)(local_pViewports + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 7154 | } |
| 7155 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7156 | countingStream->rewind(); |
| 7157 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7158 | uint64_t cgen_var_509; |
| 7159 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_509, 1); |
| 7160 | countingStream->write((uint64_t*)&cgen_var_509, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7161 | countingStream->write((uint32_t*)&local_firstViewport, sizeof(uint32_t)); |
| 7162 | countingStream->write((uint32_t*)&local_viewportCount, sizeof(uint32_t)); |
| 7163 | for (uint32_t i = 0; i < (uint32_t)((viewportCount)); ++i) |
| 7164 | { |
| 7165 | marshal_VkViewport(countingStream, (VkViewport*)(local_pViewports + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7166 | } |
| 7167 | } |
| 7168 | uint32_t packetSize_vkCmdSetViewport = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7169 | countingStream->rewind(); |
| 7170 | uint32_t opcode_vkCmdSetViewport = OP_vkCmdSetViewport; |
| 7171 | stream->write(&opcode_vkCmdSetViewport, sizeof(uint32_t)); |
| 7172 | stream->write(&packetSize_vkCmdSetViewport, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7173 | uint64_t cgen_var_510; |
| 7174 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_510, 1); |
| 7175 | stream->write((uint64_t*)&cgen_var_510, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7176 | stream->write((uint32_t*)&local_firstViewport, sizeof(uint32_t)); |
| 7177 | stream->write((uint32_t*)&local_viewportCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7178 | for (uint32_t i = 0; i < (uint32_t)((viewportCount)); ++i) |
| 7179 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7180 | marshal_VkViewport(stream, (VkViewport*)(local_pViewports + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7181 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 7182 | AEMU_SCOPED_TRACE("vkCmdSetViewport readParams"); |
| 7183 | AEMU_SCOPED_TRACE("vkCmdSetViewport returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7184 | mImpl->log("finish vkCmdSetViewport");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7185 | } |
| 7186 | |
| 7187 | void VkEncoder::vkCmdSetScissor( |
| 7188 | VkCommandBuffer commandBuffer, |
| 7189 | uint32_t firstScissor, |
| 7190 | uint32_t scissorCount, |
| 7191 | const VkRect2D* pScissors) |
| 7192 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 7193 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 7194 | AEMU_SCOPED_TRACE("vkCmdSetScissor encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7195 | mImpl->log("start vkCmdSetScissor"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7196 | auto stream = mImpl->stream(); |
| 7197 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7198 | auto resources = mImpl->resources(); |
| 7199 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 7200 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7201 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7202 | uint32_t local_firstScissor; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7203 | uint32_t local_scissorCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7204 | VkRect2D* local_pScissors; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 7205 | local_commandBuffer = commandBuffer; |
| 7206 | local_firstScissor = firstScissor; |
| 7207 | local_scissorCount = scissorCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7208 | local_pScissors = nullptr; |
| 7209 | if (pScissors) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7210 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7211 | local_pScissors = (VkRect2D*)pool->alloc(((scissorCount)) * sizeof(const VkRect2D)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7212 | for (uint32_t i = 0; i < (uint32_t)((scissorCount)); ++i) |
| 7213 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7214 | deepcopy_VkRect2D(pool, pScissors + i, (VkRect2D*)(local_pScissors + i)); |
| 7215 | } |
| 7216 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 7217 | if (local_pScissors) |
| 7218 | { |
| 7219 | for (uint32_t i = 0; i < (uint32_t)((scissorCount)); ++i) |
| 7220 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 7221 | transform_tohost_VkRect2D(mImpl->resources(), (VkRect2D*)(local_pScissors + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 7222 | } |
| 7223 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7224 | countingStream->rewind(); |
| 7225 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7226 | uint64_t cgen_var_511; |
| 7227 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_511, 1); |
| 7228 | countingStream->write((uint64_t*)&cgen_var_511, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7229 | countingStream->write((uint32_t*)&local_firstScissor, sizeof(uint32_t)); |
| 7230 | countingStream->write((uint32_t*)&local_scissorCount, sizeof(uint32_t)); |
| 7231 | for (uint32_t i = 0; i < (uint32_t)((scissorCount)); ++i) |
| 7232 | { |
| 7233 | marshal_VkRect2D(countingStream, (VkRect2D*)(local_pScissors + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7234 | } |
| 7235 | } |
| 7236 | uint32_t packetSize_vkCmdSetScissor = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7237 | countingStream->rewind(); |
| 7238 | uint32_t opcode_vkCmdSetScissor = OP_vkCmdSetScissor; |
| 7239 | stream->write(&opcode_vkCmdSetScissor, sizeof(uint32_t)); |
| 7240 | stream->write(&packetSize_vkCmdSetScissor, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7241 | uint64_t cgen_var_512; |
| 7242 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_512, 1); |
| 7243 | stream->write((uint64_t*)&cgen_var_512, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7244 | stream->write((uint32_t*)&local_firstScissor, sizeof(uint32_t)); |
| 7245 | stream->write((uint32_t*)&local_scissorCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7246 | for (uint32_t i = 0; i < (uint32_t)((scissorCount)); ++i) |
| 7247 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7248 | marshal_VkRect2D(stream, (VkRect2D*)(local_pScissors + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7249 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 7250 | AEMU_SCOPED_TRACE("vkCmdSetScissor readParams"); |
| 7251 | AEMU_SCOPED_TRACE("vkCmdSetScissor returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7252 | mImpl->log("finish vkCmdSetScissor");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7253 | } |
| 7254 | |
| 7255 | void VkEncoder::vkCmdSetLineWidth( |
| 7256 | VkCommandBuffer commandBuffer, |
| 7257 | float lineWidth) |
| 7258 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 7259 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 7260 | AEMU_SCOPED_TRACE("vkCmdSetLineWidth encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7261 | mImpl->log("start vkCmdSetLineWidth"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7262 | auto stream = mImpl->stream(); |
| 7263 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7264 | auto resources = mImpl->resources(); |
| 7265 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 7266 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7267 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7268 | float local_lineWidth; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 7269 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7270 | local_lineWidth = lineWidth; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7271 | countingStream->rewind(); |
| 7272 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7273 | uint64_t cgen_var_513; |
| 7274 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_513, 1); |
| 7275 | countingStream->write((uint64_t*)&cgen_var_513, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7276 | countingStream->write((float*)&local_lineWidth, sizeof(float)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7277 | } |
| 7278 | uint32_t packetSize_vkCmdSetLineWidth = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7279 | countingStream->rewind(); |
| 7280 | uint32_t opcode_vkCmdSetLineWidth = OP_vkCmdSetLineWidth; |
| 7281 | stream->write(&opcode_vkCmdSetLineWidth, sizeof(uint32_t)); |
| 7282 | stream->write(&packetSize_vkCmdSetLineWidth, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7283 | uint64_t cgen_var_514; |
| 7284 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_514, 1); |
| 7285 | stream->write((uint64_t*)&cgen_var_514, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7286 | stream->write((float*)&local_lineWidth, sizeof(float)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 7287 | AEMU_SCOPED_TRACE("vkCmdSetLineWidth readParams"); |
| 7288 | AEMU_SCOPED_TRACE("vkCmdSetLineWidth returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7289 | mImpl->log("finish vkCmdSetLineWidth");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7290 | } |
| 7291 | |
| 7292 | void VkEncoder::vkCmdSetDepthBias( |
| 7293 | VkCommandBuffer commandBuffer, |
| 7294 | float depthBiasConstantFactor, |
| 7295 | float depthBiasClamp, |
| 7296 | float depthBiasSlopeFactor) |
| 7297 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 7298 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 7299 | AEMU_SCOPED_TRACE("vkCmdSetDepthBias encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7300 | mImpl->log("start vkCmdSetDepthBias"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7301 | auto stream = mImpl->stream(); |
| 7302 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7303 | auto resources = mImpl->resources(); |
| 7304 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 7305 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7306 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7307 | float local_depthBiasConstantFactor; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7308 | float local_depthBiasClamp; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7309 | float local_depthBiasSlopeFactor; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 7310 | local_commandBuffer = commandBuffer; |
| 7311 | local_depthBiasConstantFactor = depthBiasConstantFactor; |
| 7312 | local_depthBiasClamp = depthBiasClamp; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7313 | local_depthBiasSlopeFactor = depthBiasSlopeFactor; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7314 | countingStream->rewind(); |
| 7315 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7316 | uint64_t cgen_var_515; |
| 7317 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_515, 1); |
| 7318 | countingStream->write((uint64_t*)&cgen_var_515, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7319 | countingStream->write((float*)&local_depthBiasConstantFactor, sizeof(float)); |
| 7320 | countingStream->write((float*)&local_depthBiasClamp, sizeof(float)); |
| 7321 | countingStream->write((float*)&local_depthBiasSlopeFactor, sizeof(float)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7322 | } |
| 7323 | uint32_t packetSize_vkCmdSetDepthBias = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7324 | countingStream->rewind(); |
| 7325 | uint32_t opcode_vkCmdSetDepthBias = OP_vkCmdSetDepthBias; |
| 7326 | stream->write(&opcode_vkCmdSetDepthBias, sizeof(uint32_t)); |
| 7327 | stream->write(&packetSize_vkCmdSetDepthBias, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7328 | uint64_t cgen_var_516; |
| 7329 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_516, 1); |
| 7330 | stream->write((uint64_t*)&cgen_var_516, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7331 | stream->write((float*)&local_depthBiasConstantFactor, sizeof(float)); |
| 7332 | stream->write((float*)&local_depthBiasClamp, sizeof(float)); |
| 7333 | stream->write((float*)&local_depthBiasSlopeFactor, sizeof(float)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 7334 | AEMU_SCOPED_TRACE("vkCmdSetDepthBias readParams"); |
| 7335 | AEMU_SCOPED_TRACE("vkCmdSetDepthBias returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7336 | mImpl->log("finish vkCmdSetDepthBias");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7337 | } |
| 7338 | |
| 7339 | void VkEncoder::vkCmdSetBlendConstants( |
| 7340 | VkCommandBuffer commandBuffer, |
| Lingfeng Yang | 97ddeb8 | 2019-04-20 14:32:52 -0700 | [diff] [blame] | 7341 | const float blendConstants[4]) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7342 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 7343 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 7344 | AEMU_SCOPED_TRACE("vkCmdSetBlendConstants encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7345 | mImpl->log("start vkCmdSetBlendConstants"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7346 | auto stream = mImpl->stream(); |
| 7347 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7348 | auto resources = mImpl->resources(); |
| 7349 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 7350 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7351 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7352 | float local_blendConstants[4]; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 7353 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7354 | memcpy(&local_blendConstants, &blendConstants, 4 * sizeof(const float)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7355 | countingStream->rewind(); |
| 7356 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7357 | uint64_t cgen_var_517; |
| 7358 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_517, 1); |
| 7359 | countingStream->write((uint64_t*)&cgen_var_517, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7360 | countingStream->write((float*)&local_blendConstants, 4 * sizeof(float)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7361 | } |
| 7362 | uint32_t packetSize_vkCmdSetBlendConstants = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7363 | countingStream->rewind(); |
| 7364 | uint32_t opcode_vkCmdSetBlendConstants = OP_vkCmdSetBlendConstants; |
| 7365 | stream->write(&opcode_vkCmdSetBlendConstants, sizeof(uint32_t)); |
| 7366 | stream->write(&packetSize_vkCmdSetBlendConstants, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7367 | uint64_t cgen_var_518; |
| 7368 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_518, 1); |
| 7369 | stream->write((uint64_t*)&cgen_var_518, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7370 | stream->write((float*)&local_blendConstants, 4 * sizeof(float)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 7371 | AEMU_SCOPED_TRACE("vkCmdSetBlendConstants readParams"); |
| 7372 | AEMU_SCOPED_TRACE("vkCmdSetBlendConstants returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7373 | mImpl->log("finish vkCmdSetBlendConstants");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7374 | } |
| 7375 | |
| 7376 | void VkEncoder::vkCmdSetDepthBounds( |
| 7377 | VkCommandBuffer commandBuffer, |
| 7378 | float minDepthBounds, |
| 7379 | float maxDepthBounds) |
| 7380 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 7381 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 7382 | AEMU_SCOPED_TRACE("vkCmdSetDepthBounds encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7383 | mImpl->log("start vkCmdSetDepthBounds"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7384 | auto stream = mImpl->stream(); |
| 7385 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7386 | auto resources = mImpl->resources(); |
| 7387 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 7388 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7389 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7390 | float local_minDepthBounds; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7391 | float local_maxDepthBounds; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 7392 | local_commandBuffer = commandBuffer; |
| 7393 | local_minDepthBounds = minDepthBounds; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7394 | local_maxDepthBounds = maxDepthBounds; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7395 | countingStream->rewind(); |
| 7396 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7397 | uint64_t cgen_var_519; |
| 7398 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_519, 1); |
| 7399 | countingStream->write((uint64_t*)&cgen_var_519, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7400 | countingStream->write((float*)&local_minDepthBounds, sizeof(float)); |
| 7401 | countingStream->write((float*)&local_maxDepthBounds, sizeof(float)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7402 | } |
| 7403 | uint32_t packetSize_vkCmdSetDepthBounds = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7404 | countingStream->rewind(); |
| 7405 | uint32_t opcode_vkCmdSetDepthBounds = OP_vkCmdSetDepthBounds; |
| 7406 | stream->write(&opcode_vkCmdSetDepthBounds, sizeof(uint32_t)); |
| 7407 | stream->write(&packetSize_vkCmdSetDepthBounds, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7408 | uint64_t cgen_var_520; |
| 7409 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_520, 1); |
| 7410 | stream->write((uint64_t*)&cgen_var_520, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7411 | stream->write((float*)&local_minDepthBounds, sizeof(float)); |
| 7412 | stream->write((float*)&local_maxDepthBounds, sizeof(float)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 7413 | AEMU_SCOPED_TRACE("vkCmdSetDepthBounds readParams"); |
| 7414 | AEMU_SCOPED_TRACE("vkCmdSetDepthBounds returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7415 | mImpl->log("finish vkCmdSetDepthBounds");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7416 | } |
| 7417 | |
| 7418 | void VkEncoder::vkCmdSetStencilCompareMask( |
| 7419 | VkCommandBuffer commandBuffer, |
| 7420 | VkStencilFaceFlags faceMask, |
| 7421 | uint32_t compareMask) |
| 7422 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 7423 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 7424 | AEMU_SCOPED_TRACE("vkCmdSetStencilCompareMask encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7425 | mImpl->log("start vkCmdSetStencilCompareMask"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7426 | auto stream = mImpl->stream(); |
| 7427 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7428 | auto resources = mImpl->resources(); |
| 7429 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 7430 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7431 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7432 | VkStencilFaceFlags local_faceMask; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7433 | uint32_t local_compareMask; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 7434 | local_commandBuffer = commandBuffer; |
| 7435 | local_faceMask = faceMask; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7436 | local_compareMask = compareMask; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7437 | countingStream->rewind(); |
| 7438 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7439 | uint64_t cgen_var_521; |
| 7440 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_521, 1); |
| 7441 | countingStream->write((uint64_t*)&cgen_var_521, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7442 | countingStream->write((VkStencilFaceFlags*)&local_faceMask, sizeof(VkStencilFaceFlags)); |
| 7443 | countingStream->write((uint32_t*)&local_compareMask, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7444 | } |
| 7445 | uint32_t packetSize_vkCmdSetStencilCompareMask = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7446 | countingStream->rewind(); |
| 7447 | uint32_t opcode_vkCmdSetStencilCompareMask = OP_vkCmdSetStencilCompareMask; |
| 7448 | stream->write(&opcode_vkCmdSetStencilCompareMask, sizeof(uint32_t)); |
| 7449 | stream->write(&packetSize_vkCmdSetStencilCompareMask, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7450 | uint64_t cgen_var_522; |
| 7451 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_522, 1); |
| 7452 | stream->write((uint64_t*)&cgen_var_522, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7453 | stream->write((VkStencilFaceFlags*)&local_faceMask, sizeof(VkStencilFaceFlags)); |
| 7454 | stream->write((uint32_t*)&local_compareMask, sizeof(uint32_t)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 7455 | AEMU_SCOPED_TRACE("vkCmdSetStencilCompareMask readParams"); |
| 7456 | AEMU_SCOPED_TRACE("vkCmdSetStencilCompareMask returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7457 | mImpl->log("finish vkCmdSetStencilCompareMask");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7458 | } |
| 7459 | |
| 7460 | void VkEncoder::vkCmdSetStencilWriteMask( |
| 7461 | VkCommandBuffer commandBuffer, |
| 7462 | VkStencilFaceFlags faceMask, |
| 7463 | uint32_t writeMask) |
| 7464 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 7465 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 7466 | AEMU_SCOPED_TRACE("vkCmdSetStencilWriteMask encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7467 | mImpl->log("start vkCmdSetStencilWriteMask"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7468 | auto stream = mImpl->stream(); |
| 7469 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7470 | auto resources = mImpl->resources(); |
| 7471 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 7472 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7473 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7474 | VkStencilFaceFlags local_faceMask; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7475 | uint32_t local_writeMask; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 7476 | local_commandBuffer = commandBuffer; |
| 7477 | local_faceMask = faceMask; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7478 | local_writeMask = writeMask; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7479 | countingStream->rewind(); |
| 7480 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7481 | uint64_t cgen_var_523; |
| 7482 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_523, 1); |
| 7483 | countingStream->write((uint64_t*)&cgen_var_523, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7484 | countingStream->write((VkStencilFaceFlags*)&local_faceMask, sizeof(VkStencilFaceFlags)); |
| 7485 | countingStream->write((uint32_t*)&local_writeMask, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7486 | } |
| 7487 | uint32_t packetSize_vkCmdSetStencilWriteMask = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7488 | countingStream->rewind(); |
| 7489 | uint32_t opcode_vkCmdSetStencilWriteMask = OP_vkCmdSetStencilWriteMask; |
| 7490 | stream->write(&opcode_vkCmdSetStencilWriteMask, sizeof(uint32_t)); |
| 7491 | stream->write(&packetSize_vkCmdSetStencilWriteMask, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7492 | uint64_t cgen_var_524; |
| 7493 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_524, 1); |
| 7494 | stream->write((uint64_t*)&cgen_var_524, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7495 | stream->write((VkStencilFaceFlags*)&local_faceMask, sizeof(VkStencilFaceFlags)); |
| 7496 | stream->write((uint32_t*)&local_writeMask, sizeof(uint32_t)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 7497 | AEMU_SCOPED_TRACE("vkCmdSetStencilWriteMask readParams"); |
| 7498 | AEMU_SCOPED_TRACE("vkCmdSetStencilWriteMask returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7499 | mImpl->log("finish vkCmdSetStencilWriteMask");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7500 | } |
| 7501 | |
| 7502 | void VkEncoder::vkCmdSetStencilReference( |
| 7503 | VkCommandBuffer commandBuffer, |
| 7504 | VkStencilFaceFlags faceMask, |
| 7505 | uint32_t reference) |
| 7506 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 7507 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 7508 | AEMU_SCOPED_TRACE("vkCmdSetStencilReference encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7509 | mImpl->log("start vkCmdSetStencilReference"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7510 | auto stream = mImpl->stream(); |
| 7511 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7512 | auto resources = mImpl->resources(); |
| 7513 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 7514 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7515 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7516 | VkStencilFaceFlags local_faceMask; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7517 | uint32_t local_reference; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 7518 | local_commandBuffer = commandBuffer; |
| 7519 | local_faceMask = faceMask; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7520 | local_reference = reference; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7521 | countingStream->rewind(); |
| 7522 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7523 | uint64_t cgen_var_525; |
| 7524 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_525, 1); |
| 7525 | countingStream->write((uint64_t*)&cgen_var_525, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7526 | countingStream->write((VkStencilFaceFlags*)&local_faceMask, sizeof(VkStencilFaceFlags)); |
| 7527 | countingStream->write((uint32_t*)&local_reference, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7528 | } |
| 7529 | uint32_t packetSize_vkCmdSetStencilReference = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7530 | countingStream->rewind(); |
| 7531 | uint32_t opcode_vkCmdSetStencilReference = OP_vkCmdSetStencilReference; |
| 7532 | stream->write(&opcode_vkCmdSetStencilReference, sizeof(uint32_t)); |
| 7533 | stream->write(&packetSize_vkCmdSetStencilReference, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7534 | uint64_t cgen_var_526; |
| 7535 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_526, 1); |
| 7536 | stream->write((uint64_t*)&cgen_var_526, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7537 | stream->write((VkStencilFaceFlags*)&local_faceMask, sizeof(VkStencilFaceFlags)); |
| 7538 | stream->write((uint32_t*)&local_reference, sizeof(uint32_t)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 7539 | AEMU_SCOPED_TRACE("vkCmdSetStencilReference readParams"); |
| 7540 | AEMU_SCOPED_TRACE("vkCmdSetStencilReference returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7541 | mImpl->log("finish vkCmdSetStencilReference");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7542 | } |
| 7543 | |
| 7544 | void VkEncoder::vkCmdBindDescriptorSets( |
| 7545 | VkCommandBuffer commandBuffer, |
| 7546 | VkPipelineBindPoint pipelineBindPoint, |
| 7547 | VkPipelineLayout layout, |
| 7548 | uint32_t firstSet, |
| 7549 | uint32_t descriptorSetCount, |
| 7550 | const VkDescriptorSet* pDescriptorSets, |
| 7551 | uint32_t dynamicOffsetCount, |
| 7552 | const uint32_t* pDynamicOffsets) |
| 7553 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 7554 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 7555 | AEMU_SCOPED_TRACE("vkCmdBindDescriptorSets encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7556 | mImpl->log("start vkCmdBindDescriptorSets"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7557 | auto stream = mImpl->stream(); |
| 7558 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7559 | auto resources = mImpl->resources(); |
| 7560 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 7561 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7562 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7563 | VkPipelineBindPoint local_pipelineBindPoint; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7564 | VkPipelineLayout local_layout; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7565 | uint32_t local_firstSet; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7566 | uint32_t local_descriptorSetCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7567 | VkDescriptorSet* local_pDescriptorSets; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 7568 | uint32_t local_dynamicOffsetCount; |
| 7569 | uint32_t* local_pDynamicOffsets; |
| 7570 | local_commandBuffer = commandBuffer; |
| 7571 | local_pipelineBindPoint = pipelineBindPoint; |
| 7572 | local_layout = layout; |
| 7573 | local_firstSet = firstSet; |
| 7574 | local_descriptorSetCount = descriptorSetCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7575 | local_pDescriptorSets = nullptr; |
| 7576 | if (pDescriptorSets) |
| 7577 | { |
| 7578 | local_pDescriptorSets = (VkDescriptorSet*)pool->dupArray(pDescriptorSets, ((descriptorSetCount)) * sizeof(const VkDescriptorSet)); |
| 7579 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7580 | local_dynamicOffsetCount = dynamicOffsetCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7581 | local_pDynamicOffsets = nullptr; |
| 7582 | if (pDynamicOffsets) |
| 7583 | { |
| 7584 | local_pDynamicOffsets = (uint32_t*)pool->dupArray(pDynamicOffsets, ((dynamicOffsetCount)) * sizeof(const uint32_t)); |
| 7585 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7586 | countingStream->rewind(); |
| 7587 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7588 | uint64_t cgen_var_527; |
| 7589 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_527, 1); |
| 7590 | countingStream->write((uint64_t*)&cgen_var_527, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7591 | countingStream->write((VkPipelineBindPoint*)&local_pipelineBindPoint, sizeof(VkPipelineBindPoint)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7592 | uint64_t cgen_var_528; |
| 7593 | countingStream->handleMapping()->mapHandles_VkPipelineLayout_u64(&local_layout, &cgen_var_528, 1); |
| 7594 | countingStream->write((uint64_t*)&cgen_var_528, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7595 | countingStream->write((uint32_t*)&local_firstSet, sizeof(uint32_t)); |
| 7596 | countingStream->write((uint32_t*)&local_descriptorSetCount, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 7597 | if (((descriptorSetCount))) |
| 7598 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7599 | uint64_t* cgen_var_529; |
| 7600 | countingStream->alloc((void**)&cgen_var_529, ((descriptorSetCount)) * 8); |
| 7601 | countingStream->handleMapping()->mapHandles_VkDescriptorSet_u64(local_pDescriptorSets, cgen_var_529, ((descriptorSetCount))); |
| 7602 | countingStream->write((uint64_t*)cgen_var_529, ((descriptorSetCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 7603 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7604 | countingStream->write((uint32_t*)&local_dynamicOffsetCount, sizeof(uint32_t)); |
| 7605 | countingStream->write((uint32_t*)local_pDynamicOffsets, ((dynamicOffsetCount)) * sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7606 | } |
| 7607 | uint32_t packetSize_vkCmdBindDescriptorSets = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7608 | countingStream->rewind(); |
| 7609 | uint32_t opcode_vkCmdBindDescriptorSets = OP_vkCmdBindDescriptorSets; |
| 7610 | stream->write(&opcode_vkCmdBindDescriptorSets, sizeof(uint32_t)); |
| 7611 | stream->write(&packetSize_vkCmdBindDescriptorSets, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7612 | uint64_t cgen_var_530; |
| 7613 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_530, 1); |
| 7614 | stream->write((uint64_t*)&cgen_var_530, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7615 | stream->write((VkPipelineBindPoint*)&local_pipelineBindPoint, sizeof(VkPipelineBindPoint)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7616 | uint64_t cgen_var_531; |
| 7617 | stream->handleMapping()->mapHandles_VkPipelineLayout_u64(&local_layout, &cgen_var_531, 1); |
| 7618 | stream->write((uint64_t*)&cgen_var_531, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7619 | stream->write((uint32_t*)&local_firstSet, sizeof(uint32_t)); |
| 7620 | stream->write((uint32_t*)&local_descriptorSetCount, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 7621 | if (((descriptorSetCount))) |
| 7622 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7623 | uint64_t* cgen_var_532; |
| 7624 | stream->alloc((void**)&cgen_var_532, ((descriptorSetCount)) * 8); |
| 7625 | stream->handleMapping()->mapHandles_VkDescriptorSet_u64(local_pDescriptorSets, cgen_var_532, ((descriptorSetCount))); |
| 7626 | stream->write((uint64_t*)cgen_var_532, ((descriptorSetCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 7627 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7628 | stream->write((uint32_t*)&local_dynamicOffsetCount, sizeof(uint32_t)); |
| 7629 | stream->write((uint32_t*)local_pDynamicOffsets, ((dynamicOffsetCount)) * sizeof(uint32_t)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 7630 | AEMU_SCOPED_TRACE("vkCmdBindDescriptorSets readParams"); |
| 7631 | AEMU_SCOPED_TRACE("vkCmdBindDescriptorSets returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7632 | mImpl->log("finish vkCmdBindDescriptorSets");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7633 | } |
| 7634 | |
| 7635 | void VkEncoder::vkCmdBindIndexBuffer( |
| 7636 | VkCommandBuffer commandBuffer, |
| 7637 | VkBuffer buffer, |
| 7638 | VkDeviceSize offset, |
| 7639 | VkIndexType indexType) |
| 7640 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 7641 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 7642 | AEMU_SCOPED_TRACE("vkCmdBindIndexBuffer encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7643 | mImpl->log("start vkCmdBindIndexBuffer"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7644 | auto stream = mImpl->stream(); |
| 7645 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7646 | auto resources = mImpl->resources(); |
| 7647 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 7648 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7649 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7650 | VkBuffer local_buffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7651 | VkDeviceSize local_offset; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7652 | VkIndexType local_indexType; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 7653 | local_commandBuffer = commandBuffer; |
| 7654 | local_buffer = buffer; |
| 7655 | local_offset = offset; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7656 | local_indexType = indexType; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7657 | countingStream->rewind(); |
| 7658 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7659 | uint64_t cgen_var_533; |
| 7660 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_533, 1); |
| 7661 | countingStream->write((uint64_t*)&cgen_var_533, 1 * 8); |
| 7662 | uint64_t cgen_var_534; |
| 7663 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_534, 1); |
| 7664 | countingStream->write((uint64_t*)&cgen_var_534, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7665 | countingStream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize)); |
| 7666 | countingStream->write((VkIndexType*)&local_indexType, sizeof(VkIndexType)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7667 | } |
| 7668 | uint32_t packetSize_vkCmdBindIndexBuffer = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7669 | countingStream->rewind(); |
| 7670 | uint32_t opcode_vkCmdBindIndexBuffer = OP_vkCmdBindIndexBuffer; |
| 7671 | stream->write(&opcode_vkCmdBindIndexBuffer, sizeof(uint32_t)); |
| 7672 | stream->write(&packetSize_vkCmdBindIndexBuffer, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7673 | uint64_t cgen_var_535; |
| 7674 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_535, 1); |
| 7675 | stream->write((uint64_t*)&cgen_var_535, 1 * 8); |
| 7676 | uint64_t cgen_var_536; |
| 7677 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_536, 1); |
| 7678 | stream->write((uint64_t*)&cgen_var_536, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7679 | stream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize)); |
| 7680 | stream->write((VkIndexType*)&local_indexType, sizeof(VkIndexType)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 7681 | AEMU_SCOPED_TRACE("vkCmdBindIndexBuffer readParams"); |
| 7682 | AEMU_SCOPED_TRACE("vkCmdBindIndexBuffer returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7683 | mImpl->log("finish vkCmdBindIndexBuffer");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7684 | } |
| 7685 | |
| 7686 | void VkEncoder::vkCmdBindVertexBuffers( |
| 7687 | VkCommandBuffer commandBuffer, |
| 7688 | uint32_t firstBinding, |
| 7689 | uint32_t bindingCount, |
| 7690 | const VkBuffer* pBuffers, |
| 7691 | const VkDeviceSize* pOffsets) |
| 7692 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 7693 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 7694 | AEMU_SCOPED_TRACE("vkCmdBindVertexBuffers encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7695 | mImpl->log("start vkCmdBindVertexBuffers"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7696 | auto stream = mImpl->stream(); |
| 7697 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7698 | auto resources = mImpl->resources(); |
| 7699 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 7700 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7701 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7702 | uint32_t local_firstBinding; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7703 | uint32_t local_bindingCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7704 | VkBuffer* local_pBuffers; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 7705 | VkDeviceSize* local_pOffsets; |
| 7706 | local_commandBuffer = commandBuffer; |
| 7707 | local_firstBinding = firstBinding; |
| 7708 | local_bindingCount = bindingCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7709 | local_pBuffers = nullptr; |
| 7710 | if (pBuffers) |
| 7711 | { |
| 7712 | local_pBuffers = (VkBuffer*)pool->dupArray(pBuffers, ((bindingCount)) * sizeof(const VkBuffer)); |
| 7713 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7714 | local_pOffsets = nullptr; |
| 7715 | if (pOffsets) |
| 7716 | { |
| 7717 | local_pOffsets = (VkDeviceSize*)pool->dupArray(pOffsets, ((bindingCount)) * sizeof(const VkDeviceSize)); |
| 7718 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7719 | countingStream->rewind(); |
| 7720 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7721 | uint64_t cgen_var_537; |
| 7722 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_537, 1); |
| 7723 | countingStream->write((uint64_t*)&cgen_var_537, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7724 | countingStream->write((uint32_t*)&local_firstBinding, sizeof(uint32_t)); |
| 7725 | countingStream->write((uint32_t*)&local_bindingCount, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 7726 | if (((bindingCount))) |
| 7727 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7728 | uint64_t* cgen_var_538; |
| 7729 | countingStream->alloc((void**)&cgen_var_538, ((bindingCount)) * 8); |
| 7730 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(local_pBuffers, cgen_var_538, ((bindingCount))); |
| 7731 | countingStream->write((uint64_t*)cgen_var_538, ((bindingCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 7732 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7733 | countingStream->write((VkDeviceSize*)local_pOffsets, ((bindingCount)) * sizeof(VkDeviceSize)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7734 | } |
| 7735 | uint32_t packetSize_vkCmdBindVertexBuffers = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7736 | countingStream->rewind(); |
| 7737 | uint32_t opcode_vkCmdBindVertexBuffers = OP_vkCmdBindVertexBuffers; |
| 7738 | stream->write(&opcode_vkCmdBindVertexBuffers, sizeof(uint32_t)); |
| 7739 | stream->write(&packetSize_vkCmdBindVertexBuffers, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7740 | uint64_t cgen_var_539; |
| 7741 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_539, 1); |
| 7742 | stream->write((uint64_t*)&cgen_var_539, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7743 | stream->write((uint32_t*)&local_firstBinding, sizeof(uint32_t)); |
| 7744 | stream->write((uint32_t*)&local_bindingCount, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 7745 | if (((bindingCount))) |
| 7746 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7747 | uint64_t* cgen_var_540; |
| 7748 | stream->alloc((void**)&cgen_var_540, ((bindingCount)) * 8); |
| 7749 | stream->handleMapping()->mapHandles_VkBuffer_u64(local_pBuffers, cgen_var_540, ((bindingCount))); |
| 7750 | stream->write((uint64_t*)cgen_var_540, ((bindingCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 7751 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7752 | stream->write((VkDeviceSize*)local_pOffsets, ((bindingCount)) * sizeof(VkDeviceSize)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 7753 | AEMU_SCOPED_TRACE("vkCmdBindVertexBuffers readParams"); |
| 7754 | AEMU_SCOPED_TRACE("vkCmdBindVertexBuffers returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7755 | mImpl->log("finish vkCmdBindVertexBuffers");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7756 | } |
| 7757 | |
| 7758 | void VkEncoder::vkCmdDraw( |
| 7759 | VkCommandBuffer commandBuffer, |
| 7760 | uint32_t vertexCount, |
| 7761 | uint32_t instanceCount, |
| 7762 | uint32_t firstVertex, |
| 7763 | uint32_t firstInstance) |
| 7764 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 7765 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 7766 | AEMU_SCOPED_TRACE("vkCmdDraw encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7767 | mImpl->log("start vkCmdDraw"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7768 | auto stream = mImpl->stream(); |
| 7769 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7770 | auto resources = mImpl->resources(); |
| 7771 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 7772 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7773 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7774 | uint32_t local_vertexCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7775 | uint32_t local_instanceCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7776 | uint32_t local_firstVertex; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7777 | uint32_t local_firstInstance; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 7778 | local_commandBuffer = commandBuffer; |
| 7779 | local_vertexCount = vertexCount; |
| 7780 | local_instanceCount = instanceCount; |
| 7781 | local_firstVertex = firstVertex; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7782 | local_firstInstance = firstInstance; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7783 | countingStream->rewind(); |
| 7784 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7785 | uint64_t cgen_var_541; |
| 7786 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_541, 1); |
| 7787 | countingStream->write((uint64_t*)&cgen_var_541, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7788 | countingStream->write((uint32_t*)&local_vertexCount, sizeof(uint32_t)); |
| 7789 | countingStream->write((uint32_t*)&local_instanceCount, sizeof(uint32_t)); |
| 7790 | countingStream->write((uint32_t*)&local_firstVertex, sizeof(uint32_t)); |
| 7791 | countingStream->write((uint32_t*)&local_firstInstance, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7792 | } |
| 7793 | uint32_t packetSize_vkCmdDraw = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7794 | countingStream->rewind(); |
| 7795 | uint32_t opcode_vkCmdDraw = OP_vkCmdDraw; |
| 7796 | stream->write(&opcode_vkCmdDraw, sizeof(uint32_t)); |
| 7797 | stream->write(&packetSize_vkCmdDraw, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7798 | uint64_t cgen_var_542; |
| 7799 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_542, 1); |
| 7800 | stream->write((uint64_t*)&cgen_var_542, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7801 | stream->write((uint32_t*)&local_vertexCount, sizeof(uint32_t)); |
| 7802 | stream->write((uint32_t*)&local_instanceCount, sizeof(uint32_t)); |
| 7803 | stream->write((uint32_t*)&local_firstVertex, sizeof(uint32_t)); |
| 7804 | stream->write((uint32_t*)&local_firstInstance, sizeof(uint32_t)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 7805 | AEMU_SCOPED_TRACE("vkCmdDraw readParams"); |
| 7806 | AEMU_SCOPED_TRACE("vkCmdDraw returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7807 | mImpl->log("finish vkCmdDraw");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7808 | } |
| 7809 | |
| 7810 | void VkEncoder::vkCmdDrawIndexed( |
| 7811 | VkCommandBuffer commandBuffer, |
| 7812 | uint32_t indexCount, |
| 7813 | uint32_t instanceCount, |
| 7814 | uint32_t firstIndex, |
| 7815 | int32_t vertexOffset, |
| 7816 | uint32_t firstInstance) |
| 7817 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 7818 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 7819 | AEMU_SCOPED_TRACE("vkCmdDrawIndexed encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7820 | mImpl->log("start vkCmdDrawIndexed"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7821 | auto stream = mImpl->stream(); |
| 7822 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7823 | auto resources = mImpl->resources(); |
| 7824 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 7825 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7826 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7827 | uint32_t local_indexCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7828 | uint32_t local_instanceCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7829 | uint32_t local_firstIndex; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7830 | int32_t local_vertexOffset; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7831 | uint32_t local_firstInstance; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 7832 | local_commandBuffer = commandBuffer; |
| 7833 | local_indexCount = indexCount; |
| 7834 | local_instanceCount = instanceCount; |
| 7835 | local_firstIndex = firstIndex; |
| 7836 | local_vertexOffset = vertexOffset; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7837 | local_firstInstance = firstInstance; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7838 | countingStream->rewind(); |
| 7839 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7840 | uint64_t cgen_var_543; |
| 7841 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_543, 1); |
| 7842 | countingStream->write((uint64_t*)&cgen_var_543, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7843 | countingStream->write((uint32_t*)&local_indexCount, sizeof(uint32_t)); |
| 7844 | countingStream->write((uint32_t*)&local_instanceCount, sizeof(uint32_t)); |
| 7845 | countingStream->write((uint32_t*)&local_firstIndex, sizeof(uint32_t)); |
| 7846 | countingStream->write((int32_t*)&local_vertexOffset, sizeof(int32_t)); |
| 7847 | countingStream->write((uint32_t*)&local_firstInstance, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7848 | } |
| 7849 | uint32_t packetSize_vkCmdDrawIndexed = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7850 | countingStream->rewind(); |
| 7851 | uint32_t opcode_vkCmdDrawIndexed = OP_vkCmdDrawIndexed; |
| 7852 | stream->write(&opcode_vkCmdDrawIndexed, sizeof(uint32_t)); |
| 7853 | stream->write(&packetSize_vkCmdDrawIndexed, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7854 | uint64_t cgen_var_544; |
| 7855 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_544, 1); |
| 7856 | stream->write((uint64_t*)&cgen_var_544, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7857 | stream->write((uint32_t*)&local_indexCount, sizeof(uint32_t)); |
| 7858 | stream->write((uint32_t*)&local_instanceCount, sizeof(uint32_t)); |
| 7859 | stream->write((uint32_t*)&local_firstIndex, sizeof(uint32_t)); |
| 7860 | stream->write((int32_t*)&local_vertexOffset, sizeof(int32_t)); |
| 7861 | stream->write((uint32_t*)&local_firstInstance, sizeof(uint32_t)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 7862 | AEMU_SCOPED_TRACE("vkCmdDrawIndexed readParams"); |
| 7863 | AEMU_SCOPED_TRACE("vkCmdDrawIndexed returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7864 | mImpl->log("finish vkCmdDrawIndexed");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7865 | } |
| 7866 | |
| 7867 | void VkEncoder::vkCmdDrawIndirect( |
| 7868 | VkCommandBuffer commandBuffer, |
| 7869 | VkBuffer buffer, |
| 7870 | VkDeviceSize offset, |
| 7871 | uint32_t drawCount, |
| 7872 | uint32_t stride) |
| 7873 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 7874 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 7875 | AEMU_SCOPED_TRACE("vkCmdDrawIndirect encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7876 | mImpl->log("start vkCmdDrawIndirect"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7877 | auto stream = mImpl->stream(); |
| 7878 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7879 | auto resources = mImpl->resources(); |
| 7880 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 7881 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7882 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7883 | VkBuffer local_buffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7884 | VkDeviceSize local_offset; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7885 | uint32_t local_drawCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7886 | uint32_t local_stride; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 7887 | local_commandBuffer = commandBuffer; |
| 7888 | local_buffer = buffer; |
| 7889 | local_offset = offset; |
| 7890 | local_drawCount = drawCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7891 | local_stride = stride; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7892 | countingStream->rewind(); |
| 7893 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7894 | uint64_t cgen_var_545; |
| 7895 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_545, 1); |
| 7896 | countingStream->write((uint64_t*)&cgen_var_545, 1 * 8); |
| 7897 | uint64_t cgen_var_546; |
| 7898 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_546, 1); |
| 7899 | countingStream->write((uint64_t*)&cgen_var_546, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7900 | countingStream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize)); |
| 7901 | countingStream->write((uint32_t*)&local_drawCount, sizeof(uint32_t)); |
| 7902 | countingStream->write((uint32_t*)&local_stride, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7903 | } |
| 7904 | uint32_t packetSize_vkCmdDrawIndirect = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7905 | countingStream->rewind(); |
| 7906 | uint32_t opcode_vkCmdDrawIndirect = OP_vkCmdDrawIndirect; |
| 7907 | stream->write(&opcode_vkCmdDrawIndirect, sizeof(uint32_t)); |
| 7908 | stream->write(&packetSize_vkCmdDrawIndirect, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7909 | uint64_t cgen_var_547; |
| 7910 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_547, 1); |
| 7911 | stream->write((uint64_t*)&cgen_var_547, 1 * 8); |
| 7912 | uint64_t cgen_var_548; |
| 7913 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_548, 1); |
| 7914 | stream->write((uint64_t*)&cgen_var_548, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7915 | stream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize)); |
| 7916 | stream->write((uint32_t*)&local_drawCount, sizeof(uint32_t)); |
| 7917 | stream->write((uint32_t*)&local_stride, sizeof(uint32_t)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 7918 | AEMU_SCOPED_TRACE("vkCmdDrawIndirect readParams"); |
| 7919 | AEMU_SCOPED_TRACE("vkCmdDrawIndirect returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7920 | mImpl->log("finish vkCmdDrawIndirect");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7921 | } |
| 7922 | |
| 7923 | void VkEncoder::vkCmdDrawIndexedIndirect( |
| 7924 | VkCommandBuffer commandBuffer, |
| 7925 | VkBuffer buffer, |
| 7926 | VkDeviceSize offset, |
| 7927 | uint32_t drawCount, |
| 7928 | uint32_t stride) |
| 7929 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 7930 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 7931 | AEMU_SCOPED_TRACE("vkCmdDrawIndexedIndirect encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7932 | mImpl->log("start vkCmdDrawIndexedIndirect"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7933 | auto stream = mImpl->stream(); |
| 7934 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7935 | auto resources = mImpl->resources(); |
| 7936 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 7937 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7938 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7939 | VkBuffer local_buffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7940 | VkDeviceSize local_offset; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7941 | uint32_t local_drawCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7942 | uint32_t local_stride; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 7943 | local_commandBuffer = commandBuffer; |
| 7944 | local_buffer = buffer; |
| 7945 | local_offset = offset; |
| 7946 | local_drawCount = drawCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7947 | local_stride = stride; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7948 | countingStream->rewind(); |
| 7949 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7950 | uint64_t cgen_var_549; |
| 7951 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_549, 1); |
| 7952 | countingStream->write((uint64_t*)&cgen_var_549, 1 * 8); |
| 7953 | uint64_t cgen_var_550; |
| 7954 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_550, 1); |
| 7955 | countingStream->write((uint64_t*)&cgen_var_550, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7956 | countingStream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize)); |
| 7957 | countingStream->write((uint32_t*)&local_drawCount, sizeof(uint32_t)); |
| 7958 | countingStream->write((uint32_t*)&local_stride, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7959 | } |
| 7960 | uint32_t packetSize_vkCmdDrawIndexedIndirect = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7961 | countingStream->rewind(); |
| 7962 | uint32_t opcode_vkCmdDrawIndexedIndirect = OP_vkCmdDrawIndexedIndirect; |
| 7963 | stream->write(&opcode_vkCmdDrawIndexedIndirect, sizeof(uint32_t)); |
| 7964 | stream->write(&packetSize_vkCmdDrawIndexedIndirect, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7965 | uint64_t cgen_var_551; |
| 7966 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_551, 1); |
| 7967 | stream->write((uint64_t*)&cgen_var_551, 1 * 8); |
| 7968 | uint64_t cgen_var_552; |
| 7969 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_552, 1); |
| 7970 | stream->write((uint64_t*)&cgen_var_552, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7971 | stream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize)); |
| 7972 | stream->write((uint32_t*)&local_drawCount, sizeof(uint32_t)); |
| 7973 | stream->write((uint32_t*)&local_stride, sizeof(uint32_t)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 7974 | AEMU_SCOPED_TRACE("vkCmdDrawIndexedIndirect readParams"); |
| 7975 | AEMU_SCOPED_TRACE("vkCmdDrawIndexedIndirect returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7976 | mImpl->log("finish vkCmdDrawIndexedIndirect");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7977 | } |
| 7978 | |
| 7979 | void VkEncoder::vkCmdDispatch( |
| 7980 | VkCommandBuffer commandBuffer, |
| 7981 | uint32_t groupCountX, |
| 7982 | uint32_t groupCountY, |
| 7983 | uint32_t groupCountZ) |
| 7984 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 7985 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 7986 | AEMU_SCOPED_TRACE("vkCmdDispatch encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7987 | mImpl->log("start vkCmdDispatch"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7988 | auto stream = mImpl->stream(); |
| 7989 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7990 | auto resources = mImpl->resources(); |
| 7991 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 7992 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7993 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7994 | uint32_t local_groupCountX; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7995 | uint32_t local_groupCountY; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7996 | uint32_t local_groupCountZ; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 7997 | local_commandBuffer = commandBuffer; |
| 7998 | local_groupCountX = groupCountX; |
| 7999 | local_groupCountY = groupCountY; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8000 | local_groupCountZ = groupCountZ; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8001 | countingStream->rewind(); |
| 8002 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 8003 | uint64_t cgen_var_553; |
| 8004 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_553, 1); |
| 8005 | countingStream->write((uint64_t*)&cgen_var_553, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8006 | countingStream->write((uint32_t*)&local_groupCountX, sizeof(uint32_t)); |
| 8007 | countingStream->write((uint32_t*)&local_groupCountY, sizeof(uint32_t)); |
| 8008 | countingStream->write((uint32_t*)&local_groupCountZ, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8009 | } |
| 8010 | uint32_t packetSize_vkCmdDispatch = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 8011 | countingStream->rewind(); |
| 8012 | uint32_t opcode_vkCmdDispatch = OP_vkCmdDispatch; |
| 8013 | stream->write(&opcode_vkCmdDispatch, sizeof(uint32_t)); |
| 8014 | stream->write(&packetSize_vkCmdDispatch, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 8015 | uint64_t cgen_var_554; |
| 8016 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_554, 1); |
| 8017 | stream->write((uint64_t*)&cgen_var_554, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8018 | stream->write((uint32_t*)&local_groupCountX, sizeof(uint32_t)); |
| 8019 | stream->write((uint32_t*)&local_groupCountY, sizeof(uint32_t)); |
| 8020 | stream->write((uint32_t*)&local_groupCountZ, sizeof(uint32_t)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 8021 | AEMU_SCOPED_TRACE("vkCmdDispatch readParams"); |
| 8022 | AEMU_SCOPED_TRACE("vkCmdDispatch returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 8023 | mImpl->log("finish vkCmdDispatch");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8024 | } |
| 8025 | |
| 8026 | void VkEncoder::vkCmdDispatchIndirect( |
| 8027 | VkCommandBuffer commandBuffer, |
| 8028 | VkBuffer buffer, |
| 8029 | VkDeviceSize offset) |
| 8030 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 8031 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 8032 | AEMU_SCOPED_TRACE("vkCmdDispatchIndirect encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 8033 | mImpl->log("start vkCmdDispatchIndirect"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8034 | auto stream = mImpl->stream(); |
| 8035 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8036 | auto resources = mImpl->resources(); |
| 8037 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 8038 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8039 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8040 | VkBuffer local_buffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8041 | VkDeviceSize local_offset; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 8042 | local_commandBuffer = commandBuffer; |
| 8043 | local_buffer = buffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8044 | local_offset = offset; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8045 | countingStream->rewind(); |
| 8046 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 8047 | uint64_t cgen_var_555; |
| 8048 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_555, 1); |
| 8049 | countingStream->write((uint64_t*)&cgen_var_555, 1 * 8); |
| 8050 | uint64_t cgen_var_556; |
| 8051 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_556, 1); |
| 8052 | countingStream->write((uint64_t*)&cgen_var_556, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8053 | countingStream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8054 | } |
| 8055 | uint32_t packetSize_vkCmdDispatchIndirect = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 8056 | countingStream->rewind(); |
| 8057 | uint32_t opcode_vkCmdDispatchIndirect = OP_vkCmdDispatchIndirect; |
| 8058 | stream->write(&opcode_vkCmdDispatchIndirect, sizeof(uint32_t)); |
| 8059 | stream->write(&packetSize_vkCmdDispatchIndirect, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 8060 | uint64_t cgen_var_557; |
| 8061 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_557, 1); |
| 8062 | stream->write((uint64_t*)&cgen_var_557, 1 * 8); |
| 8063 | uint64_t cgen_var_558; |
| 8064 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_558, 1); |
| 8065 | stream->write((uint64_t*)&cgen_var_558, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8066 | stream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 8067 | AEMU_SCOPED_TRACE("vkCmdDispatchIndirect readParams"); |
| 8068 | AEMU_SCOPED_TRACE("vkCmdDispatchIndirect returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 8069 | mImpl->log("finish vkCmdDispatchIndirect");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8070 | } |
| 8071 | |
| 8072 | void VkEncoder::vkCmdCopyBuffer( |
| 8073 | VkCommandBuffer commandBuffer, |
| 8074 | VkBuffer srcBuffer, |
| 8075 | VkBuffer dstBuffer, |
| 8076 | uint32_t regionCount, |
| 8077 | const VkBufferCopy* pRegions) |
| 8078 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 8079 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 8080 | AEMU_SCOPED_TRACE("vkCmdCopyBuffer encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 8081 | mImpl->log("start vkCmdCopyBuffer"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8082 | auto stream = mImpl->stream(); |
| 8083 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8084 | auto resources = mImpl->resources(); |
| 8085 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 8086 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8087 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8088 | VkBuffer local_srcBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8089 | VkBuffer local_dstBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8090 | uint32_t local_regionCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8091 | VkBufferCopy* local_pRegions; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 8092 | local_commandBuffer = commandBuffer; |
| 8093 | local_srcBuffer = srcBuffer; |
| 8094 | local_dstBuffer = dstBuffer; |
| 8095 | local_regionCount = regionCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8096 | local_pRegions = nullptr; |
| 8097 | if (pRegions) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8098 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8099 | local_pRegions = (VkBufferCopy*)pool->alloc(((regionCount)) * sizeof(const VkBufferCopy)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8100 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 8101 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8102 | deepcopy_VkBufferCopy(pool, pRegions + i, (VkBufferCopy*)(local_pRegions + i)); |
| 8103 | } |
| 8104 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 8105 | if (local_pRegions) |
| 8106 | { |
| 8107 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 8108 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 8109 | transform_tohost_VkBufferCopy(mImpl->resources(), (VkBufferCopy*)(local_pRegions + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 8110 | } |
| 8111 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8112 | countingStream->rewind(); |
| 8113 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 8114 | uint64_t cgen_var_559; |
| 8115 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_559, 1); |
| 8116 | countingStream->write((uint64_t*)&cgen_var_559, 1 * 8); |
| 8117 | uint64_t cgen_var_560; |
| 8118 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_srcBuffer, &cgen_var_560, 1); |
| 8119 | countingStream->write((uint64_t*)&cgen_var_560, 1 * 8); |
| 8120 | uint64_t cgen_var_561; |
| 8121 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_dstBuffer, &cgen_var_561, 1); |
| 8122 | countingStream->write((uint64_t*)&cgen_var_561, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8123 | countingStream->write((uint32_t*)&local_regionCount, sizeof(uint32_t)); |
| 8124 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 8125 | { |
| 8126 | marshal_VkBufferCopy(countingStream, (VkBufferCopy*)(local_pRegions + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8127 | } |
| 8128 | } |
| 8129 | uint32_t packetSize_vkCmdCopyBuffer = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 8130 | countingStream->rewind(); |
| 8131 | uint32_t opcode_vkCmdCopyBuffer = OP_vkCmdCopyBuffer; |
| 8132 | stream->write(&opcode_vkCmdCopyBuffer, sizeof(uint32_t)); |
| 8133 | stream->write(&packetSize_vkCmdCopyBuffer, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 8134 | uint64_t cgen_var_562; |
| 8135 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_562, 1); |
| 8136 | stream->write((uint64_t*)&cgen_var_562, 1 * 8); |
| 8137 | uint64_t cgen_var_563; |
| 8138 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_srcBuffer, &cgen_var_563, 1); |
| 8139 | stream->write((uint64_t*)&cgen_var_563, 1 * 8); |
| 8140 | uint64_t cgen_var_564; |
| 8141 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_dstBuffer, &cgen_var_564, 1); |
| 8142 | stream->write((uint64_t*)&cgen_var_564, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8143 | stream->write((uint32_t*)&local_regionCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8144 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 8145 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8146 | marshal_VkBufferCopy(stream, (VkBufferCopy*)(local_pRegions + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8147 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 8148 | AEMU_SCOPED_TRACE("vkCmdCopyBuffer readParams"); |
| 8149 | AEMU_SCOPED_TRACE("vkCmdCopyBuffer returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 8150 | mImpl->log("finish vkCmdCopyBuffer");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8151 | } |
| 8152 | |
| 8153 | void VkEncoder::vkCmdCopyImage( |
| 8154 | VkCommandBuffer commandBuffer, |
| 8155 | VkImage srcImage, |
| 8156 | VkImageLayout srcImageLayout, |
| 8157 | VkImage dstImage, |
| 8158 | VkImageLayout dstImageLayout, |
| 8159 | uint32_t regionCount, |
| 8160 | const VkImageCopy* pRegions) |
| 8161 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 8162 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 8163 | AEMU_SCOPED_TRACE("vkCmdCopyImage encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 8164 | mImpl->log("start vkCmdCopyImage"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8165 | auto stream = mImpl->stream(); |
| 8166 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8167 | auto resources = mImpl->resources(); |
| 8168 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 8169 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8170 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8171 | VkImage local_srcImage; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8172 | VkImageLayout local_srcImageLayout; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8173 | VkImage local_dstImage; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8174 | VkImageLayout local_dstImageLayout; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8175 | uint32_t local_regionCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8176 | VkImageCopy* local_pRegions; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 8177 | local_commandBuffer = commandBuffer; |
| 8178 | local_srcImage = srcImage; |
| 8179 | local_srcImageLayout = srcImageLayout; |
| 8180 | local_dstImage = dstImage; |
| 8181 | local_dstImageLayout = dstImageLayout; |
| 8182 | local_regionCount = regionCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8183 | local_pRegions = nullptr; |
| 8184 | if (pRegions) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8185 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8186 | local_pRegions = (VkImageCopy*)pool->alloc(((regionCount)) * sizeof(const VkImageCopy)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8187 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 8188 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8189 | deepcopy_VkImageCopy(pool, pRegions + i, (VkImageCopy*)(local_pRegions + i)); |
| 8190 | } |
| 8191 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 8192 | if (local_pRegions) |
| 8193 | { |
| 8194 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 8195 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 8196 | transform_tohost_VkImageCopy(mImpl->resources(), (VkImageCopy*)(local_pRegions + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 8197 | } |
| 8198 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8199 | countingStream->rewind(); |
| 8200 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 8201 | uint64_t cgen_var_565; |
| 8202 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_565, 1); |
| 8203 | countingStream->write((uint64_t*)&cgen_var_565, 1 * 8); |
| 8204 | uint64_t cgen_var_566; |
| 8205 | countingStream->handleMapping()->mapHandles_VkImage_u64(&local_srcImage, &cgen_var_566, 1); |
| 8206 | countingStream->write((uint64_t*)&cgen_var_566, 1 * 8); |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 8207 | countingStream->write((VkImageLayout*)&local_srcImageLayout, sizeof(VkImageLayout)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 8208 | uint64_t cgen_var_567; |
| 8209 | countingStream->handleMapping()->mapHandles_VkImage_u64(&local_dstImage, &cgen_var_567, 1); |
| 8210 | countingStream->write((uint64_t*)&cgen_var_567, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8211 | countingStream->write((VkImageLayout*)&local_dstImageLayout, sizeof(VkImageLayout)); |
| 8212 | countingStream->write((uint32_t*)&local_regionCount, sizeof(uint32_t)); |
| 8213 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 8214 | { |
| 8215 | marshal_VkImageCopy(countingStream, (VkImageCopy*)(local_pRegions + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8216 | } |
| 8217 | } |
| 8218 | uint32_t packetSize_vkCmdCopyImage = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 8219 | countingStream->rewind(); |
| 8220 | uint32_t opcode_vkCmdCopyImage = OP_vkCmdCopyImage; |
| 8221 | stream->write(&opcode_vkCmdCopyImage, sizeof(uint32_t)); |
| 8222 | stream->write(&packetSize_vkCmdCopyImage, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 8223 | uint64_t cgen_var_568; |
| 8224 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_568, 1); |
| 8225 | stream->write((uint64_t*)&cgen_var_568, 1 * 8); |
| 8226 | uint64_t cgen_var_569; |
| 8227 | stream->handleMapping()->mapHandles_VkImage_u64(&local_srcImage, &cgen_var_569, 1); |
| 8228 | stream->write((uint64_t*)&cgen_var_569, 1 * 8); |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 8229 | stream->write((VkImageLayout*)&local_srcImageLayout, sizeof(VkImageLayout)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 8230 | uint64_t cgen_var_570; |
| 8231 | stream->handleMapping()->mapHandles_VkImage_u64(&local_dstImage, &cgen_var_570, 1); |
| 8232 | stream->write((uint64_t*)&cgen_var_570, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8233 | stream->write((VkImageLayout*)&local_dstImageLayout, sizeof(VkImageLayout)); |
| 8234 | stream->write((uint32_t*)&local_regionCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8235 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 8236 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8237 | marshal_VkImageCopy(stream, (VkImageCopy*)(local_pRegions + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8238 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 8239 | AEMU_SCOPED_TRACE("vkCmdCopyImage readParams"); |
| 8240 | AEMU_SCOPED_TRACE("vkCmdCopyImage returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 8241 | mImpl->log("finish vkCmdCopyImage");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8242 | } |
| 8243 | |
| 8244 | void VkEncoder::vkCmdBlitImage( |
| 8245 | VkCommandBuffer commandBuffer, |
| 8246 | VkImage srcImage, |
| 8247 | VkImageLayout srcImageLayout, |
| 8248 | VkImage dstImage, |
| 8249 | VkImageLayout dstImageLayout, |
| 8250 | uint32_t regionCount, |
| 8251 | const VkImageBlit* pRegions, |
| 8252 | VkFilter filter) |
| 8253 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 8254 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 8255 | AEMU_SCOPED_TRACE("vkCmdBlitImage encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 8256 | mImpl->log("start vkCmdBlitImage"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8257 | auto stream = mImpl->stream(); |
| 8258 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8259 | auto resources = mImpl->resources(); |
| 8260 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 8261 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8262 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8263 | VkImage local_srcImage; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8264 | VkImageLayout local_srcImageLayout; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8265 | VkImage local_dstImage; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8266 | VkImageLayout local_dstImageLayout; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8267 | uint32_t local_regionCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8268 | VkImageBlit* local_pRegions; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 8269 | VkFilter local_filter; |
| 8270 | local_commandBuffer = commandBuffer; |
| 8271 | local_srcImage = srcImage; |
| 8272 | local_srcImageLayout = srcImageLayout; |
| 8273 | local_dstImage = dstImage; |
| 8274 | local_dstImageLayout = dstImageLayout; |
| 8275 | local_regionCount = regionCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8276 | local_pRegions = nullptr; |
| 8277 | if (pRegions) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8278 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8279 | local_pRegions = (VkImageBlit*)pool->alloc(((regionCount)) * sizeof(const VkImageBlit)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8280 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 8281 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8282 | deepcopy_VkImageBlit(pool, pRegions + i, (VkImageBlit*)(local_pRegions + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8283 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8284 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8285 | local_filter = filter; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 8286 | if (local_pRegions) |
| 8287 | { |
| 8288 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 8289 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 8290 | transform_tohost_VkImageBlit(mImpl->resources(), (VkImageBlit*)(local_pRegions + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 8291 | } |
| 8292 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8293 | countingStream->rewind(); |
| 8294 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 8295 | uint64_t cgen_var_571; |
| 8296 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_571, 1); |
| 8297 | countingStream->write((uint64_t*)&cgen_var_571, 1 * 8); |
| 8298 | uint64_t cgen_var_572; |
| 8299 | countingStream->handleMapping()->mapHandles_VkImage_u64(&local_srcImage, &cgen_var_572, 1); |
| 8300 | countingStream->write((uint64_t*)&cgen_var_572, 1 * 8); |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 8301 | countingStream->write((VkImageLayout*)&local_srcImageLayout, sizeof(VkImageLayout)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 8302 | uint64_t cgen_var_573; |
| 8303 | countingStream->handleMapping()->mapHandles_VkImage_u64(&local_dstImage, &cgen_var_573, 1); |
| 8304 | countingStream->write((uint64_t*)&cgen_var_573, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8305 | countingStream->write((VkImageLayout*)&local_dstImageLayout, sizeof(VkImageLayout)); |
| 8306 | countingStream->write((uint32_t*)&local_regionCount, sizeof(uint32_t)); |
| 8307 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 8308 | { |
| 8309 | marshal_VkImageBlit(countingStream, (VkImageBlit*)(local_pRegions + i)); |
| 8310 | } |
| 8311 | countingStream->write((VkFilter*)&local_filter, sizeof(VkFilter)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8312 | } |
| 8313 | uint32_t packetSize_vkCmdBlitImage = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 8314 | countingStream->rewind(); |
| 8315 | uint32_t opcode_vkCmdBlitImage = OP_vkCmdBlitImage; |
| 8316 | stream->write(&opcode_vkCmdBlitImage, sizeof(uint32_t)); |
| 8317 | stream->write(&packetSize_vkCmdBlitImage, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 8318 | uint64_t cgen_var_574; |
| 8319 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_574, 1); |
| 8320 | stream->write((uint64_t*)&cgen_var_574, 1 * 8); |
| 8321 | uint64_t cgen_var_575; |
| 8322 | stream->handleMapping()->mapHandles_VkImage_u64(&local_srcImage, &cgen_var_575, 1); |
| 8323 | stream->write((uint64_t*)&cgen_var_575, 1 * 8); |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 8324 | stream->write((VkImageLayout*)&local_srcImageLayout, sizeof(VkImageLayout)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 8325 | uint64_t cgen_var_576; |
| 8326 | stream->handleMapping()->mapHandles_VkImage_u64(&local_dstImage, &cgen_var_576, 1); |
| 8327 | stream->write((uint64_t*)&cgen_var_576, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8328 | stream->write((VkImageLayout*)&local_dstImageLayout, sizeof(VkImageLayout)); |
| 8329 | stream->write((uint32_t*)&local_regionCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8330 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 8331 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8332 | marshal_VkImageBlit(stream, (VkImageBlit*)(local_pRegions + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8333 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8334 | stream->write((VkFilter*)&local_filter, sizeof(VkFilter)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 8335 | AEMU_SCOPED_TRACE("vkCmdBlitImage readParams"); |
| 8336 | AEMU_SCOPED_TRACE("vkCmdBlitImage returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 8337 | mImpl->log("finish vkCmdBlitImage");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8338 | } |
| 8339 | |
| 8340 | void VkEncoder::vkCmdCopyBufferToImage( |
| 8341 | VkCommandBuffer commandBuffer, |
| 8342 | VkBuffer srcBuffer, |
| 8343 | VkImage dstImage, |
| 8344 | VkImageLayout dstImageLayout, |
| 8345 | uint32_t regionCount, |
| 8346 | const VkBufferImageCopy* pRegions) |
| 8347 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 8348 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 8349 | AEMU_SCOPED_TRACE("vkCmdCopyBufferToImage encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 8350 | mImpl->log("start vkCmdCopyBufferToImage"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8351 | auto stream = mImpl->stream(); |
| 8352 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8353 | auto resources = mImpl->resources(); |
| 8354 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 8355 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8356 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8357 | VkBuffer local_srcBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8358 | VkImage local_dstImage; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8359 | VkImageLayout local_dstImageLayout; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8360 | uint32_t local_regionCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8361 | VkBufferImageCopy* local_pRegions; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 8362 | local_commandBuffer = commandBuffer; |
| 8363 | local_srcBuffer = srcBuffer; |
| 8364 | local_dstImage = dstImage; |
| 8365 | local_dstImageLayout = dstImageLayout; |
| 8366 | local_regionCount = regionCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8367 | local_pRegions = nullptr; |
| 8368 | if (pRegions) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8369 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8370 | local_pRegions = (VkBufferImageCopy*)pool->alloc(((regionCount)) * sizeof(const VkBufferImageCopy)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8371 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 8372 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8373 | deepcopy_VkBufferImageCopy(pool, pRegions + i, (VkBufferImageCopy*)(local_pRegions + i)); |
| 8374 | } |
| 8375 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 8376 | if (local_pRegions) |
| 8377 | { |
| 8378 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 8379 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 8380 | transform_tohost_VkBufferImageCopy(mImpl->resources(), (VkBufferImageCopy*)(local_pRegions + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 8381 | } |
| 8382 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8383 | countingStream->rewind(); |
| 8384 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 8385 | uint64_t cgen_var_577; |
| 8386 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_577, 1); |
| 8387 | countingStream->write((uint64_t*)&cgen_var_577, 1 * 8); |
| 8388 | uint64_t cgen_var_578; |
| 8389 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_srcBuffer, &cgen_var_578, 1); |
| 8390 | countingStream->write((uint64_t*)&cgen_var_578, 1 * 8); |
| 8391 | uint64_t cgen_var_579; |
| 8392 | countingStream->handleMapping()->mapHandles_VkImage_u64(&local_dstImage, &cgen_var_579, 1); |
| 8393 | countingStream->write((uint64_t*)&cgen_var_579, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8394 | countingStream->write((VkImageLayout*)&local_dstImageLayout, sizeof(VkImageLayout)); |
| 8395 | countingStream->write((uint32_t*)&local_regionCount, sizeof(uint32_t)); |
| 8396 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 8397 | { |
| 8398 | marshal_VkBufferImageCopy(countingStream, (VkBufferImageCopy*)(local_pRegions + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8399 | } |
| 8400 | } |
| 8401 | uint32_t packetSize_vkCmdCopyBufferToImage = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 8402 | countingStream->rewind(); |
| 8403 | uint32_t opcode_vkCmdCopyBufferToImage = OP_vkCmdCopyBufferToImage; |
| 8404 | stream->write(&opcode_vkCmdCopyBufferToImage, sizeof(uint32_t)); |
| 8405 | stream->write(&packetSize_vkCmdCopyBufferToImage, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 8406 | uint64_t cgen_var_580; |
| 8407 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_580, 1); |
| 8408 | stream->write((uint64_t*)&cgen_var_580, 1 * 8); |
| 8409 | uint64_t cgen_var_581; |
| 8410 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_srcBuffer, &cgen_var_581, 1); |
| 8411 | stream->write((uint64_t*)&cgen_var_581, 1 * 8); |
| 8412 | uint64_t cgen_var_582; |
| 8413 | stream->handleMapping()->mapHandles_VkImage_u64(&local_dstImage, &cgen_var_582, 1); |
| 8414 | stream->write((uint64_t*)&cgen_var_582, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8415 | stream->write((VkImageLayout*)&local_dstImageLayout, sizeof(VkImageLayout)); |
| 8416 | stream->write((uint32_t*)&local_regionCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8417 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 8418 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8419 | marshal_VkBufferImageCopy(stream, (VkBufferImageCopy*)(local_pRegions + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8420 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 8421 | AEMU_SCOPED_TRACE("vkCmdCopyBufferToImage readParams"); |
| 8422 | AEMU_SCOPED_TRACE("vkCmdCopyBufferToImage returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 8423 | mImpl->log("finish vkCmdCopyBufferToImage");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8424 | } |
| 8425 | |
| 8426 | void VkEncoder::vkCmdCopyImageToBuffer( |
| 8427 | VkCommandBuffer commandBuffer, |
| 8428 | VkImage srcImage, |
| 8429 | VkImageLayout srcImageLayout, |
| 8430 | VkBuffer dstBuffer, |
| 8431 | uint32_t regionCount, |
| 8432 | const VkBufferImageCopy* pRegions) |
| 8433 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 8434 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 8435 | AEMU_SCOPED_TRACE("vkCmdCopyImageToBuffer encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 8436 | mImpl->log("start vkCmdCopyImageToBuffer"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8437 | auto stream = mImpl->stream(); |
| 8438 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8439 | auto resources = mImpl->resources(); |
| 8440 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 8441 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8442 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8443 | VkImage local_srcImage; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8444 | VkImageLayout local_srcImageLayout; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8445 | VkBuffer local_dstBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8446 | uint32_t local_regionCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8447 | VkBufferImageCopy* local_pRegions; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 8448 | local_commandBuffer = commandBuffer; |
| 8449 | local_srcImage = srcImage; |
| 8450 | local_srcImageLayout = srcImageLayout; |
| 8451 | local_dstBuffer = dstBuffer; |
| 8452 | local_regionCount = regionCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8453 | local_pRegions = nullptr; |
| 8454 | if (pRegions) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8455 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8456 | local_pRegions = (VkBufferImageCopy*)pool->alloc(((regionCount)) * sizeof(const VkBufferImageCopy)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8457 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 8458 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8459 | deepcopy_VkBufferImageCopy(pool, pRegions + i, (VkBufferImageCopy*)(local_pRegions + i)); |
| 8460 | } |
| 8461 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 8462 | if (local_pRegions) |
| 8463 | { |
| 8464 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 8465 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 8466 | transform_tohost_VkBufferImageCopy(mImpl->resources(), (VkBufferImageCopy*)(local_pRegions + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 8467 | } |
| 8468 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8469 | countingStream->rewind(); |
| 8470 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 8471 | uint64_t cgen_var_583; |
| 8472 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_583, 1); |
| 8473 | countingStream->write((uint64_t*)&cgen_var_583, 1 * 8); |
| 8474 | uint64_t cgen_var_584; |
| 8475 | countingStream->handleMapping()->mapHandles_VkImage_u64(&local_srcImage, &cgen_var_584, 1); |
| 8476 | countingStream->write((uint64_t*)&cgen_var_584, 1 * 8); |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 8477 | countingStream->write((VkImageLayout*)&local_srcImageLayout, sizeof(VkImageLayout)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 8478 | uint64_t cgen_var_585; |
| 8479 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_dstBuffer, &cgen_var_585, 1); |
| 8480 | countingStream->write((uint64_t*)&cgen_var_585, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8481 | countingStream->write((uint32_t*)&local_regionCount, sizeof(uint32_t)); |
| 8482 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 8483 | { |
| 8484 | marshal_VkBufferImageCopy(countingStream, (VkBufferImageCopy*)(local_pRegions + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8485 | } |
| 8486 | } |
| 8487 | uint32_t packetSize_vkCmdCopyImageToBuffer = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 8488 | countingStream->rewind(); |
| 8489 | uint32_t opcode_vkCmdCopyImageToBuffer = OP_vkCmdCopyImageToBuffer; |
| 8490 | stream->write(&opcode_vkCmdCopyImageToBuffer, sizeof(uint32_t)); |
| 8491 | stream->write(&packetSize_vkCmdCopyImageToBuffer, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 8492 | uint64_t cgen_var_586; |
| 8493 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_586, 1); |
| 8494 | stream->write((uint64_t*)&cgen_var_586, 1 * 8); |
| 8495 | uint64_t cgen_var_587; |
| 8496 | stream->handleMapping()->mapHandles_VkImage_u64(&local_srcImage, &cgen_var_587, 1); |
| 8497 | stream->write((uint64_t*)&cgen_var_587, 1 * 8); |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 8498 | stream->write((VkImageLayout*)&local_srcImageLayout, sizeof(VkImageLayout)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 8499 | uint64_t cgen_var_588; |
| 8500 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_dstBuffer, &cgen_var_588, 1); |
| 8501 | stream->write((uint64_t*)&cgen_var_588, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8502 | stream->write((uint32_t*)&local_regionCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8503 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 8504 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8505 | marshal_VkBufferImageCopy(stream, (VkBufferImageCopy*)(local_pRegions + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8506 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 8507 | AEMU_SCOPED_TRACE("vkCmdCopyImageToBuffer readParams"); |
| 8508 | AEMU_SCOPED_TRACE("vkCmdCopyImageToBuffer returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 8509 | mImpl->log("finish vkCmdCopyImageToBuffer");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8510 | } |
| 8511 | |
| 8512 | void VkEncoder::vkCmdUpdateBuffer( |
| 8513 | VkCommandBuffer commandBuffer, |
| 8514 | VkBuffer dstBuffer, |
| 8515 | VkDeviceSize dstOffset, |
| 8516 | VkDeviceSize dataSize, |
| 8517 | const void* pData) |
| 8518 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 8519 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 8520 | AEMU_SCOPED_TRACE("vkCmdUpdateBuffer encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 8521 | mImpl->log("start vkCmdUpdateBuffer"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8522 | auto stream = mImpl->stream(); |
| 8523 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8524 | auto resources = mImpl->resources(); |
| 8525 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 8526 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8527 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8528 | VkBuffer local_dstBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8529 | VkDeviceSize local_dstOffset; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8530 | VkDeviceSize local_dataSize; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8531 | void* local_pData; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 8532 | local_commandBuffer = commandBuffer; |
| 8533 | local_dstBuffer = dstBuffer; |
| 8534 | local_dstOffset = dstOffset; |
| 8535 | local_dataSize = dataSize; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8536 | local_pData = nullptr; |
| 8537 | if (pData) |
| 8538 | { |
| 8539 | local_pData = (void*)pool->dupArray(pData, ((dataSize)) * sizeof(const uint8_t)); |
| 8540 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8541 | countingStream->rewind(); |
| 8542 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 8543 | uint64_t cgen_var_589; |
| 8544 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_589, 1); |
| 8545 | countingStream->write((uint64_t*)&cgen_var_589, 1 * 8); |
| 8546 | uint64_t cgen_var_590; |
| 8547 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_dstBuffer, &cgen_var_590, 1); |
| 8548 | countingStream->write((uint64_t*)&cgen_var_590, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8549 | countingStream->write((VkDeviceSize*)&local_dstOffset, sizeof(VkDeviceSize)); |
| 8550 | countingStream->write((VkDeviceSize*)&local_dataSize, sizeof(VkDeviceSize)); |
| 8551 | countingStream->write((void*)local_pData, ((dataSize)) * sizeof(uint8_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8552 | } |
| 8553 | uint32_t packetSize_vkCmdUpdateBuffer = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 8554 | countingStream->rewind(); |
| 8555 | uint32_t opcode_vkCmdUpdateBuffer = OP_vkCmdUpdateBuffer; |
| 8556 | stream->write(&opcode_vkCmdUpdateBuffer, sizeof(uint32_t)); |
| 8557 | stream->write(&packetSize_vkCmdUpdateBuffer, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 8558 | uint64_t cgen_var_591; |
| 8559 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_591, 1); |
| 8560 | stream->write((uint64_t*)&cgen_var_591, 1 * 8); |
| 8561 | uint64_t cgen_var_592; |
| 8562 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_dstBuffer, &cgen_var_592, 1); |
| 8563 | stream->write((uint64_t*)&cgen_var_592, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8564 | stream->write((VkDeviceSize*)&local_dstOffset, sizeof(VkDeviceSize)); |
| 8565 | stream->write((VkDeviceSize*)&local_dataSize, sizeof(VkDeviceSize)); |
| 8566 | stream->write((void*)local_pData, ((dataSize)) * sizeof(uint8_t)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 8567 | AEMU_SCOPED_TRACE("vkCmdUpdateBuffer readParams"); |
| 8568 | AEMU_SCOPED_TRACE("vkCmdUpdateBuffer returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 8569 | mImpl->log("finish vkCmdUpdateBuffer");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8570 | } |
| 8571 | |
| 8572 | void VkEncoder::vkCmdFillBuffer( |
| 8573 | VkCommandBuffer commandBuffer, |
| 8574 | VkBuffer dstBuffer, |
| 8575 | VkDeviceSize dstOffset, |
| 8576 | VkDeviceSize size, |
| 8577 | uint32_t data) |
| 8578 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 8579 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 8580 | AEMU_SCOPED_TRACE("vkCmdFillBuffer encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 8581 | mImpl->log("start vkCmdFillBuffer"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8582 | auto stream = mImpl->stream(); |
| 8583 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8584 | auto resources = mImpl->resources(); |
| 8585 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 8586 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8587 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8588 | VkBuffer local_dstBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8589 | VkDeviceSize local_dstOffset; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8590 | VkDeviceSize local_size; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8591 | uint32_t local_data; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 8592 | local_commandBuffer = commandBuffer; |
| 8593 | local_dstBuffer = dstBuffer; |
| 8594 | local_dstOffset = dstOffset; |
| 8595 | local_size = size; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8596 | local_data = data; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8597 | countingStream->rewind(); |
| 8598 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 8599 | uint64_t cgen_var_593; |
| 8600 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_593, 1); |
| 8601 | countingStream->write((uint64_t*)&cgen_var_593, 1 * 8); |
| 8602 | uint64_t cgen_var_594; |
| 8603 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_dstBuffer, &cgen_var_594, 1); |
| 8604 | countingStream->write((uint64_t*)&cgen_var_594, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8605 | countingStream->write((VkDeviceSize*)&local_dstOffset, sizeof(VkDeviceSize)); |
| 8606 | countingStream->write((VkDeviceSize*)&local_size, sizeof(VkDeviceSize)); |
| 8607 | countingStream->write((uint32_t*)&local_data, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8608 | } |
| 8609 | uint32_t packetSize_vkCmdFillBuffer = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 8610 | countingStream->rewind(); |
| 8611 | uint32_t opcode_vkCmdFillBuffer = OP_vkCmdFillBuffer; |
| 8612 | stream->write(&opcode_vkCmdFillBuffer, sizeof(uint32_t)); |
| 8613 | stream->write(&packetSize_vkCmdFillBuffer, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 8614 | uint64_t cgen_var_595; |
| 8615 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_595, 1); |
| 8616 | stream->write((uint64_t*)&cgen_var_595, 1 * 8); |
| 8617 | uint64_t cgen_var_596; |
| 8618 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_dstBuffer, &cgen_var_596, 1); |
| 8619 | stream->write((uint64_t*)&cgen_var_596, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8620 | stream->write((VkDeviceSize*)&local_dstOffset, sizeof(VkDeviceSize)); |
| 8621 | stream->write((VkDeviceSize*)&local_size, sizeof(VkDeviceSize)); |
| 8622 | stream->write((uint32_t*)&local_data, sizeof(uint32_t)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 8623 | AEMU_SCOPED_TRACE("vkCmdFillBuffer readParams"); |
| 8624 | AEMU_SCOPED_TRACE("vkCmdFillBuffer returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 8625 | mImpl->log("finish vkCmdFillBuffer");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8626 | } |
| 8627 | |
| 8628 | void VkEncoder::vkCmdClearColorImage( |
| 8629 | VkCommandBuffer commandBuffer, |
| 8630 | VkImage image, |
| 8631 | VkImageLayout imageLayout, |
| 8632 | const VkClearColorValue* pColor, |
| 8633 | uint32_t rangeCount, |
| 8634 | const VkImageSubresourceRange* pRanges) |
| 8635 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 8636 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 8637 | AEMU_SCOPED_TRACE("vkCmdClearColorImage encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 8638 | mImpl->log("start vkCmdClearColorImage"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8639 | auto stream = mImpl->stream(); |
| 8640 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8641 | auto resources = mImpl->resources(); |
| 8642 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 8643 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8644 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8645 | VkImage local_image; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8646 | VkImageLayout local_imageLayout; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8647 | VkClearColorValue* local_pColor; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 8648 | uint32_t local_rangeCount; |
| 8649 | VkImageSubresourceRange* local_pRanges; |
| 8650 | local_commandBuffer = commandBuffer; |
| 8651 | local_image = image; |
| 8652 | local_imageLayout = imageLayout; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8653 | local_pColor = nullptr; |
| 8654 | if (pColor) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8655 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8656 | local_pColor = (VkClearColorValue*)pool->alloc(sizeof(const VkClearColorValue)); |
| 8657 | deepcopy_VkClearColorValue(pool, pColor, (VkClearColorValue*)(local_pColor)); |
| 8658 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8659 | local_rangeCount = rangeCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8660 | local_pRanges = nullptr; |
| 8661 | if (pRanges) |
| 8662 | { |
| 8663 | local_pRanges = (VkImageSubresourceRange*)pool->alloc(((rangeCount)) * sizeof(const VkImageSubresourceRange)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8664 | for (uint32_t i = 0; i < (uint32_t)((rangeCount)); ++i) |
| 8665 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8666 | deepcopy_VkImageSubresourceRange(pool, pRanges + i, (VkImageSubresourceRange*)(local_pRanges + i)); |
| 8667 | } |
| 8668 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 8669 | if (local_pColor) |
| 8670 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 8671 | transform_tohost_VkClearColorValue(mImpl->resources(), (VkClearColorValue*)(local_pColor)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 8672 | } |
| 8673 | if (local_pRanges) |
| 8674 | { |
| 8675 | for (uint32_t i = 0; i < (uint32_t)((rangeCount)); ++i) |
| 8676 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 8677 | transform_tohost_VkImageSubresourceRange(mImpl->resources(), (VkImageSubresourceRange*)(local_pRanges + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 8678 | } |
| 8679 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8680 | countingStream->rewind(); |
| 8681 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 8682 | uint64_t cgen_var_597; |
| 8683 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_597, 1); |
| 8684 | countingStream->write((uint64_t*)&cgen_var_597, 1 * 8); |
| 8685 | uint64_t cgen_var_598; |
| 8686 | countingStream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_598, 1); |
| 8687 | countingStream->write((uint64_t*)&cgen_var_598, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8688 | countingStream->write((VkImageLayout*)&local_imageLayout, sizeof(VkImageLayout)); |
| 8689 | marshal_VkClearColorValue(countingStream, (VkClearColorValue*)(local_pColor)); |
| 8690 | countingStream->write((uint32_t*)&local_rangeCount, sizeof(uint32_t)); |
| 8691 | for (uint32_t i = 0; i < (uint32_t)((rangeCount)); ++i) |
| 8692 | { |
| 8693 | marshal_VkImageSubresourceRange(countingStream, (VkImageSubresourceRange*)(local_pRanges + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8694 | } |
| 8695 | } |
| 8696 | uint32_t packetSize_vkCmdClearColorImage = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 8697 | countingStream->rewind(); |
| 8698 | uint32_t opcode_vkCmdClearColorImage = OP_vkCmdClearColorImage; |
| 8699 | stream->write(&opcode_vkCmdClearColorImage, sizeof(uint32_t)); |
| 8700 | stream->write(&packetSize_vkCmdClearColorImage, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 8701 | uint64_t cgen_var_599; |
| 8702 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_599, 1); |
| 8703 | stream->write((uint64_t*)&cgen_var_599, 1 * 8); |
| 8704 | uint64_t cgen_var_600; |
| 8705 | stream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_600, 1); |
| 8706 | stream->write((uint64_t*)&cgen_var_600, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8707 | stream->write((VkImageLayout*)&local_imageLayout, sizeof(VkImageLayout)); |
| 8708 | marshal_VkClearColorValue(stream, (VkClearColorValue*)(local_pColor)); |
| 8709 | stream->write((uint32_t*)&local_rangeCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8710 | for (uint32_t i = 0; i < (uint32_t)((rangeCount)); ++i) |
| 8711 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8712 | marshal_VkImageSubresourceRange(stream, (VkImageSubresourceRange*)(local_pRanges + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8713 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 8714 | AEMU_SCOPED_TRACE("vkCmdClearColorImage readParams"); |
| 8715 | AEMU_SCOPED_TRACE("vkCmdClearColorImage returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 8716 | mImpl->log("finish vkCmdClearColorImage");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8717 | } |
| 8718 | |
| 8719 | void VkEncoder::vkCmdClearDepthStencilImage( |
| 8720 | VkCommandBuffer commandBuffer, |
| 8721 | VkImage image, |
| 8722 | VkImageLayout imageLayout, |
| 8723 | const VkClearDepthStencilValue* pDepthStencil, |
| 8724 | uint32_t rangeCount, |
| 8725 | const VkImageSubresourceRange* pRanges) |
| 8726 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 8727 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 8728 | AEMU_SCOPED_TRACE("vkCmdClearDepthStencilImage encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 8729 | mImpl->log("start vkCmdClearDepthStencilImage"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8730 | auto stream = mImpl->stream(); |
| 8731 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8732 | auto resources = mImpl->resources(); |
| 8733 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 8734 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8735 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8736 | VkImage local_image; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8737 | VkImageLayout local_imageLayout; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8738 | VkClearDepthStencilValue* local_pDepthStencil; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 8739 | uint32_t local_rangeCount; |
| 8740 | VkImageSubresourceRange* local_pRanges; |
| 8741 | local_commandBuffer = commandBuffer; |
| 8742 | local_image = image; |
| 8743 | local_imageLayout = imageLayout; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8744 | local_pDepthStencil = nullptr; |
| 8745 | if (pDepthStencil) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8746 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8747 | local_pDepthStencil = (VkClearDepthStencilValue*)pool->alloc(sizeof(const VkClearDepthStencilValue)); |
| 8748 | deepcopy_VkClearDepthStencilValue(pool, pDepthStencil, (VkClearDepthStencilValue*)(local_pDepthStencil)); |
| 8749 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8750 | local_rangeCount = rangeCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8751 | local_pRanges = nullptr; |
| 8752 | if (pRanges) |
| 8753 | { |
| 8754 | local_pRanges = (VkImageSubresourceRange*)pool->alloc(((rangeCount)) * sizeof(const VkImageSubresourceRange)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8755 | for (uint32_t i = 0; i < (uint32_t)((rangeCount)); ++i) |
| 8756 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8757 | deepcopy_VkImageSubresourceRange(pool, pRanges + i, (VkImageSubresourceRange*)(local_pRanges + i)); |
| 8758 | } |
| 8759 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 8760 | if (local_pDepthStencil) |
| 8761 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 8762 | transform_tohost_VkClearDepthStencilValue(mImpl->resources(), (VkClearDepthStencilValue*)(local_pDepthStencil)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 8763 | } |
| 8764 | if (local_pRanges) |
| 8765 | { |
| 8766 | for (uint32_t i = 0; i < (uint32_t)((rangeCount)); ++i) |
| 8767 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 8768 | transform_tohost_VkImageSubresourceRange(mImpl->resources(), (VkImageSubresourceRange*)(local_pRanges + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 8769 | } |
| 8770 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8771 | countingStream->rewind(); |
| 8772 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 8773 | uint64_t cgen_var_601; |
| 8774 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_601, 1); |
| 8775 | countingStream->write((uint64_t*)&cgen_var_601, 1 * 8); |
| 8776 | uint64_t cgen_var_602; |
| 8777 | countingStream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_602, 1); |
| 8778 | countingStream->write((uint64_t*)&cgen_var_602, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8779 | countingStream->write((VkImageLayout*)&local_imageLayout, sizeof(VkImageLayout)); |
| 8780 | marshal_VkClearDepthStencilValue(countingStream, (VkClearDepthStencilValue*)(local_pDepthStencil)); |
| 8781 | countingStream->write((uint32_t*)&local_rangeCount, sizeof(uint32_t)); |
| 8782 | for (uint32_t i = 0; i < (uint32_t)((rangeCount)); ++i) |
| 8783 | { |
| 8784 | marshal_VkImageSubresourceRange(countingStream, (VkImageSubresourceRange*)(local_pRanges + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8785 | } |
| 8786 | } |
| 8787 | uint32_t packetSize_vkCmdClearDepthStencilImage = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 8788 | countingStream->rewind(); |
| 8789 | uint32_t opcode_vkCmdClearDepthStencilImage = OP_vkCmdClearDepthStencilImage; |
| 8790 | stream->write(&opcode_vkCmdClearDepthStencilImage, sizeof(uint32_t)); |
| 8791 | stream->write(&packetSize_vkCmdClearDepthStencilImage, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 8792 | uint64_t cgen_var_603; |
| 8793 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_603, 1); |
| 8794 | stream->write((uint64_t*)&cgen_var_603, 1 * 8); |
| 8795 | uint64_t cgen_var_604; |
| 8796 | stream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_604, 1); |
| 8797 | stream->write((uint64_t*)&cgen_var_604, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8798 | stream->write((VkImageLayout*)&local_imageLayout, sizeof(VkImageLayout)); |
| 8799 | marshal_VkClearDepthStencilValue(stream, (VkClearDepthStencilValue*)(local_pDepthStencil)); |
| 8800 | stream->write((uint32_t*)&local_rangeCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8801 | for (uint32_t i = 0; i < (uint32_t)((rangeCount)); ++i) |
| 8802 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8803 | marshal_VkImageSubresourceRange(stream, (VkImageSubresourceRange*)(local_pRanges + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8804 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 8805 | AEMU_SCOPED_TRACE("vkCmdClearDepthStencilImage readParams"); |
| 8806 | AEMU_SCOPED_TRACE("vkCmdClearDepthStencilImage returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 8807 | mImpl->log("finish vkCmdClearDepthStencilImage");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8808 | } |
| 8809 | |
| 8810 | void VkEncoder::vkCmdClearAttachments( |
| 8811 | VkCommandBuffer commandBuffer, |
| 8812 | uint32_t attachmentCount, |
| 8813 | const VkClearAttachment* pAttachments, |
| 8814 | uint32_t rectCount, |
| 8815 | const VkClearRect* pRects) |
| 8816 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 8817 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 8818 | AEMU_SCOPED_TRACE("vkCmdClearAttachments encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 8819 | mImpl->log("start vkCmdClearAttachments"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8820 | auto stream = mImpl->stream(); |
| 8821 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8822 | auto resources = mImpl->resources(); |
| 8823 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 8824 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8825 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8826 | uint32_t local_attachmentCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8827 | VkClearAttachment* local_pAttachments; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 8828 | uint32_t local_rectCount; |
| 8829 | VkClearRect* local_pRects; |
| 8830 | local_commandBuffer = commandBuffer; |
| 8831 | local_attachmentCount = attachmentCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8832 | local_pAttachments = nullptr; |
| 8833 | if (pAttachments) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8834 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8835 | local_pAttachments = (VkClearAttachment*)pool->alloc(((attachmentCount)) * sizeof(const VkClearAttachment)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8836 | for (uint32_t i = 0; i < (uint32_t)((attachmentCount)); ++i) |
| 8837 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8838 | deepcopy_VkClearAttachment(pool, pAttachments + i, (VkClearAttachment*)(local_pAttachments + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8839 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8840 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8841 | local_rectCount = rectCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8842 | local_pRects = nullptr; |
| 8843 | if (pRects) |
| 8844 | { |
| 8845 | local_pRects = (VkClearRect*)pool->alloc(((rectCount)) * sizeof(const VkClearRect)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8846 | for (uint32_t i = 0; i < (uint32_t)((rectCount)); ++i) |
| 8847 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8848 | deepcopy_VkClearRect(pool, pRects + i, (VkClearRect*)(local_pRects + i)); |
| 8849 | } |
| 8850 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 8851 | if (local_pAttachments) |
| 8852 | { |
| 8853 | for (uint32_t i = 0; i < (uint32_t)((attachmentCount)); ++i) |
| 8854 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 8855 | transform_tohost_VkClearAttachment(mImpl->resources(), (VkClearAttachment*)(local_pAttachments + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 8856 | } |
| 8857 | } |
| 8858 | if (local_pRects) |
| 8859 | { |
| 8860 | for (uint32_t i = 0; i < (uint32_t)((rectCount)); ++i) |
| 8861 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 8862 | transform_tohost_VkClearRect(mImpl->resources(), (VkClearRect*)(local_pRects + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 8863 | } |
| 8864 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8865 | countingStream->rewind(); |
| 8866 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 8867 | uint64_t cgen_var_605; |
| 8868 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_605, 1); |
| 8869 | countingStream->write((uint64_t*)&cgen_var_605, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8870 | countingStream->write((uint32_t*)&local_attachmentCount, sizeof(uint32_t)); |
| 8871 | for (uint32_t i = 0; i < (uint32_t)((attachmentCount)); ++i) |
| 8872 | { |
| 8873 | marshal_VkClearAttachment(countingStream, (VkClearAttachment*)(local_pAttachments + i)); |
| 8874 | } |
| 8875 | countingStream->write((uint32_t*)&local_rectCount, sizeof(uint32_t)); |
| 8876 | for (uint32_t i = 0; i < (uint32_t)((rectCount)); ++i) |
| 8877 | { |
| 8878 | marshal_VkClearRect(countingStream, (VkClearRect*)(local_pRects + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8879 | } |
| 8880 | } |
| 8881 | uint32_t packetSize_vkCmdClearAttachments = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 8882 | countingStream->rewind(); |
| 8883 | uint32_t opcode_vkCmdClearAttachments = OP_vkCmdClearAttachments; |
| 8884 | stream->write(&opcode_vkCmdClearAttachments, sizeof(uint32_t)); |
| 8885 | stream->write(&packetSize_vkCmdClearAttachments, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 8886 | uint64_t cgen_var_606; |
| 8887 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_606, 1); |
| 8888 | stream->write((uint64_t*)&cgen_var_606, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8889 | stream->write((uint32_t*)&local_attachmentCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8890 | for (uint32_t i = 0; i < (uint32_t)((attachmentCount)); ++i) |
| 8891 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8892 | marshal_VkClearAttachment(stream, (VkClearAttachment*)(local_pAttachments + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8893 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8894 | stream->write((uint32_t*)&local_rectCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8895 | for (uint32_t i = 0; i < (uint32_t)((rectCount)); ++i) |
| 8896 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8897 | marshal_VkClearRect(stream, (VkClearRect*)(local_pRects + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8898 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 8899 | AEMU_SCOPED_TRACE("vkCmdClearAttachments readParams"); |
| 8900 | AEMU_SCOPED_TRACE("vkCmdClearAttachments returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 8901 | mImpl->log("finish vkCmdClearAttachments");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8902 | } |
| 8903 | |
| 8904 | void VkEncoder::vkCmdResolveImage( |
| 8905 | VkCommandBuffer commandBuffer, |
| 8906 | VkImage srcImage, |
| 8907 | VkImageLayout srcImageLayout, |
| 8908 | VkImage dstImage, |
| 8909 | VkImageLayout dstImageLayout, |
| 8910 | uint32_t regionCount, |
| 8911 | const VkImageResolve* pRegions) |
| 8912 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 8913 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 8914 | AEMU_SCOPED_TRACE("vkCmdResolveImage encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 8915 | mImpl->log("start vkCmdResolveImage"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8916 | auto stream = mImpl->stream(); |
| 8917 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8918 | auto resources = mImpl->resources(); |
| 8919 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 8920 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8921 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8922 | VkImage local_srcImage; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8923 | VkImageLayout local_srcImageLayout; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8924 | VkImage local_dstImage; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8925 | VkImageLayout local_dstImageLayout; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8926 | uint32_t local_regionCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8927 | VkImageResolve* local_pRegions; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 8928 | local_commandBuffer = commandBuffer; |
| 8929 | local_srcImage = srcImage; |
| 8930 | local_srcImageLayout = srcImageLayout; |
| 8931 | local_dstImage = dstImage; |
| 8932 | local_dstImageLayout = dstImageLayout; |
| 8933 | local_regionCount = regionCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8934 | local_pRegions = nullptr; |
| 8935 | if (pRegions) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8936 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8937 | local_pRegions = (VkImageResolve*)pool->alloc(((regionCount)) * sizeof(const VkImageResolve)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8938 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 8939 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8940 | deepcopy_VkImageResolve(pool, pRegions + i, (VkImageResolve*)(local_pRegions + i)); |
| 8941 | } |
| 8942 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 8943 | if (local_pRegions) |
| 8944 | { |
| 8945 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 8946 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 8947 | transform_tohost_VkImageResolve(mImpl->resources(), (VkImageResolve*)(local_pRegions + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 8948 | } |
| 8949 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8950 | countingStream->rewind(); |
| 8951 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 8952 | uint64_t cgen_var_607; |
| 8953 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_607, 1); |
| 8954 | countingStream->write((uint64_t*)&cgen_var_607, 1 * 8); |
| 8955 | uint64_t cgen_var_608; |
| 8956 | countingStream->handleMapping()->mapHandles_VkImage_u64(&local_srcImage, &cgen_var_608, 1); |
| 8957 | countingStream->write((uint64_t*)&cgen_var_608, 1 * 8); |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 8958 | countingStream->write((VkImageLayout*)&local_srcImageLayout, sizeof(VkImageLayout)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 8959 | uint64_t cgen_var_609; |
| 8960 | countingStream->handleMapping()->mapHandles_VkImage_u64(&local_dstImage, &cgen_var_609, 1); |
| 8961 | countingStream->write((uint64_t*)&cgen_var_609, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8962 | countingStream->write((VkImageLayout*)&local_dstImageLayout, sizeof(VkImageLayout)); |
| 8963 | countingStream->write((uint32_t*)&local_regionCount, sizeof(uint32_t)); |
| 8964 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 8965 | { |
| 8966 | marshal_VkImageResolve(countingStream, (VkImageResolve*)(local_pRegions + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8967 | } |
| 8968 | } |
| 8969 | uint32_t packetSize_vkCmdResolveImage = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 8970 | countingStream->rewind(); |
| 8971 | uint32_t opcode_vkCmdResolveImage = OP_vkCmdResolveImage; |
| 8972 | stream->write(&opcode_vkCmdResolveImage, sizeof(uint32_t)); |
| 8973 | stream->write(&packetSize_vkCmdResolveImage, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 8974 | uint64_t cgen_var_610; |
| 8975 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_610, 1); |
| 8976 | stream->write((uint64_t*)&cgen_var_610, 1 * 8); |
| 8977 | uint64_t cgen_var_611; |
| 8978 | stream->handleMapping()->mapHandles_VkImage_u64(&local_srcImage, &cgen_var_611, 1); |
| 8979 | stream->write((uint64_t*)&cgen_var_611, 1 * 8); |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 8980 | stream->write((VkImageLayout*)&local_srcImageLayout, sizeof(VkImageLayout)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 8981 | uint64_t cgen_var_612; |
| 8982 | stream->handleMapping()->mapHandles_VkImage_u64(&local_dstImage, &cgen_var_612, 1); |
| 8983 | stream->write((uint64_t*)&cgen_var_612, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8984 | stream->write((VkImageLayout*)&local_dstImageLayout, sizeof(VkImageLayout)); |
| 8985 | stream->write((uint32_t*)&local_regionCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8986 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 8987 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8988 | marshal_VkImageResolve(stream, (VkImageResolve*)(local_pRegions + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8989 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 8990 | AEMU_SCOPED_TRACE("vkCmdResolveImage readParams"); |
| 8991 | AEMU_SCOPED_TRACE("vkCmdResolveImage returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 8992 | mImpl->log("finish vkCmdResolveImage");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8993 | } |
| 8994 | |
| 8995 | void VkEncoder::vkCmdSetEvent( |
| 8996 | VkCommandBuffer commandBuffer, |
| 8997 | VkEvent event, |
| 8998 | VkPipelineStageFlags stageMask) |
| 8999 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 9000 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 9001 | AEMU_SCOPED_TRACE("vkCmdSetEvent encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9002 | mImpl->log("start vkCmdSetEvent"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9003 | auto stream = mImpl->stream(); |
| 9004 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9005 | auto resources = mImpl->resources(); |
| 9006 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 9007 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9008 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9009 | VkEvent local_event; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9010 | VkPipelineStageFlags local_stageMask; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 9011 | local_commandBuffer = commandBuffer; |
| 9012 | local_event = event; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9013 | local_stageMask = stageMask; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9014 | countingStream->rewind(); |
| 9015 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9016 | uint64_t cgen_var_613; |
| 9017 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_613, 1); |
| 9018 | countingStream->write((uint64_t*)&cgen_var_613, 1 * 8); |
| 9019 | uint64_t cgen_var_614; |
| 9020 | countingStream->handleMapping()->mapHandles_VkEvent_u64(&local_event, &cgen_var_614, 1); |
| 9021 | countingStream->write((uint64_t*)&cgen_var_614, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9022 | countingStream->write((VkPipelineStageFlags*)&local_stageMask, sizeof(VkPipelineStageFlags)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9023 | } |
| 9024 | uint32_t packetSize_vkCmdSetEvent = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 9025 | countingStream->rewind(); |
| 9026 | uint32_t opcode_vkCmdSetEvent = OP_vkCmdSetEvent; |
| 9027 | stream->write(&opcode_vkCmdSetEvent, sizeof(uint32_t)); |
| 9028 | stream->write(&packetSize_vkCmdSetEvent, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9029 | uint64_t cgen_var_615; |
| 9030 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_615, 1); |
| 9031 | stream->write((uint64_t*)&cgen_var_615, 1 * 8); |
| 9032 | uint64_t cgen_var_616; |
| 9033 | stream->handleMapping()->mapHandles_VkEvent_u64(&local_event, &cgen_var_616, 1); |
| 9034 | stream->write((uint64_t*)&cgen_var_616, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9035 | stream->write((VkPipelineStageFlags*)&local_stageMask, sizeof(VkPipelineStageFlags)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 9036 | AEMU_SCOPED_TRACE("vkCmdSetEvent readParams"); |
| 9037 | AEMU_SCOPED_TRACE("vkCmdSetEvent returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9038 | mImpl->log("finish vkCmdSetEvent");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9039 | } |
| 9040 | |
| 9041 | void VkEncoder::vkCmdResetEvent( |
| 9042 | VkCommandBuffer commandBuffer, |
| 9043 | VkEvent event, |
| 9044 | VkPipelineStageFlags stageMask) |
| 9045 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 9046 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 9047 | AEMU_SCOPED_TRACE("vkCmdResetEvent encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9048 | mImpl->log("start vkCmdResetEvent"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9049 | auto stream = mImpl->stream(); |
| 9050 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9051 | auto resources = mImpl->resources(); |
| 9052 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 9053 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9054 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9055 | VkEvent local_event; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9056 | VkPipelineStageFlags local_stageMask; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 9057 | local_commandBuffer = commandBuffer; |
| 9058 | local_event = event; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9059 | local_stageMask = stageMask; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9060 | countingStream->rewind(); |
| 9061 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9062 | uint64_t cgen_var_617; |
| 9063 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_617, 1); |
| 9064 | countingStream->write((uint64_t*)&cgen_var_617, 1 * 8); |
| 9065 | uint64_t cgen_var_618; |
| 9066 | countingStream->handleMapping()->mapHandles_VkEvent_u64(&local_event, &cgen_var_618, 1); |
| 9067 | countingStream->write((uint64_t*)&cgen_var_618, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9068 | countingStream->write((VkPipelineStageFlags*)&local_stageMask, sizeof(VkPipelineStageFlags)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9069 | } |
| 9070 | uint32_t packetSize_vkCmdResetEvent = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 9071 | countingStream->rewind(); |
| 9072 | uint32_t opcode_vkCmdResetEvent = OP_vkCmdResetEvent; |
| 9073 | stream->write(&opcode_vkCmdResetEvent, sizeof(uint32_t)); |
| 9074 | stream->write(&packetSize_vkCmdResetEvent, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9075 | uint64_t cgen_var_619; |
| 9076 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_619, 1); |
| 9077 | stream->write((uint64_t*)&cgen_var_619, 1 * 8); |
| 9078 | uint64_t cgen_var_620; |
| 9079 | stream->handleMapping()->mapHandles_VkEvent_u64(&local_event, &cgen_var_620, 1); |
| 9080 | stream->write((uint64_t*)&cgen_var_620, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9081 | stream->write((VkPipelineStageFlags*)&local_stageMask, sizeof(VkPipelineStageFlags)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 9082 | AEMU_SCOPED_TRACE("vkCmdResetEvent readParams"); |
| 9083 | AEMU_SCOPED_TRACE("vkCmdResetEvent returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9084 | mImpl->log("finish vkCmdResetEvent");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9085 | } |
| 9086 | |
| 9087 | void VkEncoder::vkCmdWaitEvents( |
| 9088 | VkCommandBuffer commandBuffer, |
| 9089 | uint32_t eventCount, |
| 9090 | const VkEvent* pEvents, |
| 9091 | VkPipelineStageFlags srcStageMask, |
| 9092 | VkPipelineStageFlags dstStageMask, |
| 9093 | uint32_t memoryBarrierCount, |
| 9094 | const VkMemoryBarrier* pMemoryBarriers, |
| 9095 | uint32_t bufferMemoryBarrierCount, |
| 9096 | const VkBufferMemoryBarrier* pBufferMemoryBarriers, |
| 9097 | uint32_t imageMemoryBarrierCount, |
| 9098 | const VkImageMemoryBarrier* pImageMemoryBarriers) |
| 9099 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 9100 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 9101 | AEMU_SCOPED_TRACE("vkCmdWaitEvents encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9102 | mImpl->log("start vkCmdWaitEvents"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9103 | auto stream = mImpl->stream(); |
| 9104 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9105 | auto resources = mImpl->resources(); |
| 9106 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 9107 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9108 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9109 | uint32_t local_eventCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9110 | VkEvent* local_pEvents; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 9111 | VkPipelineStageFlags local_srcStageMask; |
| 9112 | VkPipelineStageFlags local_dstStageMask; |
| 9113 | uint32_t local_memoryBarrierCount; |
| 9114 | VkMemoryBarrier* local_pMemoryBarriers; |
| 9115 | uint32_t local_bufferMemoryBarrierCount; |
| 9116 | VkBufferMemoryBarrier* local_pBufferMemoryBarriers; |
| 9117 | uint32_t local_imageMemoryBarrierCount; |
| 9118 | VkImageMemoryBarrier* local_pImageMemoryBarriers; |
| 9119 | local_commandBuffer = commandBuffer; |
| 9120 | local_eventCount = eventCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9121 | local_pEvents = nullptr; |
| 9122 | if (pEvents) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9123 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9124 | local_pEvents = (VkEvent*)pool->dupArray(pEvents, ((eventCount)) * sizeof(const VkEvent)); |
| 9125 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9126 | local_srcStageMask = srcStageMask; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9127 | local_dstStageMask = dstStageMask; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9128 | local_memoryBarrierCount = memoryBarrierCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9129 | local_pMemoryBarriers = nullptr; |
| 9130 | if (pMemoryBarriers) |
| 9131 | { |
| 9132 | local_pMemoryBarriers = (VkMemoryBarrier*)pool->alloc(((memoryBarrierCount)) * sizeof(const VkMemoryBarrier)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9133 | for (uint32_t i = 0; i < (uint32_t)((memoryBarrierCount)); ++i) |
| 9134 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9135 | deepcopy_VkMemoryBarrier(pool, pMemoryBarriers + i, (VkMemoryBarrier*)(local_pMemoryBarriers + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9136 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9137 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9138 | local_bufferMemoryBarrierCount = bufferMemoryBarrierCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9139 | local_pBufferMemoryBarriers = nullptr; |
| 9140 | if (pBufferMemoryBarriers) |
| 9141 | { |
| 9142 | local_pBufferMemoryBarriers = (VkBufferMemoryBarrier*)pool->alloc(((bufferMemoryBarrierCount)) * sizeof(const VkBufferMemoryBarrier)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9143 | for (uint32_t i = 0; i < (uint32_t)((bufferMemoryBarrierCount)); ++i) |
| 9144 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9145 | deepcopy_VkBufferMemoryBarrier(pool, pBufferMemoryBarriers + i, (VkBufferMemoryBarrier*)(local_pBufferMemoryBarriers + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9146 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9147 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9148 | local_imageMemoryBarrierCount = imageMemoryBarrierCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9149 | local_pImageMemoryBarriers = nullptr; |
| 9150 | if (pImageMemoryBarriers) |
| 9151 | { |
| 9152 | local_pImageMemoryBarriers = (VkImageMemoryBarrier*)pool->alloc(((imageMemoryBarrierCount)) * sizeof(const VkImageMemoryBarrier)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9153 | for (uint32_t i = 0; i < (uint32_t)((imageMemoryBarrierCount)); ++i) |
| 9154 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9155 | deepcopy_VkImageMemoryBarrier(pool, pImageMemoryBarriers + i, (VkImageMemoryBarrier*)(local_pImageMemoryBarriers + i)); |
| 9156 | } |
| 9157 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 9158 | if (local_pMemoryBarriers) |
| 9159 | { |
| 9160 | for (uint32_t i = 0; i < (uint32_t)((memoryBarrierCount)); ++i) |
| 9161 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 9162 | transform_tohost_VkMemoryBarrier(mImpl->resources(), (VkMemoryBarrier*)(local_pMemoryBarriers + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 9163 | } |
| 9164 | } |
| 9165 | if (local_pBufferMemoryBarriers) |
| 9166 | { |
| 9167 | for (uint32_t i = 0; i < (uint32_t)((bufferMemoryBarrierCount)); ++i) |
| 9168 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 9169 | transform_tohost_VkBufferMemoryBarrier(mImpl->resources(), (VkBufferMemoryBarrier*)(local_pBufferMemoryBarriers + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 9170 | } |
| 9171 | } |
| 9172 | if (local_pImageMemoryBarriers) |
| 9173 | { |
| 9174 | for (uint32_t i = 0; i < (uint32_t)((imageMemoryBarrierCount)); ++i) |
| 9175 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 9176 | transform_tohost_VkImageMemoryBarrier(mImpl->resources(), (VkImageMemoryBarrier*)(local_pImageMemoryBarriers + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 9177 | } |
| 9178 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9179 | countingStream->rewind(); |
| 9180 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9181 | uint64_t cgen_var_621; |
| 9182 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_621, 1); |
| 9183 | countingStream->write((uint64_t*)&cgen_var_621, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9184 | countingStream->write((uint32_t*)&local_eventCount, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9185 | if (((eventCount))) |
| 9186 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9187 | uint64_t* cgen_var_622; |
| 9188 | countingStream->alloc((void**)&cgen_var_622, ((eventCount)) * 8); |
| 9189 | countingStream->handleMapping()->mapHandles_VkEvent_u64(local_pEvents, cgen_var_622, ((eventCount))); |
| 9190 | countingStream->write((uint64_t*)cgen_var_622, ((eventCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9191 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9192 | countingStream->write((VkPipelineStageFlags*)&local_srcStageMask, sizeof(VkPipelineStageFlags)); |
| 9193 | countingStream->write((VkPipelineStageFlags*)&local_dstStageMask, sizeof(VkPipelineStageFlags)); |
| 9194 | countingStream->write((uint32_t*)&local_memoryBarrierCount, sizeof(uint32_t)); |
| 9195 | for (uint32_t i = 0; i < (uint32_t)((memoryBarrierCount)); ++i) |
| 9196 | { |
| 9197 | marshal_VkMemoryBarrier(countingStream, (VkMemoryBarrier*)(local_pMemoryBarriers + i)); |
| 9198 | } |
| 9199 | countingStream->write((uint32_t*)&local_bufferMemoryBarrierCount, sizeof(uint32_t)); |
| 9200 | for (uint32_t i = 0; i < (uint32_t)((bufferMemoryBarrierCount)); ++i) |
| 9201 | { |
| 9202 | marshal_VkBufferMemoryBarrier(countingStream, (VkBufferMemoryBarrier*)(local_pBufferMemoryBarriers + i)); |
| 9203 | } |
| 9204 | countingStream->write((uint32_t*)&local_imageMemoryBarrierCount, sizeof(uint32_t)); |
| 9205 | for (uint32_t i = 0; i < (uint32_t)((imageMemoryBarrierCount)); ++i) |
| 9206 | { |
| 9207 | marshal_VkImageMemoryBarrier(countingStream, (VkImageMemoryBarrier*)(local_pImageMemoryBarriers + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9208 | } |
| 9209 | } |
| 9210 | uint32_t packetSize_vkCmdWaitEvents = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 9211 | countingStream->rewind(); |
| 9212 | uint32_t opcode_vkCmdWaitEvents = OP_vkCmdWaitEvents; |
| 9213 | stream->write(&opcode_vkCmdWaitEvents, sizeof(uint32_t)); |
| 9214 | stream->write(&packetSize_vkCmdWaitEvents, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9215 | uint64_t cgen_var_623; |
| 9216 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_623, 1); |
| 9217 | stream->write((uint64_t*)&cgen_var_623, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9218 | stream->write((uint32_t*)&local_eventCount, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9219 | if (((eventCount))) |
| 9220 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9221 | uint64_t* cgen_var_624; |
| 9222 | stream->alloc((void**)&cgen_var_624, ((eventCount)) * 8); |
| 9223 | stream->handleMapping()->mapHandles_VkEvent_u64(local_pEvents, cgen_var_624, ((eventCount))); |
| 9224 | stream->write((uint64_t*)cgen_var_624, ((eventCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9225 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9226 | stream->write((VkPipelineStageFlags*)&local_srcStageMask, sizeof(VkPipelineStageFlags)); |
| 9227 | stream->write((VkPipelineStageFlags*)&local_dstStageMask, sizeof(VkPipelineStageFlags)); |
| 9228 | stream->write((uint32_t*)&local_memoryBarrierCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9229 | for (uint32_t i = 0; i < (uint32_t)((memoryBarrierCount)); ++i) |
| 9230 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9231 | marshal_VkMemoryBarrier(stream, (VkMemoryBarrier*)(local_pMemoryBarriers + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9232 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9233 | stream->write((uint32_t*)&local_bufferMemoryBarrierCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9234 | for (uint32_t i = 0; i < (uint32_t)((bufferMemoryBarrierCount)); ++i) |
| 9235 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9236 | marshal_VkBufferMemoryBarrier(stream, (VkBufferMemoryBarrier*)(local_pBufferMemoryBarriers + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9237 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9238 | stream->write((uint32_t*)&local_imageMemoryBarrierCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9239 | for (uint32_t i = 0; i < (uint32_t)((imageMemoryBarrierCount)); ++i) |
| 9240 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9241 | marshal_VkImageMemoryBarrier(stream, (VkImageMemoryBarrier*)(local_pImageMemoryBarriers + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9242 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 9243 | AEMU_SCOPED_TRACE("vkCmdWaitEvents readParams"); |
| 9244 | AEMU_SCOPED_TRACE("vkCmdWaitEvents returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9245 | mImpl->log("finish vkCmdWaitEvents");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9246 | } |
| 9247 | |
| 9248 | void VkEncoder::vkCmdPipelineBarrier( |
| 9249 | VkCommandBuffer commandBuffer, |
| 9250 | VkPipelineStageFlags srcStageMask, |
| 9251 | VkPipelineStageFlags dstStageMask, |
| 9252 | VkDependencyFlags dependencyFlags, |
| 9253 | uint32_t memoryBarrierCount, |
| 9254 | const VkMemoryBarrier* pMemoryBarriers, |
| 9255 | uint32_t bufferMemoryBarrierCount, |
| 9256 | const VkBufferMemoryBarrier* pBufferMemoryBarriers, |
| 9257 | uint32_t imageMemoryBarrierCount, |
| 9258 | const VkImageMemoryBarrier* pImageMemoryBarriers) |
| 9259 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 9260 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 9261 | AEMU_SCOPED_TRACE("vkCmdPipelineBarrier encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9262 | mImpl->log("start vkCmdPipelineBarrier"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9263 | auto stream = mImpl->stream(); |
| 9264 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9265 | auto resources = mImpl->resources(); |
| 9266 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 9267 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9268 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9269 | VkPipelineStageFlags local_srcStageMask; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9270 | VkPipelineStageFlags local_dstStageMask; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9271 | VkDependencyFlags local_dependencyFlags; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9272 | uint32_t local_memoryBarrierCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9273 | VkMemoryBarrier* local_pMemoryBarriers; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 9274 | uint32_t local_bufferMemoryBarrierCount; |
| 9275 | VkBufferMemoryBarrier* local_pBufferMemoryBarriers; |
| 9276 | uint32_t local_imageMemoryBarrierCount; |
| 9277 | VkImageMemoryBarrier* local_pImageMemoryBarriers; |
| 9278 | local_commandBuffer = commandBuffer; |
| 9279 | local_srcStageMask = srcStageMask; |
| 9280 | local_dstStageMask = dstStageMask; |
| 9281 | local_dependencyFlags = dependencyFlags; |
| 9282 | local_memoryBarrierCount = memoryBarrierCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9283 | local_pMemoryBarriers = nullptr; |
| 9284 | if (pMemoryBarriers) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9285 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9286 | local_pMemoryBarriers = (VkMemoryBarrier*)pool->alloc(((memoryBarrierCount)) * sizeof(const VkMemoryBarrier)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9287 | for (uint32_t i = 0; i < (uint32_t)((memoryBarrierCount)); ++i) |
| 9288 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9289 | deepcopy_VkMemoryBarrier(pool, pMemoryBarriers + i, (VkMemoryBarrier*)(local_pMemoryBarriers + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9290 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9291 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9292 | local_bufferMemoryBarrierCount = bufferMemoryBarrierCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9293 | local_pBufferMemoryBarriers = nullptr; |
| 9294 | if (pBufferMemoryBarriers) |
| 9295 | { |
| 9296 | local_pBufferMemoryBarriers = (VkBufferMemoryBarrier*)pool->alloc(((bufferMemoryBarrierCount)) * sizeof(const VkBufferMemoryBarrier)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9297 | for (uint32_t i = 0; i < (uint32_t)((bufferMemoryBarrierCount)); ++i) |
| 9298 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9299 | deepcopy_VkBufferMemoryBarrier(pool, pBufferMemoryBarriers + i, (VkBufferMemoryBarrier*)(local_pBufferMemoryBarriers + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9300 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9301 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9302 | local_imageMemoryBarrierCount = imageMemoryBarrierCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9303 | local_pImageMemoryBarriers = nullptr; |
| 9304 | if (pImageMemoryBarriers) |
| 9305 | { |
| 9306 | local_pImageMemoryBarriers = (VkImageMemoryBarrier*)pool->alloc(((imageMemoryBarrierCount)) * sizeof(const VkImageMemoryBarrier)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9307 | for (uint32_t i = 0; i < (uint32_t)((imageMemoryBarrierCount)); ++i) |
| 9308 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9309 | deepcopy_VkImageMemoryBarrier(pool, pImageMemoryBarriers + i, (VkImageMemoryBarrier*)(local_pImageMemoryBarriers + i)); |
| 9310 | } |
| 9311 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 9312 | if (local_pMemoryBarriers) |
| 9313 | { |
| 9314 | for (uint32_t i = 0; i < (uint32_t)((memoryBarrierCount)); ++i) |
| 9315 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 9316 | transform_tohost_VkMemoryBarrier(mImpl->resources(), (VkMemoryBarrier*)(local_pMemoryBarriers + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 9317 | } |
| 9318 | } |
| 9319 | if (local_pBufferMemoryBarriers) |
| 9320 | { |
| 9321 | for (uint32_t i = 0; i < (uint32_t)((bufferMemoryBarrierCount)); ++i) |
| 9322 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 9323 | transform_tohost_VkBufferMemoryBarrier(mImpl->resources(), (VkBufferMemoryBarrier*)(local_pBufferMemoryBarriers + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 9324 | } |
| 9325 | } |
| 9326 | if (local_pImageMemoryBarriers) |
| 9327 | { |
| 9328 | for (uint32_t i = 0; i < (uint32_t)((imageMemoryBarrierCount)); ++i) |
| 9329 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 9330 | transform_tohost_VkImageMemoryBarrier(mImpl->resources(), (VkImageMemoryBarrier*)(local_pImageMemoryBarriers + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 9331 | } |
| 9332 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9333 | countingStream->rewind(); |
| 9334 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9335 | uint64_t cgen_var_625; |
| 9336 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_625, 1); |
| 9337 | countingStream->write((uint64_t*)&cgen_var_625, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9338 | countingStream->write((VkPipelineStageFlags*)&local_srcStageMask, sizeof(VkPipelineStageFlags)); |
| 9339 | countingStream->write((VkPipelineStageFlags*)&local_dstStageMask, sizeof(VkPipelineStageFlags)); |
| 9340 | countingStream->write((VkDependencyFlags*)&local_dependencyFlags, sizeof(VkDependencyFlags)); |
| 9341 | countingStream->write((uint32_t*)&local_memoryBarrierCount, sizeof(uint32_t)); |
| 9342 | for (uint32_t i = 0; i < (uint32_t)((memoryBarrierCount)); ++i) |
| 9343 | { |
| 9344 | marshal_VkMemoryBarrier(countingStream, (VkMemoryBarrier*)(local_pMemoryBarriers + i)); |
| 9345 | } |
| 9346 | countingStream->write((uint32_t*)&local_bufferMemoryBarrierCount, sizeof(uint32_t)); |
| 9347 | for (uint32_t i = 0; i < (uint32_t)((bufferMemoryBarrierCount)); ++i) |
| 9348 | { |
| 9349 | marshal_VkBufferMemoryBarrier(countingStream, (VkBufferMemoryBarrier*)(local_pBufferMemoryBarriers + i)); |
| 9350 | } |
| 9351 | countingStream->write((uint32_t*)&local_imageMemoryBarrierCount, sizeof(uint32_t)); |
| 9352 | for (uint32_t i = 0; i < (uint32_t)((imageMemoryBarrierCount)); ++i) |
| 9353 | { |
| 9354 | marshal_VkImageMemoryBarrier(countingStream, (VkImageMemoryBarrier*)(local_pImageMemoryBarriers + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9355 | } |
| 9356 | } |
| 9357 | uint32_t packetSize_vkCmdPipelineBarrier = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 9358 | countingStream->rewind(); |
| 9359 | uint32_t opcode_vkCmdPipelineBarrier = OP_vkCmdPipelineBarrier; |
| 9360 | stream->write(&opcode_vkCmdPipelineBarrier, sizeof(uint32_t)); |
| 9361 | stream->write(&packetSize_vkCmdPipelineBarrier, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9362 | uint64_t cgen_var_626; |
| 9363 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_626, 1); |
| 9364 | stream->write((uint64_t*)&cgen_var_626, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9365 | stream->write((VkPipelineStageFlags*)&local_srcStageMask, sizeof(VkPipelineStageFlags)); |
| 9366 | stream->write((VkPipelineStageFlags*)&local_dstStageMask, sizeof(VkPipelineStageFlags)); |
| 9367 | stream->write((VkDependencyFlags*)&local_dependencyFlags, sizeof(VkDependencyFlags)); |
| 9368 | stream->write((uint32_t*)&local_memoryBarrierCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9369 | for (uint32_t i = 0; i < (uint32_t)((memoryBarrierCount)); ++i) |
| 9370 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9371 | marshal_VkMemoryBarrier(stream, (VkMemoryBarrier*)(local_pMemoryBarriers + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9372 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9373 | stream->write((uint32_t*)&local_bufferMemoryBarrierCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9374 | for (uint32_t i = 0; i < (uint32_t)((bufferMemoryBarrierCount)); ++i) |
| 9375 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9376 | marshal_VkBufferMemoryBarrier(stream, (VkBufferMemoryBarrier*)(local_pBufferMemoryBarriers + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9377 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9378 | stream->write((uint32_t*)&local_imageMemoryBarrierCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9379 | for (uint32_t i = 0; i < (uint32_t)((imageMemoryBarrierCount)); ++i) |
| 9380 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9381 | marshal_VkImageMemoryBarrier(stream, (VkImageMemoryBarrier*)(local_pImageMemoryBarriers + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9382 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 9383 | AEMU_SCOPED_TRACE("vkCmdPipelineBarrier readParams"); |
| 9384 | AEMU_SCOPED_TRACE("vkCmdPipelineBarrier returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9385 | mImpl->log("finish vkCmdPipelineBarrier");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9386 | } |
| 9387 | |
| 9388 | void VkEncoder::vkCmdBeginQuery( |
| 9389 | VkCommandBuffer commandBuffer, |
| 9390 | VkQueryPool queryPool, |
| 9391 | uint32_t query, |
| 9392 | VkQueryControlFlags flags) |
| 9393 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 9394 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 9395 | AEMU_SCOPED_TRACE("vkCmdBeginQuery encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9396 | mImpl->log("start vkCmdBeginQuery"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9397 | auto stream = mImpl->stream(); |
| 9398 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9399 | auto resources = mImpl->resources(); |
| 9400 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 9401 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9402 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9403 | VkQueryPool local_queryPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9404 | uint32_t local_query; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9405 | VkQueryControlFlags local_flags; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 9406 | local_commandBuffer = commandBuffer; |
| 9407 | local_queryPool = queryPool; |
| 9408 | local_query = query; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9409 | local_flags = flags; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9410 | countingStream->rewind(); |
| 9411 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9412 | uint64_t cgen_var_627; |
| 9413 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_627, 1); |
| 9414 | countingStream->write((uint64_t*)&cgen_var_627, 1 * 8); |
| 9415 | uint64_t cgen_var_628; |
| 9416 | countingStream->handleMapping()->mapHandles_VkQueryPool_u64(&local_queryPool, &cgen_var_628, 1); |
| 9417 | countingStream->write((uint64_t*)&cgen_var_628, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9418 | countingStream->write((uint32_t*)&local_query, sizeof(uint32_t)); |
| 9419 | countingStream->write((VkQueryControlFlags*)&local_flags, sizeof(VkQueryControlFlags)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9420 | } |
| 9421 | uint32_t packetSize_vkCmdBeginQuery = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 9422 | countingStream->rewind(); |
| 9423 | uint32_t opcode_vkCmdBeginQuery = OP_vkCmdBeginQuery; |
| 9424 | stream->write(&opcode_vkCmdBeginQuery, sizeof(uint32_t)); |
| 9425 | stream->write(&packetSize_vkCmdBeginQuery, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9426 | uint64_t cgen_var_629; |
| 9427 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_629, 1); |
| 9428 | stream->write((uint64_t*)&cgen_var_629, 1 * 8); |
| 9429 | uint64_t cgen_var_630; |
| 9430 | stream->handleMapping()->mapHandles_VkQueryPool_u64(&local_queryPool, &cgen_var_630, 1); |
| 9431 | stream->write((uint64_t*)&cgen_var_630, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9432 | stream->write((uint32_t*)&local_query, sizeof(uint32_t)); |
| 9433 | stream->write((VkQueryControlFlags*)&local_flags, sizeof(VkQueryControlFlags)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 9434 | AEMU_SCOPED_TRACE("vkCmdBeginQuery readParams"); |
| 9435 | AEMU_SCOPED_TRACE("vkCmdBeginQuery returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9436 | mImpl->log("finish vkCmdBeginQuery");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9437 | } |
| 9438 | |
| 9439 | void VkEncoder::vkCmdEndQuery( |
| 9440 | VkCommandBuffer commandBuffer, |
| 9441 | VkQueryPool queryPool, |
| 9442 | uint32_t query) |
| 9443 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 9444 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 9445 | AEMU_SCOPED_TRACE("vkCmdEndQuery encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9446 | mImpl->log("start vkCmdEndQuery"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9447 | auto stream = mImpl->stream(); |
| 9448 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9449 | auto resources = mImpl->resources(); |
| 9450 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 9451 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9452 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9453 | VkQueryPool local_queryPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9454 | uint32_t local_query; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 9455 | local_commandBuffer = commandBuffer; |
| 9456 | local_queryPool = queryPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9457 | local_query = query; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9458 | countingStream->rewind(); |
| 9459 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9460 | uint64_t cgen_var_631; |
| 9461 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_631, 1); |
| 9462 | countingStream->write((uint64_t*)&cgen_var_631, 1 * 8); |
| 9463 | uint64_t cgen_var_632; |
| 9464 | countingStream->handleMapping()->mapHandles_VkQueryPool_u64(&local_queryPool, &cgen_var_632, 1); |
| 9465 | countingStream->write((uint64_t*)&cgen_var_632, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9466 | countingStream->write((uint32_t*)&local_query, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9467 | } |
| 9468 | uint32_t packetSize_vkCmdEndQuery = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 9469 | countingStream->rewind(); |
| 9470 | uint32_t opcode_vkCmdEndQuery = OP_vkCmdEndQuery; |
| 9471 | stream->write(&opcode_vkCmdEndQuery, sizeof(uint32_t)); |
| 9472 | stream->write(&packetSize_vkCmdEndQuery, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9473 | uint64_t cgen_var_633; |
| 9474 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_633, 1); |
| 9475 | stream->write((uint64_t*)&cgen_var_633, 1 * 8); |
| 9476 | uint64_t cgen_var_634; |
| 9477 | stream->handleMapping()->mapHandles_VkQueryPool_u64(&local_queryPool, &cgen_var_634, 1); |
| 9478 | stream->write((uint64_t*)&cgen_var_634, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9479 | stream->write((uint32_t*)&local_query, sizeof(uint32_t)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 9480 | AEMU_SCOPED_TRACE("vkCmdEndQuery readParams"); |
| 9481 | AEMU_SCOPED_TRACE("vkCmdEndQuery returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9482 | mImpl->log("finish vkCmdEndQuery");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9483 | } |
| 9484 | |
| 9485 | void VkEncoder::vkCmdResetQueryPool( |
| 9486 | VkCommandBuffer commandBuffer, |
| 9487 | VkQueryPool queryPool, |
| 9488 | uint32_t firstQuery, |
| 9489 | uint32_t queryCount) |
| 9490 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 9491 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 9492 | AEMU_SCOPED_TRACE("vkCmdResetQueryPool encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9493 | mImpl->log("start vkCmdResetQueryPool"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9494 | auto stream = mImpl->stream(); |
| 9495 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9496 | auto resources = mImpl->resources(); |
| 9497 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 9498 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9499 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9500 | VkQueryPool local_queryPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9501 | uint32_t local_firstQuery; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9502 | uint32_t local_queryCount; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 9503 | local_commandBuffer = commandBuffer; |
| 9504 | local_queryPool = queryPool; |
| 9505 | local_firstQuery = firstQuery; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9506 | local_queryCount = queryCount; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9507 | countingStream->rewind(); |
| 9508 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9509 | uint64_t cgen_var_635; |
| 9510 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_635, 1); |
| 9511 | countingStream->write((uint64_t*)&cgen_var_635, 1 * 8); |
| 9512 | uint64_t cgen_var_636; |
| 9513 | countingStream->handleMapping()->mapHandles_VkQueryPool_u64(&local_queryPool, &cgen_var_636, 1); |
| 9514 | countingStream->write((uint64_t*)&cgen_var_636, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9515 | countingStream->write((uint32_t*)&local_firstQuery, sizeof(uint32_t)); |
| 9516 | countingStream->write((uint32_t*)&local_queryCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9517 | } |
| 9518 | uint32_t packetSize_vkCmdResetQueryPool = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 9519 | countingStream->rewind(); |
| 9520 | uint32_t opcode_vkCmdResetQueryPool = OP_vkCmdResetQueryPool; |
| 9521 | stream->write(&opcode_vkCmdResetQueryPool, sizeof(uint32_t)); |
| 9522 | stream->write(&packetSize_vkCmdResetQueryPool, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9523 | uint64_t cgen_var_637; |
| 9524 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_637, 1); |
| 9525 | stream->write((uint64_t*)&cgen_var_637, 1 * 8); |
| 9526 | uint64_t cgen_var_638; |
| 9527 | stream->handleMapping()->mapHandles_VkQueryPool_u64(&local_queryPool, &cgen_var_638, 1); |
| 9528 | stream->write((uint64_t*)&cgen_var_638, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9529 | stream->write((uint32_t*)&local_firstQuery, sizeof(uint32_t)); |
| 9530 | stream->write((uint32_t*)&local_queryCount, sizeof(uint32_t)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 9531 | AEMU_SCOPED_TRACE("vkCmdResetQueryPool readParams"); |
| 9532 | AEMU_SCOPED_TRACE("vkCmdResetQueryPool returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9533 | mImpl->log("finish vkCmdResetQueryPool");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9534 | } |
| 9535 | |
| 9536 | void VkEncoder::vkCmdWriteTimestamp( |
| 9537 | VkCommandBuffer commandBuffer, |
| 9538 | VkPipelineStageFlagBits pipelineStage, |
| 9539 | VkQueryPool queryPool, |
| 9540 | uint32_t query) |
| 9541 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 9542 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 9543 | AEMU_SCOPED_TRACE("vkCmdWriteTimestamp encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9544 | mImpl->log("start vkCmdWriteTimestamp"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9545 | auto stream = mImpl->stream(); |
| 9546 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9547 | auto resources = mImpl->resources(); |
| 9548 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 9549 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9550 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9551 | VkPipelineStageFlagBits local_pipelineStage; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9552 | VkQueryPool local_queryPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9553 | uint32_t local_query; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 9554 | local_commandBuffer = commandBuffer; |
| 9555 | local_pipelineStage = pipelineStage; |
| 9556 | local_queryPool = queryPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9557 | local_query = query; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9558 | countingStream->rewind(); |
| 9559 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9560 | uint64_t cgen_var_639; |
| 9561 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_639, 1); |
| 9562 | countingStream->write((uint64_t*)&cgen_var_639, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9563 | countingStream->write((VkPipelineStageFlagBits*)&local_pipelineStage, sizeof(VkPipelineStageFlagBits)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9564 | uint64_t cgen_var_640; |
| 9565 | countingStream->handleMapping()->mapHandles_VkQueryPool_u64(&local_queryPool, &cgen_var_640, 1); |
| 9566 | countingStream->write((uint64_t*)&cgen_var_640, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9567 | countingStream->write((uint32_t*)&local_query, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9568 | } |
| 9569 | uint32_t packetSize_vkCmdWriteTimestamp = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 9570 | countingStream->rewind(); |
| 9571 | uint32_t opcode_vkCmdWriteTimestamp = OP_vkCmdWriteTimestamp; |
| 9572 | stream->write(&opcode_vkCmdWriteTimestamp, sizeof(uint32_t)); |
| 9573 | stream->write(&packetSize_vkCmdWriteTimestamp, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9574 | uint64_t cgen_var_641; |
| 9575 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_641, 1); |
| 9576 | stream->write((uint64_t*)&cgen_var_641, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9577 | stream->write((VkPipelineStageFlagBits*)&local_pipelineStage, sizeof(VkPipelineStageFlagBits)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9578 | uint64_t cgen_var_642; |
| 9579 | stream->handleMapping()->mapHandles_VkQueryPool_u64(&local_queryPool, &cgen_var_642, 1); |
| 9580 | stream->write((uint64_t*)&cgen_var_642, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9581 | stream->write((uint32_t*)&local_query, sizeof(uint32_t)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 9582 | AEMU_SCOPED_TRACE("vkCmdWriteTimestamp readParams"); |
| 9583 | AEMU_SCOPED_TRACE("vkCmdWriteTimestamp returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9584 | mImpl->log("finish vkCmdWriteTimestamp");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9585 | } |
| 9586 | |
| 9587 | void VkEncoder::vkCmdCopyQueryPoolResults( |
| 9588 | VkCommandBuffer commandBuffer, |
| 9589 | VkQueryPool queryPool, |
| 9590 | uint32_t firstQuery, |
| 9591 | uint32_t queryCount, |
| 9592 | VkBuffer dstBuffer, |
| 9593 | VkDeviceSize dstOffset, |
| 9594 | VkDeviceSize stride, |
| 9595 | VkQueryResultFlags flags) |
| 9596 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 9597 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 9598 | AEMU_SCOPED_TRACE("vkCmdCopyQueryPoolResults encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9599 | mImpl->log("start vkCmdCopyQueryPoolResults"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9600 | auto stream = mImpl->stream(); |
| 9601 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9602 | auto resources = mImpl->resources(); |
| 9603 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 9604 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9605 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9606 | VkQueryPool local_queryPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9607 | uint32_t local_firstQuery; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9608 | uint32_t local_queryCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9609 | VkBuffer local_dstBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9610 | VkDeviceSize local_dstOffset; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9611 | VkDeviceSize local_stride; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9612 | VkQueryResultFlags local_flags; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 9613 | local_commandBuffer = commandBuffer; |
| 9614 | local_queryPool = queryPool; |
| 9615 | local_firstQuery = firstQuery; |
| 9616 | local_queryCount = queryCount; |
| 9617 | local_dstBuffer = dstBuffer; |
| 9618 | local_dstOffset = dstOffset; |
| 9619 | local_stride = stride; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9620 | local_flags = flags; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9621 | countingStream->rewind(); |
| 9622 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9623 | uint64_t cgen_var_643; |
| 9624 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_643, 1); |
| 9625 | countingStream->write((uint64_t*)&cgen_var_643, 1 * 8); |
| 9626 | uint64_t cgen_var_644; |
| 9627 | countingStream->handleMapping()->mapHandles_VkQueryPool_u64(&local_queryPool, &cgen_var_644, 1); |
| 9628 | countingStream->write((uint64_t*)&cgen_var_644, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9629 | countingStream->write((uint32_t*)&local_firstQuery, sizeof(uint32_t)); |
| 9630 | countingStream->write((uint32_t*)&local_queryCount, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9631 | uint64_t cgen_var_645; |
| 9632 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_dstBuffer, &cgen_var_645, 1); |
| 9633 | countingStream->write((uint64_t*)&cgen_var_645, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9634 | countingStream->write((VkDeviceSize*)&local_dstOffset, sizeof(VkDeviceSize)); |
| 9635 | countingStream->write((VkDeviceSize*)&local_stride, sizeof(VkDeviceSize)); |
| 9636 | countingStream->write((VkQueryResultFlags*)&local_flags, sizeof(VkQueryResultFlags)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9637 | } |
| 9638 | uint32_t packetSize_vkCmdCopyQueryPoolResults = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 9639 | countingStream->rewind(); |
| 9640 | uint32_t opcode_vkCmdCopyQueryPoolResults = OP_vkCmdCopyQueryPoolResults; |
| 9641 | stream->write(&opcode_vkCmdCopyQueryPoolResults, sizeof(uint32_t)); |
| 9642 | stream->write(&packetSize_vkCmdCopyQueryPoolResults, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9643 | uint64_t cgen_var_646; |
| 9644 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_646, 1); |
| 9645 | stream->write((uint64_t*)&cgen_var_646, 1 * 8); |
| 9646 | uint64_t cgen_var_647; |
| 9647 | stream->handleMapping()->mapHandles_VkQueryPool_u64(&local_queryPool, &cgen_var_647, 1); |
| 9648 | stream->write((uint64_t*)&cgen_var_647, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9649 | stream->write((uint32_t*)&local_firstQuery, sizeof(uint32_t)); |
| 9650 | stream->write((uint32_t*)&local_queryCount, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9651 | uint64_t cgen_var_648; |
| 9652 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_dstBuffer, &cgen_var_648, 1); |
| 9653 | stream->write((uint64_t*)&cgen_var_648, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9654 | stream->write((VkDeviceSize*)&local_dstOffset, sizeof(VkDeviceSize)); |
| 9655 | stream->write((VkDeviceSize*)&local_stride, sizeof(VkDeviceSize)); |
| 9656 | stream->write((VkQueryResultFlags*)&local_flags, sizeof(VkQueryResultFlags)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 9657 | AEMU_SCOPED_TRACE("vkCmdCopyQueryPoolResults readParams"); |
| 9658 | AEMU_SCOPED_TRACE("vkCmdCopyQueryPoolResults returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9659 | mImpl->log("finish vkCmdCopyQueryPoolResults");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9660 | } |
| 9661 | |
| 9662 | void VkEncoder::vkCmdPushConstants( |
| 9663 | VkCommandBuffer commandBuffer, |
| 9664 | VkPipelineLayout layout, |
| 9665 | VkShaderStageFlags stageFlags, |
| 9666 | uint32_t offset, |
| 9667 | uint32_t size, |
| 9668 | const void* pValues) |
| 9669 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 9670 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 9671 | AEMU_SCOPED_TRACE("vkCmdPushConstants encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9672 | mImpl->log("start vkCmdPushConstants"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9673 | auto stream = mImpl->stream(); |
| 9674 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9675 | auto resources = mImpl->resources(); |
| 9676 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 9677 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9678 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9679 | VkPipelineLayout local_layout; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9680 | VkShaderStageFlags local_stageFlags; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9681 | uint32_t local_offset; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9682 | uint32_t local_size; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9683 | void* local_pValues; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 9684 | local_commandBuffer = commandBuffer; |
| 9685 | local_layout = layout; |
| 9686 | local_stageFlags = stageFlags; |
| 9687 | local_offset = offset; |
| 9688 | local_size = size; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9689 | local_pValues = nullptr; |
| 9690 | if (pValues) |
| 9691 | { |
| 9692 | local_pValues = (void*)pool->dupArray(pValues, ((size)) * sizeof(const uint8_t)); |
| 9693 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9694 | countingStream->rewind(); |
| 9695 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9696 | uint64_t cgen_var_649; |
| 9697 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_649, 1); |
| 9698 | countingStream->write((uint64_t*)&cgen_var_649, 1 * 8); |
| 9699 | uint64_t cgen_var_650; |
| 9700 | countingStream->handleMapping()->mapHandles_VkPipelineLayout_u64(&local_layout, &cgen_var_650, 1); |
| 9701 | countingStream->write((uint64_t*)&cgen_var_650, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9702 | countingStream->write((VkShaderStageFlags*)&local_stageFlags, sizeof(VkShaderStageFlags)); |
| 9703 | countingStream->write((uint32_t*)&local_offset, sizeof(uint32_t)); |
| 9704 | countingStream->write((uint32_t*)&local_size, sizeof(uint32_t)); |
| 9705 | countingStream->write((void*)local_pValues, ((size)) * sizeof(uint8_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9706 | } |
| 9707 | uint32_t packetSize_vkCmdPushConstants = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 9708 | countingStream->rewind(); |
| 9709 | uint32_t opcode_vkCmdPushConstants = OP_vkCmdPushConstants; |
| 9710 | stream->write(&opcode_vkCmdPushConstants, sizeof(uint32_t)); |
| 9711 | stream->write(&packetSize_vkCmdPushConstants, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9712 | uint64_t cgen_var_651; |
| 9713 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_651, 1); |
| 9714 | stream->write((uint64_t*)&cgen_var_651, 1 * 8); |
| 9715 | uint64_t cgen_var_652; |
| 9716 | stream->handleMapping()->mapHandles_VkPipelineLayout_u64(&local_layout, &cgen_var_652, 1); |
| 9717 | stream->write((uint64_t*)&cgen_var_652, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9718 | stream->write((VkShaderStageFlags*)&local_stageFlags, sizeof(VkShaderStageFlags)); |
| 9719 | stream->write((uint32_t*)&local_offset, sizeof(uint32_t)); |
| 9720 | stream->write((uint32_t*)&local_size, sizeof(uint32_t)); |
| 9721 | stream->write((void*)local_pValues, ((size)) * sizeof(uint8_t)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 9722 | AEMU_SCOPED_TRACE("vkCmdPushConstants readParams"); |
| 9723 | AEMU_SCOPED_TRACE("vkCmdPushConstants returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9724 | mImpl->log("finish vkCmdPushConstants");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9725 | } |
| 9726 | |
| 9727 | void VkEncoder::vkCmdBeginRenderPass( |
| 9728 | VkCommandBuffer commandBuffer, |
| 9729 | const VkRenderPassBeginInfo* pRenderPassBegin, |
| 9730 | VkSubpassContents contents) |
| 9731 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 9732 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 9733 | AEMU_SCOPED_TRACE("vkCmdBeginRenderPass encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9734 | mImpl->log("start vkCmdBeginRenderPass"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9735 | auto stream = mImpl->stream(); |
| 9736 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9737 | auto resources = mImpl->resources(); |
| 9738 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 9739 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9740 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9741 | VkRenderPassBeginInfo* local_pRenderPassBegin; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 9742 | VkSubpassContents local_contents; |
| 9743 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9744 | local_pRenderPassBegin = nullptr; |
| 9745 | if (pRenderPassBegin) |
| 9746 | { |
| 9747 | local_pRenderPassBegin = (VkRenderPassBeginInfo*)pool->alloc(sizeof(const VkRenderPassBeginInfo)); |
| 9748 | deepcopy_VkRenderPassBeginInfo(pool, pRenderPassBegin, (VkRenderPassBeginInfo*)(local_pRenderPassBegin)); |
| 9749 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9750 | local_contents = contents; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 9751 | if (local_pRenderPassBegin) |
| 9752 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 9753 | transform_tohost_VkRenderPassBeginInfo(mImpl->resources(), (VkRenderPassBeginInfo*)(local_pRenderPassBegin)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 9754 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9755 | countingStream->rewind(); |
| 9756 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9757 | uint64_t cgen_var_653; |
| 9758 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_653, 1); |
| 9759 | countingStream->write((uint64_t*)&cgen_var_653, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9760 | marshal_VkRenderPassBeginInfo(countingStream, (VkRenderPassBeginInfo*)(local_pRenderPassBegin)); |
| 9761 | countingStream->write((VkSubpassContents*)&local_contents, sizeof(VkSubpassContents)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9762 | } |
| 9763 | uint32_t packetSize_vkCmdBeginRenderPass = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 9764 | countingStream->rewind(); |
| 9765 | uint32_t opcode_vkCmdBeginRenderPass = OP_vkCmdBeginRenderPass; |
| 9766 | stream->write(&opcode_vkCmdBeginRenderPass, sizeof(uint32_t)); |
| 9767 | stream->write(&packetSize_vkCmdBeginRenderPass, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9768 | uint64_t cgen_var_654; |
| 9769 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_654, 1); |
| 9770 | stream->write((uint64_t*)&cgen_var_654, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9771 | marshal_VkRenderPassBeginInfo(stream, (VkRenderPassBeginInfo*)(local_pRenderPassBegin)); |
| 9772 | stream->write((VkSubpassContents*)&local_contents, sizeof(VkSubpassContents)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 9773 | AEMU_SCOPED_TRACE("vkCmdBeginRenderPass readParams"); |
| 9774 | AEMU_SCOPED_TRACE("vkCmdBeginRenderPass returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9775 | mImpl->log("finish vkCmdBeginRenderPass");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9776 | } |
| 9777 | |
| 9778 | void VkEncoder::vkCmdNextSubpass( |
| 9779 | VkCommandBuffer commandBuffer, |
| 9780 | VkSubpassContents contents) |
| 9781 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 9782 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 9783 | AEMU_SCOPED_TRACE("vkCmdNextSubpass encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9784 | mImpl->log("start vkCmdNextSubpass"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9785 | auto stream = mImpl->stream(); |
| 9786 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9787 | auto resources = mImpl->resources(); |
| 9788 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 9789 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9790 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9791 | VkSubpassContents local_contents; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 9792 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9793 | local_contents = contents; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9794 | countingStream->rewind(); |
| 9795 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9796 | uint64_t cgen_var_655; |
| 9797 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_655, 1); |
| 9798 | countingStream->write((uint64_t*)&cgen_var_655, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9799 | countingStream->write((VkSubpassContents*)&local_contents, sizeof(VkSubpassContents)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9800 | } |
| 9801 | uint32_t packetSize_vkCmdNextSubpass = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 9802 | countingStream->rewind(); |
| 9803 | uint32_t opcode_vkCmdNextSubpass = OP_vkCmdNextSubpass; |
| 9804 | stream->write(&opcode_vkCmdNextSubpass, sizeof(uint32_t)); |
| 9805 | stream->write(&packetSize_vkCmdNextSubpass, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9806 | uint64_t cgen_var_656; |
| 9807 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_656, 1); |
| 9808 | stream->write((uint64_t*)&cgen_var_656, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9809 | stream->write((VkSubpassContents*)&local_contents, sizeof(VkSubpassContents)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 9810 | AEMU_SCOPED_TRACE("vkCmdNextSubpass readParams"); |
| 9811 | AEMU_SCOPED_TRACE("vkCmdNextSubpass returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9812 | mImpl->log("finish vkCmdNextSubpass");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9813 | } |
| 9814 | |
| 9815 | void VkEncoder::vkCmdEndRenderPass( |
| 9816 | VkCommandBuffer commandBuffer) |
| 9817 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 9818 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 9819 | AEMU_SCOPED_TRACE("vkCmdEndRenderPass encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9820 | mImpl->log("start vkCmdEndRenderPass"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9821 | auto stream = mImpl->stream(); |
| 9822 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9823 | auto resources = mImpl->resources(); |
| 9824 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 9825 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9826 | VkCommandBuffer local_commandBuffer; |
| 9827 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9828 | countingStream->rewind(); |
| 9829 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9830 | uint64_t cgen_var_657; |
| 9831 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_657, 1); |
| 9832 | countingStream->write((uint64_t*)&cgen_var_657, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9833 | } |
| 9834 | uint32_t packetSize_vkCmdEndRenderPass = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 9835 | countingStream->rewind(); |
| 9836 | uint32_t opcode_vkCmdEndRenderPass = OP_vkCmdEndRenderPass; |
| 9837 | stream->write(&opcode_vkCmdEndRenderPass, sizeof(uint32_t)); |
| 9838 | stream->write(&packetSize_vkCmdEndRenderPass, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9839 | uint64_t cgen_var_658; |
| 9840 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_658, 1); |
| 9841 | stream->write((uint64_t*)&cgen_var_658, 1 * 8); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 9842 | AEMU_SCOPED_TRACE("vkCmdEndRenderPass readParams"); |
| 9843 | AEMU_SCOPED_TRACE("vkCmdEndRenderPass returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9844 | mImpl->log("finish vkCmdEndRenderPass");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9845 | } |
| 9846 | |
| 9847 | void VkEncoder::vkCmdExecuteCommands( |
| 9848 | VkCommandBuffer commandBuffer, |
| 9849 | uint32_t commandBufferCount, |
| 9850 | const VkCommandBuffer* pCommandBuffers) |
| 9851 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 9852 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 9853 | AEMU_SCOPED_TRACE("vkCmdExecuteCommands encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9854 | mImpl->log("start vkCmdExecuteCommands"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9855 | auto stream = mImpl->stream(); |
| 9856 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9857 | auto resources = mImpl->resources(); |
| 9858 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 9859 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9860 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9861 | uint32_t local_commandBufferCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9862 | VkCommandBuffer* local_pCommandBuffers; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 9863 | local_commandBuffer = commandBuffer; |
| 9864 | local_commandBufferCount = commandBufferCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9865 | local_pCommandBuffers = nullptr; |
| 9866 | if (pCommandBuffers) |
| 9867 | { |
| 9868 | local_pCommandBuffers = (VkCommandBuffer*)pool->dupArray(pCommandBuffers, ((commandBufferCount)) * sizeof(const VkCommandBuffer)); |
| 9869 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9870 | countingStream->rewind(); |
| 9871 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9872 | uint64_t cgen_var_659; |
| 9873 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_659, 1); |
| 9874 | countingStream->write((uint64_t*)&cgen_var_659, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9875 | countingStream->write((uint32_t*)&local_commandBufferCount, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9876 | if (((commandBufferCount))) |
| 9877 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9878 | uint64_t* cgen_var_660; |
| 9879 | countingStream->alloc((void**)&cgen_var_660, ((commandBufferCount)) * 8); |
| 9880 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(local_pCommandBuffers, cgen_var_660, ((commandBufferCount))); |
| 9881 | countingStream->write((uint64_t*)cgen_var_660, ((commandBufferCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9882 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9883 | } |
| 9884 | uint32_t packetSize_vkCmdExecuteCommands = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 9885 | countingStream->rewind(); |
| 9886 | uint32_t opcode_vkCmdExecuteCommands = OP_vkCmdExecuteCommands; |
| 9887 | stream->write(&opcode_vkCmdExecuteCommands, sizeof(uint32_t)); |
| 9888 | stream->write(&packetSize_vkCmdExecuteCommands, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9889 | uint64_t cgen_var_661; |
| 9890 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_661, 1); |
| 9891 | stream->write((uint64_t*)&cgen_var_661, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9892 | stream->write((uint32_t*)&local_commandBufferCount, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9893 | if (((commandBufferCount))) |
| 9894 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9895 | uint64_t* cgen_var_662; |
| 9896 | stream->alloc((void**)&cgen_var_662, ((commandBufferCount)) * 8); |
| 9897 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(local_pCommandBuffers, cgen_var_662, ((commandBufferCount))); |
| 9898 | stream->write((uint64_t*)cgen_var_662, ((commandBufferCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9899 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 9900 | AEMU_SCOPED_TRACE("vkCmdExecuteCommands readParams"); |
| 9901 | AEMU_SCOPED_TRACE("vkCmdExecuteCommands returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9902 | mImpl->log("finish vkCmdExecuteCommands");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9903 | } |
| 9904 | |
| 9905 | #endif |
| 9906 | #ifdef VK_VERSION_1_1 |
| 9907 | VkResult VkEncoder::vkEnumerateInstanceVersion( |
| 9908 | uint32_t* pApiVersion) |
| 9909 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 9910 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | e739199 | 2019-03-15 09:42:13 -0700 | [diff] [blame] | 9911 | AEMU_SCOPED_TRACE("vkEnumerateInstanceVersion encode"); |
| 9912 | mImpl->log("start vkEnumerateInstanceVersion"); |
| 9913 | auto stream = mImpl->stream(); |
| 9914 | auto countingStream = mImpl->countingStream(); |
| 9915 | auto resources = mImpl->resources(); |
| 9916 | auto pool = mImpl->pool(); |
| 9917 | stream->setHandleMapping(resources->unwrapMapping()); |
| 9918 | countingStream->rewind(); |
| 9919 | { |
| 9920 | countingStream->write((uint32_t*)pApiVersion, sizeof(uint32_t)); |
| 9921 | } |
| 9922 | uint32_t packetSize_vkEnumerateInstanceVersion = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 9923 | countingStream->rewind(); |
| 9924 | uint32_t opcode_vkEnumerateInstanceVersion = OP_vkEnumerateInstanceVersion; |
| 9925 | stream->write(&opcode_vkEnumerateInstanceVersion, sizeof(uint32_t)); |
| 9926 | stream->write(&packetSize_vkEnumerateInstanceVersion, sizeof(uint32_t)); |
| 9927 | stream->write((uint32_t*)pApiVersion, sizeof(uint32_t)); |
| 9928 | AEMU_SCOPED_TRACE("vkEnumerateInstanceVersion readParams"); |
| 9929 | stream->read((uint32_t*)pApiVersion, sizeof(uint32_t)); |
| 9930 | AEMU_SCOPED_TRACE("vkEnumerateInstanceVersion returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9931 | VkResult vkEnumerateInstanceVersion_VkResult_return = (VkResult)0; |
| Lingfeng Yang | e739199 | 2019-03-15 09:42:13 -0700 | [diff] [blame] | 9932 | stream->read(&vkEnumerateInstanceVersion_VkResult_return, sizeof(VkResult)); |
| 9933 | countingStream->clearPool(); |
| 9934 | stream->clearPool(); |
| 9935 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9936 | mImpl->log("finish vkEnumerateInstanceVersion");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9937 | return vkEnumerateInstanceVersion_VkResult_return; |
| 9938 | } |
| 9939 | |
| 9940 | VkResult VkEncoder::vkBindBufferMemory2( |
| 9941 | VkDevice device, |
| 9942 | uint32_t bindInfoCount, |
| 9943 | const VkBindBufferMemoryInfo* pBindInfos) |
| 9944 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 9945 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 9946 | AEMU_SCOPED_TRACE("vkBindBufferMemory2 encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9947 | mImpl->log("start vkBindBufferMemory2"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9948 | auto stream = mImpl->stream(); |
| 9949 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9950 | auto resources = mImpl->resources(); |
| 9951 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 9952 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9953 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9954 | uint32_t local_bindInfoCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9955 | VkBindBufferMemoryInfo* local_pBindInfos; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 9956 | local_device = device; |
| 9957 | local_bindInfoCount = bindInfoCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9958 | local_pBindInfos = nullptr; |
| 9959 | if (pBindInfos) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9960 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9961 | local_pBindInfos = (VkBindBufferMemoryInfo*)pool->alloc(((bindInfoCount)) * sizeof(const VkBindBufferMemoryInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9962 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 9963 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9964 | deepcopy_VkBindBufferMemoryInfo(pool, pBindInfos + i, (VkBindBufferMemoryInfo*)(local_pBindInfos + i)); |
| 9965 | } |
| 9966 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 9967 | if (local_pBindInfos) |
| 9968 | { |
| 9969 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 9970 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 9971 | transform_tohost_VkBindBufferMemoryInfo(mImpl->resources(), (VkBindBufferMemoryInfo*)(local_pBindInfos + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 9972 | } |
| 9973 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9974 | countingStream->rewind(); |
| 9975 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9976 | uint64_t cgen_var_663; |
| 9977 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_663, 1); |
| 9978 | countingStream->write((uint64_t*)&cgen_var_663, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9979 | countingStream->write((uint32_t*)&local_bindInfoCount, sizeof(uint32_t)); |
| 9980 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 9981 | { |
| 9982 | marshal_VkBindBufferMemoryInfo(countingStream, (VkBindBufferMemoryInfo*)(local_pBindInfos + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9983 | } |
| 9984 | } |
| 9985 | uint32_t packetSize_vkBindBufferMemory2 = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 9986 | countingStream->rewind(); |
| 9987 | uint32_t opcode_vkBindBufferMemory2 = OP_vkBindBufferMemory2; |
| 9988 | stream->write(&opcode_vkBindBufferMemory2, sizeof(uint32_t)); |
| 9989 | stream->write(&packetSize_vkBindBufferMemory2, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9990 | uint64_t cgen_var_664; |
| 9991 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_664, 1); |
| 9992 | stream->write((uint64_t*)&cgen_var_664, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9993 | stream->write((uint32_t*)&local_bindInfoCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9994 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 9995 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9996 | marshal_VkBindBufferMemoryInfo(stream, (VkBindBufferMemoryInfo*)(local_pBindInfos + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9997 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 9998 | AEMU_SCOPED_TRACE("vkBindBufferMemory2 readParams"); |
| 9999 | AEMU_SCOPED_TRACE("vkBindBufferMemory2 returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10000 | VkResult vkBindBufferMemory2_VkResult_return = (VkResult)0; |
| 10001 | stream->read(&vkBindBufferMemory2_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10002 | countingStream->clearPool(); |
| 10003 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 10004 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10005 | mImpl->log("finish vkBindBufferMemory2");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10006 | return vkBindBufferMemory2_VkResult_return; |
| 10007 | } |
| 10008 | |
| 10009 | VkResult VkEncoder::vkBindImageMemory2( |
| 10010 | VkDevice device, |
| 10011 | uint32_t bindInfoCount, |
| 10012 | const VkBindImageMemoryInfo* pBindInfos) |
| 10013 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 10014 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 10015 | AEMU_SCOPED_TRACE("vkBindImageMemory2 encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10016 | mImpl->log("start vkBindImageMemory2"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10017 | auto stream = mImpl->stream(); |
| 10018 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10019 | auto resources = mImpl->resources(); |
| 10020 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 10021 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10022 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10023 | uint32_t local_bindInfoCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10024 | VkBindImageMemoryInfo* local_pBindInfos; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 10025 | local_device = device; |
| 10026 | local_bindInfoCount = bindInfoCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10027 | local_pBindInfos = nullptr; |
| 10028 | if (pBindInfos) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10029 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10030 | local_pBindInfos = (VkBindImageMemoryInfo*)pool->alloc(((bindInfoCount)) * sizeof(const VkBindImageMemoryInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10031 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 10032 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10033 | deepcopy_VkBindImageMemoryInfo(pool, pBindInfos + i, (VkBindImageMemoryInfo*)(local_pBindInfos + i)); |
| 10034 | } |
| 10035 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 10036 | if (local_pBindInfos) |
| 10037 | { |
| 10038 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 10039 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 10040 | transform_tohost_VkBindImageMemoryInfo(mImpl->resources(), (VkBindImageMemoryInfo*)(local_pBindInfos + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 10041 | } |
| 10042 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10043 | countingStream->rewind(); |
| 10044 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10045 | uint64_t cgen_var_665; |
| 10046 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_665, 1); |
| 10047 | countingStream->write((uint64_t*)&cgen_var_665, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10048 | countingStream->write((uint32_t*)&local_bindInfoCount, sizeof(uint32_t)); |
| 10049 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 10050 | { |
| 10051 | marshal_VkBindImageMemoryInfo(countingStream, (VkBindImageMemoryInfo*)(local_pBindInfos + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10052 | } |
| 10053 | } |
| 10054 | uint32_t packetSize_vkBindImageMemory2 = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 10055 | countingStream->rewind(); |
| 10056 | uint32_t opcode_vkBindImageMemory2 = OP_vkBindImageMemory2; |
| 10057 | stream->write(&opcode_vkBindImageMemory2, sizeof(uint32_t)); |
| 10058 | stream->write(&packetSize_vkBindImageMemory2, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10059 | uint64_t cgen_var_666; |
| 10060 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_666, 1); |
| 10061 | stream->write((uint64_t*)&cgen_var_666, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10062 | stream->write((uint32_t*)&local_bindInfoCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10063 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 10064 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10065 | marshal_VkBindImageMemoryInfo(stream, (VkBindImageMemoryInfo*)(local_pBindInfos + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10066 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 10067 | AEMU_SCOPED_TRACE("vkBindImageMemory2 readParams"); |
| 10068 | AEMU_SCOPED_TRACE("vkBindImageMemory2 returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10069 | VkResult vkBindImageMemory2_VkResult_return = (VkResult)0; |
| 10070 | stream->read(&vkBindImageMemory2_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10071 | countingStream->clearPool(); |
| 10072 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 10073 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10074 | mImpl->log("finish vkBindImageMemory2");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10075 | return vkBindImageMemory2_VkResult_return; |
| 10076 | } |
| 10077 | |
| 10078 | void VkEncoder::vkGetDeviceGroupPeerMemoryFeatures( |
| 10079 | VkDevice device, |
| 10080 | uint32_t heapIndex, |
| 10081 | uint32_t localDeviceIndex, |
| 10082 | uint32_t remoteDeviceIndex, |
| 10083 | VkPeerMemoryFeatureFlags* pPeerMemoryFeatures) |
| 10084 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 10085 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 10086 | AEMU_SCOPED_TRACE("vkGetDeviceGroupPeerMemoryFeatures encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10087 | mImpl->log("start vkGetDeviceGroupPeerMemoryFeatures"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10088 | auto stream = mImpl->stream(); |
| 10089 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10090 | auto resources = mImpl->resources(); |
| 10091 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 10092 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10093 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10094 | uint32_t local_heapIndex; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10095 | uint32_t local_localDeviceIndex; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10096 | uint32_t local_remoteDeviceIndex; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 10097 | local_device = device; |
| 10098 | local_heapIndex = heapIndex; |
| 10099 | local_localDeviceIndex = localDeviceIndex; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10100 | local_remoteDeviceIndex = remoteDeviceIndex; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10101 | countingStream->rewind(); |
| 10102 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10103 | uint64_t cgen_var_667; |
| 10104 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_667, 1); |
| 10105 | countingStream->write((uint64_t*)&cgen_var_667, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10106 | countingStream->write((uint32_t*)&local_heapIndex, sizeof(uint32_t)); |
| 10107 | countingStream->write((uint32_t*)&local_localDeviceIndex, sizeof(uint32_t)); |
| 10108 | countingStream->write((uint32_t*)&local_remoteDeviceIndex, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10109 | countingStream->write((VkPeerMemoryFeatureFlags*)pPeerMemoryFeatures, sizeof(VkPeerMemoryFeatureFlags)); |
| 10110 | } |
| 10111 | uint32_t packetSize_vkGetDeviceGroupPeerMemoryFeatures = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 10112 | countingStream->rewind(); |
| 10113 | uint32_t opcode_vkGetDeviceGroupPeerMemoryFeatures = OP_vkGetDeviceGroupPeerMemoryFeatures; |
| 10114 | stream->write(&opcode_vkGetDeviceGroupPeerMemoryFeatures, sizeof(uint32_t)); |
| 10115 | stream->write(&packetSize_vkGetDeviceGroupPeerMemoryFeatures, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10116 | uint64_t cgen_var_668; |
| 10117 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_668, 1); |
| 10118 | stream->write((uint64_t*)&cgen_var_668, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10119 | stream->write((uint32_t*)&local_heapIndex, sizeof(uint32_t)); |
| 10120 | stream->write((uint32_t*)&local_localDeviceIndex, sizeof(uint32_t)); |
| 10121 | stream->write((uint32_t*)&local_remoteDeviceIndex, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10122 | stream->write((VkPeerMemoryFeatureFlags*)pPeerMemoryFeatures, sizeof(VkPeerMemoryFeatureFlags)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 10123 | AEMU_SCOPED_TRACE("vkGetDeviceGroupPeerMemoryFeatures readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10124 | stream->read((VkPeerMemoryFeatureFlags*)pPeerMemoryFeatures, sizeof(VkPeerMemoryFeatureFlags)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 10125 | AEMU_SCOPED_TRACE("vkGetDeviceGroupPeerMemoryFeatures returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10126 | mImpl->log("finish vkGetDeviceGroupPeerMemoryFeatures");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10127 | } |
| 10128 | |
| 10129 | void VkEncoder::vkCmdSetDeviceMask( |
| 10130 | VkCommandBuffer commandBuffer, |
| 10131 | uint32_t deviceMask) |
| 10132 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 10133 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 10134 | AEMU_SCOPED_TRACE("vkCmdSetDeviceMask encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10135 | mImpl->log("start vkCmdSetDeviceMask"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10136 | auto stream = mImpl->stream(); |
| 10137 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10138 | auto resources = mImpl->resources(); |
| 10139 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 10140 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10141 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10142 | uint32_t local_deviceMask; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 10143 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10144 | local_deviceMask = deviceMask; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10145 | countingStream->rewind(); |
| 10146 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10147 | uint64_t cgen_var_669; |
| 10148 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_669, 1); |
| 10149 | countingStream->write((uint64_t*)&cgen_var_669, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10150 | countingStream->write((uint32_t*)&local_deviceMask, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10151 | } |
| 10152 | uint32_t packetSize_vkCmdSetDeviceMask = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 10153 | countingStream->rewind(); |
| 10154 | uint32_t opcode_vkCmdSetDeviceMask = OP_vkCmdSetDeviceMask; |
| 10155 | stream->write(&opcode_vkCmdSetDeviceMask, sizeof(uint32_t)); |
| 10156 | stream->write(&packetSize_vkCmdSetDeviceMask, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10157 | uint64_t cgen_var_670; |
| 10158 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_670, 1); |
| 10159 | stream->write((uint64_t*)&cgen_var_670, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10160 | stream->write((uint32_t*)&local_deviceMask, sizeof(uint32_t)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 10161 | AEMU_SCOPED_TRACE("vkCmdSetDeviceMask readParams"); |
| 10162 | AEMU_SCOPED_TRACE("vkCmdSetDeviceMask returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10163 | mImpl->log("finish vkCmdSetDeviceMask");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10164 | } |
| 10165 | |
| 10166 | void VkEncoder::vkCmdDispatchBase( |
| 10167 | VkCommandBuffer commandBuffer, |
| 10168 | uint32_t baseGroupX, |
| 10169 | uint32_t baseGroupY, |
| 10170 | uint32_t baseGroupZ, |
| 10171 | uint32_t groupCountX, |
| 10172 | uint32_t groupCountY, |
| 10173 | uint32_t groupCountZ) |
| 10174 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 10175 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 10176 | AEMU_SCOPED_TRACE("vkCmdDispatchBase encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10177 | mImpl->log("start vkCmdDispatchBase"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10178 | auto stream = mImpl->stream(); |
| 10179 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10180 | auto resources = mImpl->resources(); |
| 10181 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 10182 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10183 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10184 | uint32_t local_baseGroupX; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10185 | uint32_t local_baseGroupY; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10186 | uint32_t local_baseGroupZ; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10187 | uint32_t local_groupCountX; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10188 | uint32_t local_groupCountY; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10189 | uint32_t local_groupCountZ; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 10190 | local_commandBuffer = commandBuffer; |
| 10191 | local_baseGroupX = baseGroupX; |
| 10192 | local_baseGroupY = baseGroupY; |
| 10193 | local_baseGroupZ = baseGroupZ; |
| 10194 | local_groupCountX = groupCountX; |
| 10195 | local_groupCountY = groupCountY; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10196 | local_groupCountZ = groupCountZ; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10197 | countingStream->rewind(); |
| 10198 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10199 | uint64_t cgen_var_671; |
| 10200 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_671, 1); |
| 10201 | countingStream->write((uint64_t*)&cgen_var_671, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10202 | countingStream->write((uint32_t*)&local_baseGroupX, sizeof(uint32_t)); |
| 10203 | countingStream->write((uint32_t*)&local_baseGroupY, sizeof(uint32_t)); |
| 10204 | countingStream->write((uint32_t*)&local_baseGroupZ, sizeof(uint32_t)); |
| 10205 | countingStream->write((uint32_t*)&local_groupCountX, sizeof(uint32_t)); |
| 10206 | countingStream->write((uint32_t*)&local_groupCountY, sizeof(uint32_t)); |
| 10207 | countingStream->write((uint32_t*)&local_groupCountZ, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10208 | } |
| 10209 | uint32_t packetSize_vkCmdDispatchBase = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 10210 | countingStream->rewind(); |
| 10211 | uint32_t opcode_vkCmdDispatchBase = OP_vkCmdDispatchBase; |
| 10212 | stream->write(&opcode_vkCmdDispatchBase, sizeof(uint32_t)); |
| 10213 | stream->write(&packetSize_vkCmdDispatchBase, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10214 | uint64_t cgen_var_672; |
| 10215 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_672, 1); |
| 10216 | stream->write((uint64_t*)&cgen_var_672, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10217 | stream->write((uint32_t*)&local_baseGroupX, sizeof(uint32_t)); |
| 10218 | stream->write((uint32_t*)&local_baseGroupY, sizeof(uint32_t)); |
| 10219 | stream->write((uint32_t*)&local_baseGroupZ, sizeof(uint32_t)); |
| 10220 | stream->write((uint32_t*)&local_groupCountX, sizeof(uint32_t)); |
| 10221 | stream->write((uint32_t*)&local_groupCountY, sizeof(uint32_t)); |
| 10222 | stream->write((uint32_t*)&local_groupCountZ, sizeof(uint32_t)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 10223 | AEMU_SCOPED_TRACE("vkCmdDispatchBase readParams"); |
| 10224 | AEMU_SCOPED_TRACE("vkCmdDispatchBase returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10225 | mImpl->log("finish vkCmdDispatchBase");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10226 | } |
| 10227 | |
| 10228 | VkResult VkEncoder::vkEnumeratePhysicalDeviceGroups( |
| 10229 | VkInstance instance, |
| 10230 | uint32_t* pPhysicalDeviceGroupCount, |
| 10231 | VkPhysicalDeviceGroupProperties* pPhysicalDeviceGroupProperties) |
| 10232 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 10233 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 10234 | AEMU_SCOPED_TRACE("vkEnumeratePhysicalDeviceGroups encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10235 | mImpl->log("start vkEnumeratePhysicalDeviceGroups"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10236 | auto stream = mImpl->stream(); |
| 10237 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10238 | auto resources = mImpl->resources(); |
| 10239 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 10240 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10241 | VkInstance local_instance; |
| 10242 | local_instance = instance; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10243 | countingStream->rewind(); |
| 10244 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10245 | uint64_t cgen_var_673; |
| 10246 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_673, 1); |
| 10247 | countingStream->write((uint64_t*)&cgen_var_673, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10248 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10249 | uint64_t cgen_var_674 = (uint64_t)(uintptr_t)pPhysicalDeviceGroupCount; |
| 10250 | countingStream->putBe64(cgen_var_674); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10251 | if (pPhysicalDeviceGroupCount) |
| 10252 | { |
| 10253 | countingStream->write((uint32_t*)pPhysicalDeviceGroupCount, sizeof(uint32_t)); |
| 10254 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10255 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10256 | uint64_t cgen_var_675 = (uint64_t)(uintptr_t)pPhysicalDeviceGroupProperties; |
| 10257 | countingStream->putBe64(cgen_var_675); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10258 | if (pPhysicalDeviceGroupProperties) |
| 10259 | { |
| 10260 | for (uint32_t i = 0; i < (uint32_t)(*(pPhysicalDeviceGroupCount)); ++i) |
| 10261 | { |
| 10262 | marshal_VkPhysicalDeviceGroupProperties(countingStream, (VkPhysicalDeviceGroupProperties*)(pPhysicalDeviceGroupProperties + i)); |
| 10263 | } |
| 10264 | } |
| 10265 | } |
| 10266 | uint32_t packetSize_vkEnumeratePhysicalDeviceGroups = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 10267 | countingStream->rewind(); |
| 10268 | uint32_t opcode_vkEnumeratePhysicalDeviceGroups = OP_vkEnumeratePhysicalDeviceGroups; |
| 10269 | stream->write(&opcode_vkEnumeratePhysicalDeviceGroups, sizeof(uint32_t)); |
| 10270 | stream->write(&packetSize_vkEnumeratePhysicalDeviceGroups, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10271 | uint64_t cgen_var_676; |
| 10272 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_676, 1); |
| 10273 | stream->write((uint64_t*)&cgen_var_676, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10274 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10275 | uint64_t cgen_var_677 = (uint64_t)(uintptr_t)pPhysicalDeviceGroupCount; |
| 10276 | stream->putBe64(cgen_var_677); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10277 | if (pPhysicalDeviceGroupCount) |
| 10278 | { |
| 10279 | stream->write((uint32_t*)pPhysicalDeviceGroupCount, sizeof(uint32_t)); |
| 10280 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10281 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10282 | uint64_t cgen_var_678 = (uint64_t)(uintptr_t)pPhysicalDeviceGroupProperties; |
| 10283 | stream->putBe64(cgen_var_678); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10284 | if (pPhysicalDeviceGroupProperties) |
| 10285 | { |
| 10286 | for (uint32_t i = 0; i < (uint32_t)(*(pPhysicalDeviceGroupCount)); ++i) |
| 10287 | { |
| 10288 | marshal_VkPhysicalDeviceGroupProperties(stream, (VkPhysicalDeviceGroupProperties*)(pPhysicalDeviceGroupProperties + i)); |
| 10289 | } |
| 10290 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 10291 | AEMU_SCOPED_TRACE("vkEnumeratePhysicalDeviceGroups readParams"); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10292 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10293 | uint32_t* check_pPhysicalDeviceGroupCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10294 | check_pPhysicalDeviceGroupCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10295 | if (pPhysicalDeviceGroupCount) |
| 10296 | { |
| 10297 | if (!(check_pPhysicalDeviceGroupCount)) |
| 10298 | { |
| 10299 | fprintf(stderr, "fatal: pPhysicalDeviceGroupCount inconsistent between guest and host\n"); |
| 10300 | } |
| 10301 | stream->read((uint32_t*)pPhysicalDeviceGroupCount, sizeof(uint32_t)); |
| 10302 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10303 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10304 | VkPhysicalDeviceGroupProperties* check_pPhysicalDeviceGroupProperties; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10305 | check_pPhysicalDeviceGroupProperties = (VkPhysicalDeviceGroupProperties*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10306 | if (pPhysicalDeviceGroupProperties) |
| 10307 | { |
| 10308 | if (!(check_pPhysicalDeviceGroupProperties)) |
| 10309 | { |
| 10310 | fprintf(stderr, "fatal: pPhysicalDeviceGroupProperties inconsistent between guest and host\n"); |
| 10311 | } |
| 10312 | for (uint32_t i = 0; i < (uint32_t)(*(pPhysicalDeviceGroupCount)); ++i) |
| 10313 | { |
| 10314 | unmarshal_VkPhysicalDeviceGroupProperties(stream, (VkPhysicalDeviceGroupProperties*)(pPhysicalDeviceGroupProperties + i)); |
| 10315 | } |
| 10316 | } |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 10317 | if (pPhysicalDeviceGroupProperties) |
| 10318 | { |
| 10319 | for (uint32_t i = 0; i < (uint32_t)(*(pPhysicalDeviceGroupCount)); ++i) |
| 10320 | { |
| 10321 | transform_fromhost_VkPhysicalDeviceGroupProperties(mImpl->resources(), (VkPhysicalDeviceGroupProperties*)(pPhysicalDeviceGroupProperties + i)); |
| 10322 | } |
| 10323 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 10324 | AEMU_SCOPED_TRACE("vkEnumeratePhysicalDeviceGroups returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10325 | VkResult vkEnumeratePhysicalDeviceGroups_VkResult_return = (VkResult)0; |
| 10326 | stream->read(&vkEnumeratePhysicalDeviceGroups_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10327 | countingStream->clearPool(); |
| 10328 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 10329 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10330 | mImpl->log("finish vkEnumeratePhysicalDeviceGroups");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10331 | return vkEnumeratePhysicalDeviceGroups_VkResult_return; |
| 10332 | } |
| 10333 | |
| 10334 | void VkEncoder::vkGetImageMemoryRequirements2( |
| 10335 | VkDevice device, |
| 10336 | const VkImageMemoryRequirementsInfo2* pInfo, |
| 10337 | VkMemoryRequirements2* pMemoryRequirements) |
| 10338 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 10339 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 10340 | AEMU_SCOPED_TRACE("vkGetImageMemoryRequirements2 encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10341 | mImpl->log("start vkGetImageMemoryRequirements2"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10342 | auto stream = mImpl->stream(); |
| 10343 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10344 | auto resources = mImpl->resources(); |
| 10345 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 10346 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10347 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10348 | VkImageMemoryRequirementsInfo2* local_pInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 10349 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10350 | local_pInfo = nullptr; |
| 10351 | if (pInfo) |
| 10352 | { |
| 10353 | local_pInfo = (VkImageMemoryRequirementsInfo2*)pool->alloc(sizeof(const VkImageMemoryRequirementsInfo2)); |
| 10354 | deepcopy_VkImageMemoryRequirementsInfo2(pool, pInfo, (VkImageMemoryRequirementsInfo2*)(local_pInfo)); |
| 10355 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 10356 | if (local_pInfo) |
| 10357 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 10358 | transform_tohost_VkImageMemoryRequirementsInfo2(mImpl->resources(), (VkImageMemoryRequirementsInfo2*)(local_pInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 10359 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10360 | countingStream->rewind(); |
| 10361 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10362 | uint64_t cgen_var_681; |
| 10363 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_681, 1); |
| 10364 | countingStream->write((uint64_t*)&cgen_var_681, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10365 | marshal_VkImageMemoryRequirementsInfo2(countingStream, (VkImageMemoryRequirementsInfo2*)(local_pInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10366 | marshal_VkMemoryRequirements2(countingStream, (VkMemoryRequirements2*)(pMemoryRequirements)); |
| 10367 | } |
| 10368 | uint32_t packetSize_vkGetImageMemoryRequirements2 = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 10369 | countingStream->rewind(); |
| 10370 | uint32_t opcode_vkGetImageMemoryRequirements2 = OP_vkGetImageMemoryRequirements2; |
| 10371 | stream->write(&opcode_vkGetImageMemoryRequirements2, sizeof(uint32_t)); |
| 10372 | stream->write(&packetSize_vkGetImageMemoryRequirements2, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10373 | uint64_t cgen_var_682; |
| 10374 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_682, 1); |
| 10375 | stream->write((uint64_t*)&cgen_var_682, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10376 | marshal_VkImageMemoryRequirementsInfo2(stream, (VkImageMemoryRequirementsInfo2*)(local_pInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10377 | marshal_VkMemoryRequirements2(stream, (VkMemoryRequirements2*)(pMemoryRequirements)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 10378 | AEMU_SCOPED_TRACE("vkGetImageMemoryRequirements2 readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10379 | unmarshal_VkMemoryRequirements2(stream, (VkMemoryRequirements2*)(pMemoryRequirements)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 10380 | if (pMemoryRequirements) |
| 10381 | { |
| 10382 | transform_fromhost_VkMemoryRequirements2(mImpl->resources(), (VkMemoryRequirements2*)(pMemoryRequirements)); |
| 10383 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 10384 | AEMU_SCOPED_TRACE("vkGetImageMemoryRequirements2 returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10385 | mImpl->log("finish vkGetImageMemoryRequirements2");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10386 | } |
| 10387 | |
| 10388 | void VkEncoder::vkGetBufferMemoryRequirements2( |
| 10389 | VkDevice device, |
| 10390 | const VkBufferMemoryRequirementsInfo2* pInfo, |
| 10391 | VkMemoryRequirements2* pMemoryRequirements) |
| 10392 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 10393 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 10394 | AEMU_SCOPED_TRACE("vkGetBufferMemoryRequirements2 encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10395 | mImpl->log("start vkGetBufferMemoryRequirements2"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10396 | auto stream = mImpl->stream(); |
| 10397 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10398 | auto resources = mImpl->resources(); |
| 10399 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 10400 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10401 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10402 | VkBufferMemoryRequirementsInfo2* local_pInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 10403 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10404 | local_pInfo = nullptr; |
| 10405 | if (pInfo) |
| 10406 | { |
| 10407 | local_pInfo = (VkBufferMemoryRequirementsInfo2*)pool->alloc(sizeof(const VkBufferMemoryRequirementsInfo2)); |
| 10408 | deepcopy_VkBufferMemoryRequirementsInfo2(pool, pInfo, (VkBufferMemoryRequirementsInfo2*)(local_pInfo)); |
| 10409 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 10410 | if (local_pInfo) |
| 10411 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 10412 | transform_tohost_VkBufferMemoryRequirementsInfo2(mImpl->resources(), (VkBufferMemoryRequirementsInfo2*)(local_pInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 10413 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10414 | countingStream->rewind(); |
| 10415 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10416 | uint64_t cgen_var_683; |
| 10417 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_683, 1); |
| 10418 | countingStream->write((uint64_t*)&cgen_var_683, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10419 | marshal_VkBufferMemoryRequirementsInfo2(countingStream, (VkBufferMemoryRequirementsInfo2*)(local_pInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10420 | marshal_VkMemoryRequirements2(countingStream, (VkMemoryRequirements2*)(pMemoryRequirements)); |
| 10421 | } |
| 10422 | uint32_t packetSize_vkGetBufferMemoryRequirements2 = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 10423 | countingStream->rewind(); |
| 10424 | uint32_t opcode_vkGetBufferMemoryRequirements2 = OP_vkGetBufferMemoryRequirements2; |
| 10425 | stream->write(&opcode_vkGetBufferMemoryRequirements2, sizeof(uint32_t)); |
| 10426 | stream->write(&packetSize_vkGetBufferMemoryRequirements2, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10427 | uint64_t cgen_var_684; |
| 10428 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_684, 1); |
| 10429 | stream->write((uint64_t*)&cgen_var_684, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10430 | marshal_VkBufferMemoryRequirementsInfo2(stream, (VkBufferMemoryRequirementsInfo2*)(local_pInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10431 | marshal_VkMemoryRequirements2(stream, (VkMemoryRequirements2*)(pMemoryRequirements)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 10432 | AEMU_SCOPED_TRACE("vkGetBufferMemoryRequirements2 readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10433 | unmarshal_VkMemoryRequirements2(stream, (VkMemoryRequirements2*)(pMemoryRequirements)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 10434 | if (pMemoryRequirements) |
| 10435 | { |
| 10436 | transform_fromhost_VkMemoryRequirements2(mImpl->resources(), (VkMemoryRequirements2*)(pMemoryRequirements)); |
| 10437 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 10438 | AEMU_SCOPED_TRACE("vkGetBufferMemoryRequirements2 returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10439 | mImpl->log("finish vkGetBufferMemoryRequirements2");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10440 | } |
| 10441 | |
| 10442 | void VkEncoder::vkGetImageSparseMemoryRequirements2( |
| 10443 | VkDevice device, |
| 10444 | const VkImageSparseMemoryRequirementsInfo2* pInfo, |
| 10445 | uint32_t* pSparseMemoryRequirementCount, |
| 10446 | VkSparseImageMemoryRequirements2* pSparseMemoryRequirements) |
| 10447 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 10448 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 10449 | AEMU_SCOPED_TRACE("vkGetImageSparseMemoryRequirements2 encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10450 | mImpl->log("start vkGetImageSparseMemoryRequirements2"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10451 | auto stream = mImpl->stream(); |
| 10452 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10453 | auto resources = mImpl->resources(); |
| 10454 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 10455 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10456 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10457 | VkImageSparseMemoryRequirementsInfo2* local_pInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 10458 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10459 | local_pInfo = nullptr; |
| 10460 | if (pInfo) |
| 10461 | { |
| 10462 | local_pInfo = (VkImageSparseMemoryRequirementsInfo2*)pool->alloc(sizeof(const VkImageSparseMemoryRequirementsInfo2)); |
| 10463 | deepcopy_VkImageSparseMemoryRequirementsInfo2(pool, pInfo, (VkImageSparseMemoryRequirementsInfo2*)(local_pInfo)); |
| 10464 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 10465 | if (local_pInfo) |
| 10466 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 10467 | transform_tohost_VkImageSparseMemoryRequirementsInfo2(mImpl->resources(), (VkImageSparseMemoryRequirementsInfo2*)(local_pInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 10468 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10469 | countingStream->rewind(); |
| 10470 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10471 | uint64_t cgen_var_685; |
| 10472 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_685, 1); |
| 10473 | countingStream->write((uint64_t*)&cgen_var_685, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10474 | marshal_VkImageSparseMemoryRequirementsInfo2(countingStream, (VkImageSparseMemoryRequirementsInfo2*)(local_pInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10475 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10476 | uint64_t cgen_var_686 = (uint64_t)(uintptr_t)pSparseMemoryRequirementCount; |
| 10477 | countingStream->putBe64(cgen_var_686); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10478 | if (pSparseMemoryRequirementCount) |
| 10479 | { |
| 10480 | countingStream->write((uint32_t*)pSparseMemoryRequirementCount, sizeof(uint32_t)); |
| 10481 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10482 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10483 | uint64_t cgen_var_687 = (uint64_t)(uintptr_t)pSparseMemoryRequirements; |
| 10484 | countingStream->putBe64(cgen_var_687); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10485 | if (pSparseMemoryRequirements) |
| 10486 | { |
| 10487 | for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i) |
| 10488 | { |
| 10489 | marshal_VkSparseImageMemoryRequirements2(countingStream, (VkSparseImageMemoryRequirements2*)(pSparseMemoryRequirements + i)); |
| 10490 | } |
| 10491 | } |
| 10492 | } |
| 10493 | uint32_t packetSize_vkGetImageSparseMemoryRequirements2 = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 10494 | countingStream->rewind(); |
| 10495 | uint32_t opcode_vkGetImageSparseMemoryRequirements2 = OP_vkGetImageSparseMemoryRequirements2; |
| 10496 | stream->write(&opcode_vkGetImageSparseMemoryRequirements2, sizeof(uint32_t)); |
| 10497 | stream->write(&packetSize_vkGetImageSparseMemoryRequirements2, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10498 | uint64_t cgen_var_688; |
| 10499 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_688, 1); |
| 10500 | stream->write((uint64_t*)&cgen_var_688, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10501 | marshal_VkImageSparseMemoryRequirementsInfo2(stream, (VkImageSparseMemoryRequirementsInfo2*)(local_pInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10502 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10503 | uint64_t cgen_var_689 = (uint64_t)(uintptr_t)pSparseMemoryRequirementCount; |
| 10504 | stream->putBe64(cgen_var_689); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10505 | if (pSparseMemoryRequirementCount) |
| 10506 | { |
| 10507 | stream->write((uint32_t*)pSparseMemoryRequirementCount, sizeof(uint32_t)); |
| 10508 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10509 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10510 | uint64_t cgen_var_690 = (uint64_t)(uintptr_t)pSparseMemoryRequirements; |
| 10511 | stream->putBe64(cgen_var_690); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10512 | if (pSparseMemoryRequirements) |
| 10513 | { |
| 10514 | for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i) |
| 10515 | { |
| 10516 | marshal_VkSparseImageMemoryRequirements2(stream, (VkSparseImageMemoryRequirements2*)(pSparseMemoryRequirements + i)); |
| 10517 | } |
| 10518 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 10519 | AEMU_SCOPED_TRACE("vkGetImageSparseMemoryRequirements2 readParams"); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10520 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10521 | uint32_t* check_pSparseMemoryRequirementCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10522 | check_pSparseMemoryRequirementCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10523 | if (pSparseMemoryRequirementCount) |
| 10524 | { |
| 10525 | if (!(check_pSparseMemoryRequirementCount)) |
| 10526 | { |
| 10527 | fprintf(stderr, "fatal: pSparseMemoryRequirementCount inconsistent between guest and host\n"); |
| 10528 | } |
| 10529 | stream->read((uint32_t*)pSparseMemoryRequirementCount, sizeof(uint32_t)); |
| 10530 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10531 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10532 | VkSparseImageMemoryRequirements2* check_pSparseMemoryRequirements; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10533 | check_pSparseMemoryRequirements = (VkSparseImageMemoryRequirements2*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10534 | if (pSparseMemoryRequirements) |
| 10535 | { |
| 10536 | if (!(check_pSparseMemoryRequirements)) |
| 10537 | { |
| 10538 | fprintf(stderr, "fatal: pSparseMemoryRequirements inconsistent between guest and host\n"); |
| 10539 | } |
| 10540 | for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i) |
| 10541 | { |
| 10542 | unmarshal_VkSparseImageMemoryRequirements2(stream, (VkSparseImageMemoryRequirements2*)(pSparseMemoryRequirements + i)); |
| 10543 | } |
| 10544 | } |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 10545 | if (pSparseMemoryRequirements) |
| 10546 | { |
| 10547 | for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i) |
| 10548 | { |
| 10549 | transform_fromhost_VkSparseImageMemoryRequirements2(mImpl->resources(), (VkSparseImageMemoryRequirements2*)(pSparseMemoryRequirements + i)); |
| 10550 | } |
| 10551 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 10552 | AEMU_SCOPED_TRACE("vkGetImageSparseMemoryRequirements2 returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10553 | mImpl->log("finish vkGetImageSparseMemoryRequirements2");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10554 | } |
| 10555 | |
| 10556 | void VkEncoder::vkGetPhysicalDeviceFeatures2( |
| 10557 | VkPhysicalDevice physicalDevice, |
| 10558 | VkPhysicalDeviceFeatures2* pFeatures) |
| 10559 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 10560 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 10561 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceFeatures2 encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10562 | mImpl->log("start vkGetPhysicalDeviceFeatures2"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10563 | auto stream = mImpl->stream(); |
| 10564 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10565 | auto resources = mImpl->resources(); |
| 10566 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 10567 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10568 | VkPhysicalDevice local_physicalDevice; |
| 10569 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10570 | countingStream->rewind(); |
| 10571 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10572 | uint64_t cgen_var_693; |
| 10573 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_693, 1); |
| 10574 | countingStream->write((uint64_t*)&cgen_var_693, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10575 | marshal_VkPhysicalDeviceFeatures2(countingStream, (VkPhysicalDeviceFeatures2*)(pFeatures)); |
| 10576 | } |
| 10577 | uint32_t packetSize_vkGetPhysicalDeviceFeatures2 = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 10578 | countingStream->rewind(); |
| 10579 | uint32_t opcode_vkGetPhysicalDeviceFeatures2 = OP_vkGetPhysicalDeviceFeatures2; |
| 10580 | stream->write(&opcode_vkGetPhysicalDeviceFeatures2, sizeof(uint32_t)); |
| 10581 | stream->write(&packetSize_vkGetPhysicalDeviceFeatures2, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10582 | uint64_t cgen_var_694; |
| 10583 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_694, 1); |
| 10584 | stream->write((uint64_t*)&cgen_var_694, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10585 | marshal_VkPhysicalDeviceFeatures2(stream, (VkPhysicalDeviceFeatures2*)(pFeatures)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 10586 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceFeatures2 readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10587 | unmarshal_VkPhysicalDeviceFeatures2(stream, (VkPhysicalDeviceFeatures2*)(pFeatures)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 10588 | if (pFeatures) |
| 10589 | { |
| 10590 | transform_fromhost_VkPhysicalDeviceFeatures2(mImpl->resources(), (VkPhysicalDeviceFeatures2*)(pFeatures)); |
| 10591 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 10592 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceFeatures2 returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10593 | mImpl->log("finish vkGetPhysicalDeviceFeatures2");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10594 | } |
| 10595 | |
| 10596 | void VkEncoder::vkGetPhysicalDeviceProperties2( |
| 10597 | VkPhysicalDevice physicalDevice, |
| 10598 | VkPhysicalDeviceProperties2* pProperties) |
| 10599 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 10600 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 10601 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceProperties2 encode"); |
| Lingfeng Yang | 154a33c | 2019-01-29 19:06:23 -0800 | [diff] [blame] | 10602 | mImpl->log("start vkGetPhysicalDeviceProperties2"); |
| 10603 | auto stream = mImpl->stream(); |
| 10604 | auto countingStream = mImpl->countingStream(); |
| 10605 | auto resources = mImpl->resources(); |
| 10606 | auto pool = mImpl->pool(); |
| 10607 | stream->setHandleMapping(resources->unwrapMapping()); |
| 10608 | VkPhysicalDevice local_physicalDevice; |
| 10609 | local_physicalDevice = physicalDevice; |
| 10610 | countingStream->rewind(); |
| 10611 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10612 | uint64_t cgen_var_695; |
| 10613 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_695, 1); |
| 10614 | countingStream->write((uint64_t*)&cgen_var_695, 1 * 8); |
| Lingfeng Yang | 154a33c | 2019-01-29 19:06:23 -0800 | [diff] [blame] | 10615 | marshal_VkPhysicalDeviceProperties2(countingStream, (VkPhysicalDeviceProperties2*)(pProperties)); |
| 10616 | } |
| 10617 | uint32_t packetSize_vkGetPhysicalDeviceProperties2 = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 10618 | countingStream->rewind(); |
| 10619 | uint32_t opcode_vkGetPhysicalDeviceProperties2 = OP_vkGetPhysicalDeviceProperties2; |
| 10620 | stream->write(&opcode_vkGetPhysicalDeviceProperties2, sizeof(uint32_t)); |
| 10621 | stream->write(&packetSize_vkGetPhysicalDeviceProperties2, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10622 | uint64_t cgen_var_696; |
| 10623 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_696, 1); |
| 10624 | stream->write((uint64_t*)&cgen_var_696, 1 * 8); |
| Lingfeng Yang | 154a33c | 2019-01-29 19:06:23 -0800 | [diff] [blame] | 10625 | marshal_VkPhysicalDeviceProperties2(stream, (VkPhysicalDeviceProperties2*)(pProperties)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 10626 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceProperties2 readParams"); |
| Lingfeng Yang | 154a33c | 2019-01-29 19:06:23 -0800 | [diff] [blame] | 10627 | unmarshal_VkPhysicalDeviceProperties2(stream, (VkPhysicalDeviceProperties2*)(pProperties)); |
| 10628 | if (pProperties) |
| 10629 | { |
| 10630 | transform_fromhost_VkPhysicalDeviceProperties2(mImpl->resources(), (VkPhysicalDeviceProperties2*)(pProperties)); |
| 10631 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 10632 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceProperties2 returnUnmarshal"); |
| Lingfeng Yang | 154a33c | 2019-01-29 19:06:23 -0800 | [diff] [blame] | 10633 | mImpl->log("finish vkGetPhysicalDeviceProperties2");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10634 | } |
| 10635 | |
| 10636 | void VkEncoder::vkGetPhysicalDeviceFormatProperties2( |
| 10637 | VkPhysicalDevice physicalDevice, |
| 10638 | VkFormat format, |
| 10639 | VkFormatProperties2* pFormatProperties) |
| 10640 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 10641 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 10642 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceFormatProperties2 encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10643 | mImpl->log("start vkGetPhysicalDeviceFormatProperties2"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10644 | auto stream = mImpl->stream(); |
| 10645 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10646 | auto resources = mImpl->resources(); |
| 10647 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 10648 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10649 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10650 | VkFormat local_format; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 10651 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10652 | local_format = format; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10653 | countingStream->rewind(); |
| 10654 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10655 | uint64_t cgen_var_697; |
| 10656 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_697, 1); |
| 10657 | countingStream->write((uint64_t*)&cgen_var_697, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10658 | countingStream->write((VkFormat*)&local_format, sizeof(VkFormat)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10659 | marshal_VkFormatProperties2(countingStream, (VkFormatProperties2*)(pFormatProperties)); |
| 10660 | } |
| 10661 | uint32_t packetSize_vkGetPhysicalDeviceFormatProperties2 = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 10662 | countingStream->rewind(); |
| 10663 | uint32_t opcode_vkGetPhysicalDeviceFormatProperties2 = OP_vkGetPhysicalDeviceFormatProperties2; |
| 10664 | stream->write(&opcode_vkGetPhysicalDeviceFormatProperties2, sizeof(uint32_t)); |
| 10665 | stream->write(&packetSize_vkGetPhysicalDeviceFormatProperties2, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10666 | uint64_t cgen_var_698; |
| 10667 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_698, 1); |
| 10668 | stream->write((uint64_t*)&cgen_var_698, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10669 | stream->write((VkFormat*)&local_format, sizeof(VkFormat)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10670 | marshal_VkFormatProperties2(stream, (VkFormatProperties2*)(pFormatProperties)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 10671 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceFormatProperties2 readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10672 | unmarshal_VkFormatProperties2(stream, (VkFormatProperties2*)(pFormatProperties)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 10673 | if (pFormatProperties) |
| 10674 | { |
| 10675 | transform_fromhost_VkFormatProperties2(mImpl->resources(), (VkFormatProperties2*)(pFormatProperties)); |
| 10676 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 10677 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceFormatProperties2 returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10678 | mImpl->log("finish vkGetPhysicalDeviceFormatProperties2");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10679 | } |
| 10680 | |
| 10681 | VkResult VkEncoder::vkGetPhysicalDeviceImageFormatProperties2( |
| 10682 | VkPhysicalDevice physicalDevice, |
| 10683 | const VkPhysicalDeviceImageFormatInfo2* pImageFormatInfo, |
| 10684 | VkImageFormatProperties2* pImageFormatProperties) |
| 10685 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 10686 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 10687 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceImageFormatProperties2 encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10688 | mImpl->log("start vkGetPhysicalDeviceImageFormatProperties2"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10689 | auto stream = mImpl->stream(); |
| 10690 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10691 | auto resources = mImpl->resources(); |
| 10692 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 10693 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10694 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10695 | VkPhysicalDeviceImageFormatInfo2* local_pImageFormatInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 10696 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10697 | local_pImageFormatInfo = nullptr; |
| 10698 | if (pImageFormatInfo) |
| 10699 | { |
| 10700 | local_pImageFormatInfo = (VkPhysicalDeviceImageFormatInfo2*)pool->alloc(sizeof(const VkPhysicalDeviceImageFormatInfo2)); |
| 10701 | deepcopy_VkPhysicalDeviceImageFormatInfo2(pool, pImageFormatInfo, (VkPhysicalDeviceImageFormatInfo2*)(local_pImageFormatInfo)); |
| 10702 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 10703 | if (local_pImageFormatInfo) |
| 10704 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 10705 | transform_tohost_VkPhysicalDeviceImageFormatInfo2(mImpl->resources(), (VkPhysicalDeviceImageFormatInfo2*)(local_pImageFormatInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 10706 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10707 | countingStream->rewind(); |
| 10708 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10709 | uint64_t cgen_var_699; |
| 10710 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_699, 1); |
| 10711 | countingStream->write((uint64_t*)&cgen_var_699, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10712 | marshal_VkPhysicalDeviceImageFormatInfo2(countingStream, (VkPhysicalDeviceImageFormatInfo2*)(local_pImageFormatInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10713 | marshal_VkImageFormatProperties2(countingStream, (VkImageFormatProperties2*)(pImageFormatProperties)); |
| 10714 | } |
| 10715 | uint32_t packetSize_vkGetPhysicalDeviceImageFormatProperties2 = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 10716 | countingStream->rewind(); |
| 10717 | uint32_t opcode_vkGetPhysicalDeviceImageFormatProperties2 = OP_vkGetPhysicalDeviceImageFormatProperties2; |
| 10718 | stream->write(&opcode_vkGetPhysicalDeviceImageFormatProperties2, sizeof(uint32_t)); |
| 10719 | stream->write(&packetSize_vkGetPhysicalDeviceImageFormatProperties2, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10720 | uint64_t cgen_var_700; |
| 10721 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_700, 1); |
| 10722 | stream->write((uint64_t*)&cgen_var_700, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10723 | marshal_VkPhysicalDeviceImageFormatInfo2(stream, (VkPhysicalDeviceImageFormatInfo2*)(local_pImageFormatInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10724 | marshal_VkImageFormatProperties2(stream, (VkImageFormatProperties2*)(pImageFormatProperties)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 10725 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceImageFormatProperties2 readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10726 | unmarshal_VkImageFormatProperties2(stream, (VkImageFormatProperties2*)(pImageFormatProperties)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 10727 | if (pImageFormatProperties) |
| 10728 | { |
| 10729 | transform_fromhost_VkImageFormatProperties2(mImpl->resources(), (VkImageFormatProperties2*)(pImageFormatProperties)); |
| 10730 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 10731 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceImageFormatProperties2 returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10732 | VkResult vkGetPhysicalDeviceImageFormatProperties2_VkResult_return = (VkResult)0; |
| 10733 | stream->read(&vkGetPhysicalDeviceImageFormatProperties2_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10734 | countingStream->clearPool(); |
| 10735 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 10736 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10737 | mImpl->log("finish vkGetPhysicalDeviceImageFormatProperties2");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10738 | return vkGetPhysicalDeviceImageFormatProperties2_VkResult_return; |
| 10739 | } |
| 10740 | |
| 10741 | void VkEncoder::vkGetPhysicalDeviceQueueFamilyProperties2( |
| 10742 | VkPhysicalDevice physicalDevice, |
| 10743 | uint32_t* pQueueFamilyPropertyCount, |
| 10744 | VkQueueFamilyProperties2* pQueueFamilyProperties) |
| 10745 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 10746 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 10747 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceQueueFamilyProperties2 encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10748 | mImpl->log("start vkGetPhysicalDeviceQueueFamilyProperties2"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10749 | auto stream = mImpl->stream(); |
| 10750 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10751 | auto resources = mImpl->resources(); |
| 10752 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 10753 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10754 | VkPhysicalDevice local_physicalDevice; |
| 10755 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10756 | countingStream->rewind(); |
| 10757 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10758 | uint64_t cgen_var_701; |
| 10759 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_701, 1); |
| 10760 | countingStream->write((uint64_t*)&cgen_var_701, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10761 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10762 | uint64_t cgen_var_702 = (uint64_t)(uintptr_t)pQueueFamilyPropertyCount; |
| 10763 | countingStream->putBe64(cgen_var_702); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10764 | if (pQueueFamilyPropertyCount) |
| 10765 | { |
| 10766 | countingStream->write((uint32_t*)pQueueFamilyPropertyCount, sizeof(uint32_t)); |
| 10767 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10768 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10769 | uint64_t cgen_var_703 = (uint64_t)(uintptr_t)pQueueFamilyProperties; |
| 10770 | countingStream->putBe64(cgen_var_703); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10771 | if (pQueueFamilyProperties) |
| 10772 | { |
| 10773 | for (uint32_t i = 0; i < (uint32_t)(*(pQueueFamilyPropertyCount)); ++i) |
| 10774 | { |
| 10775 | marshal_VkQueueFamilyProperties2(countingStream, (VkQueueFamilyProperties2*)(pQueueFamilyProperties + i)); |
| 10776 | } |
| 10777 | } |
| 10778 | } |
| 10779 | uint32_t packetSize_vkGetPhysicalDeviceQueueFamilyProperties2 = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 10780 | countingStream->rewind(); |
| 10781 | uint32_t opcode_vkGetPhysicalDeviceQueueFamilyProperties2 = OP_vkGetPhysicalDeviceQueueFamilyProperties2; |
| 10782 | stream->write(&opcode_vkGetPhysicalDeviceQueueFamilyProperties2, sizeof(uint32_t)); |
| 10783 | stream->write(&packetSize_vkGetPhysicalDeviceQueueFamilyProperties2, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10784 | uint64_t cgen_var_704; |
| 10785 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_704, 1); |
| 10786 | stream->write((uint64_t*)&cgen_var_704, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10787 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10788 | uint64_t cgen_var_705 = (uint64_t)(uintptr_t)pQueueFamilyPropertyCount; |
| 10789 | stream->putBe64(cgen_var_705); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10790 | if (pQueueFamilyPropertyCount) |
| 10791 | { |
| 10792 | stream->write((uint32_t*)pQueueFamilyPropertyCount, sizeof(uint32_t)); |
| 10793 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10794 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10795 | uint64_t cgen_var_706 = (uint64_t)(uintptr_t)pQueueFamilyProperties; |
| 10796 | stream->putBe64(cgen_var_706); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10797 | if (pQueueFamilyProperties) |
| 10798 | { |
| 10799 | for (uint32_t i = 0; i < (uint32_t)(*(pQueueFamilyPropertyCount)); ++i) |
| 10800 | { |
| 10801 | marshal_VkQueueFamilyProperties2(stream, (VkQueueFamilyProperties2*)(pQueueFamilyProperties + i)); |
| 10802 | } |
| 10803 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 10804 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceQueueFamilyProperties2 readParams"); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10805 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10806 | uint32_t* check_pQueueFamilyPropertyCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10807 | check_pQueueFamilyPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10808 | if (pQueueFamilyPropertyCount) |
| 10809 | { |
| 10810 | if (!(check_pQueueFamilyPropertyCount)) |
| 10811 | { |
| 10812 | fprintf(stderr, "fatal: pQueueFamilyPropertyCount inconsistent between guest and host\n"); |
| 10813 | } |
| 10814 | stream->read((uint32_t*)pQueueFamilyPropertyCount, sizeof(uint32_t)); |
| 10815 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10816 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10817 | VkQueueFamilyProperties2* check_pQueueFamilyProperties; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10818 | check_pQueueFamilyProperties = (VkQueueFamilyProperties2*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10819 | if (pQueueFamilyProperties) |
| 10820 | { |
| 10821 | if (!(check_pQueueFamilyProperties)) |
| 10822 | { |
| 10823 | fprintf(stderr, "fatal: pQueueFamilyProperties inconsistent between guest and host\n"); |
| 10824 | } |
| 10825 | for (uint32_t i = 0; i < (uint32_t)(*(pQueueFamilyPropertyCount)); ++i) |
| 10826 | { |
| 10827 | unmarshal_VkQueueFamilyProperties2(stream, (VkQueueFamilyProperties2*)(pQueueFamilyProperties + i)); |
| 10828 | } |
| 10829 | } |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 10830 | if (pQueueFamilyProperties) |
| 10831 | { |
| 10832 | for (uint32_t i = 0; i < (uint32_t)(*(pQueueFamilyPropertyCount)); ++i) |
| 10833 | { |
| 10834 | transform_fromhost_VkQueueFamilyProperties2(mImpl->resources(), (VkQueueFamilyProperties2*)(pQueueFamilyProperties + i)); |
| 10835 | } |
| 10836 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 10837 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceQueueFamilyProperties2 returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10838 | mImpl->log("finish vkGetPhysicalDeviceQueueFamilyProperties2");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10839 | } |
| 10840 | |
| 10841 | void VkEncoder::vkGetPhysicalDeviceMemoryProperties2( |
| 10842 | VkPhysicalDevice physicalDevice, |
| 10843 | VkPhysicalDeviceMemoryProperties2* pMemoryProperties) |
| 10844 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 10845 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 10846 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceMemoryProperties2 encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10847 | mImpl->log("start vkGetPhysicalDeviceMemoryProperties2"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10848 | auto stream = mImpl->stream(); |
| 10849 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10850 | auto resources = mImpl->resources(); |
| 10851 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 10852 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10853 | VkPhysicalDevice local_physicalDevice; |
| 10854 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10855 | countingStream->rewind(); |
| 10856 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10857 | uint64_t cgen_var_709; |
| 10858 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_709, 1); |
| 10859 | countingStream->write((uint64_t*)&cgen_var_709, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10860 | marshal_VkPhysicalDeviceMemoryProperties2(countingStream, (VkPhysicalDeviceMemoryProperties2*)(pMemoryProperties)); |
| 10861 | } |
| 10862 | uint32_t packetSize_vkGetPhysicalDeviceMemoryProperties2 = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 10863 | countingStream->rewind(); |
| 10864 | uint32_t opcode_vkGetPhysicalDeviceMemoryProperties2 = OP_vkGetPhysicalDeviceMemoryProperties2; |
| 10865 | stream->write(&opcode_vkGetPhysicalDeviceMemoryProperties2, sizeof(uint32_t)); |
| 10866 | stream->write(&packetSize_vkGetPhysicalDeviceMemoryProperties2, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10867 | uint64_t cgen_var_710; |
| 10868 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_710, 1); |
| 10869 | stream->write((uint64_t*)&cgen_var_710, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10870 | marshal_VkPhysicalDeviceMemoryProperties2(stream, (VkPhysicalDeviceMemoryProperties2*)(pMemoryProperties)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 10871 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceMemoryProperties2 readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10872 | unmarshal_VkPhysicalDeviceMemoryProperties2(stream, (VkPhysicalDeviceMemoryProperties2*)(pMemoryProperties)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 10873 | if (pMemoryProperties) |
| 10874 | { |
| 10875 | transform_fromhost_VkPhysicalDeviceMemoryProperties2(mImpl->resources(), (VkPhysicalDeviceMemoryProperties2*)(pMemoryProperties)); |
| 10876 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 10877 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceMemoryProperties2 returnUnmarshal"); |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 10878 | encoderLock.unlock(); |
| Lingfeng Yang | 154a33c | 2019-01-29 19:06:23 -0800 | [diff] [blame] | 10879 | mImpl->resources()->on_vkGetPhysicalDeviceMemoryProperties2(this, physicalDevice, pMemoryProperties); |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 10880 | encoderLock.lock(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10881 | mImpl->log("finish vkGetPhysicalDeviceMemoryProperties2");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10882 | } |
| 10883 | |
| 10884 | void VkEncoder::vkGetPhysicalDeviceSparseImageFormatProperties2( |
| 10885 | VkPhysicalDevice physicalDevice, |
| 10886 | const VkPhysicalDeviceSparseImageFormatInfo2* pFormatInfo, |
| 10887 | uint32_t* pPropertyCount, |
| 10888 | VkSparseImageFormatProperties2* pProperties) |
| 10889 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 10890 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 10891 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceSparseImageFormatProperties2 encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10892 | mImpl->log("start vkGetPhysicalDeviceSparseImageFormatProperties2"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10893 | auto stream = mImpl->stream(); |
| 10894 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10895 | auto resources = mImpl->resources(); |
| 10896 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 10897 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10898 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10899 | VkPhysicalDeviceSparseImageFormatInfo2* local_pFormatInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 10900 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10901 | local_pFormatInfo = nullptr; |
| 10902 | if (pFormatInfo) |
| 10903 | { |
| 10904 | local_pFormatInfo = (VkPhysicalDeviceSparseImageFormatInfo2*)pool->alloc(sizeof(const VkPhysicalDeviceSparseImageFormatInfo2)); |
| 10905 | deepcopy_VkPhysicalDeviceSparseImageFormatInfo2(pool, pFormatInfo, (VkPhysicalDeviceSparseImageFormatInfo2*)(local_pFormatInfo)); |
| 10906 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 10907 | if (local_pFormatInfo) |
| 10908 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 10909 | transform_tohost_VkPhysicalDeviceSparseImageFormatInfo2(mImpl->resources(), (VkPhysicalDeviceSparseImageFormatInfo2*)(local_pFormatInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 10910 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10911 | countingStream->rewind(); |
| 10912 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10913 | uint64_t cgen_var_711; |
| 10914 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_711, 1); |
| 10915 | countingStream->write((uint64_t*)&cgen_var_711, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10916 | marshal_VkPhysicalDeviceSparseImageFormatInfo2(countingStream, (VkPhysicalDeviceSparseImageFormatInfo2*)(local_pFormatInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10917 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10918 | uint64_t cgen_var_712 = (uint64_t)(uintptr_t)pPropertyCount; |
| 10919 | countingStream->putBe64(cgen_var_712); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10920 | if (pPropertyCount) |
| 10921 | { |
| 10922 | countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 10923 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10924 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10925 | uint64_t cgen_var_713 = (uint64_t)(uintptr_t)pProperties; |
| 10926 | countingStream->putBe64(cgen_var_713); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10927 | if (pProperties) |
| 10928 | { |
| 10929 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 10930 | { |
| 10931 | marshal_VkSparseImageFormatProperties2(countingStream, (VkSparseImageFormatProperties2*)(pProperties + i)); |
| 10932 | } |
| 10933 | } |
| 10934 | } |
| 10935 | uint32_t packetSize_vkGetPhysicalDeviceSparseImageFormatProperties2 = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 10936 | countingStream->rewind(); |
| 10937 | uint32_t opcode_vkGetPhysicalDeviceSparseImageFormatProperties2 = OP_vkGetPhysicalDeviceSparseImageFormatProperties2; |
| 10938 | stream->write(&opcode_vkGetPhysicalDeviceSparseImageFormatProperties2, sizeof(uint32_t)); |
| 10939 | stream->write(&packetSize_vkGetPhysicalDeviceSparseImageFormatProperties2, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10940 | uint64_t cgen_var_714; |
| 10941 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_714, 1); |
| 10942 | stream->write((uint64_t*)&cgen_var_714, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10943 | marshal_VkPhysicalDeviceSparseImageFormatInfo2(stream, (VkPhysicalDeviceSparseImageFormatInfo2*)(local_pFormatInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10944 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10945 | uint64_t cgen_var_715 = (uint64_t)(uintptr_t)pPropertyCount; |
| 10946 | stream->putBe64(cgen_var_715); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10947 | if (pPropertyCount) |
| 10948 | { |
| 10949 | stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 10950 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10951 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10952 | uint64_t cgen_var_716 = (uint64_t)(uintptr_t)pProperties; |
| 10953 | stream->putBe64(cgen_var_716); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10954 | if (pProperties) |
| 10955 | { |
| 10956 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 10957 | { |
| 10958 | marshal_VkSparseImageFormatProperties2(stream, (VkSparseImageFormatProperties2*)(pProperties + i)); |
| 10959 | } |
| 10960 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 10961 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceSparseImageFormatProperties2 readParams"); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10962 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10963 | uint32_t* check_pPropertyCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10964 | check_pPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10965 | if (pPropertyCount) |
| 10966 | { |
| 10967 | if (!(check_pPropertyCount)) |
| 10968 | { |
| 10969 | fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n"); |
| 10970 | } |
| 10971 | stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 10972 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10973 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10974 | VkSparseImageFormatProperties2* check_pProperties; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10975 | check_pProperties = (VkSparseImageFormatProperties2*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10976 | if (pProperties) |
| 10977 | { |
| 10978 | if (!(check_pProperties)) |
| 10979 | { |
| 10980 | fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n"); |
| 10981 | } |
| 10982 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 10983 | { |
| 10984 | unmarshal_VkSparseImageFormatProperties2(stream, (VkSparseImageFormatProperties2*)(pProperties + i)); |
| 10985 | } |
| 10986 | } |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 10987 | if (pProperties) |
| 10988 | { |
| 10989 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 10990 | { |
| 10991 | transform_fromhost_VkSparseImageFormatProperties2(mImpl->resources(), (VkSparseImageFormatProperties2*)(pProperties + i)); |
| 10992 | } |
| 10993 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 10994 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceSparseImageFormatProperties2 returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10995 | mImpl->log("finish vkGetPhysicalDeviceSparseImageFormatProperties2");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10996 | } |
| 10997 | |
| 10998 | void VkEncoder::vkTrimCommandPool( |
| 10999 | VkDevice device, |
| 11000 | VkCommandPool commandPool, |
| 11001 | VkCommandPoolTrimFlags flags) |
| 11002 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 11003 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 11004 | AEMU_SCOPED_TRACE("vkTrimCommandPool encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11005 | mImpl->log("start vkTrimCommandPool"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11006 | auto stream = mImpl->stream(); |
| 11007 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11008 | auto resources = mImpl->resources(); |
| 11009 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11010 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11011 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11012 | VkCommandPool local_commandPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11013 | VkCommandPoolTrimFlags local_flags; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 11014 | local_device = device; |
| 11015 | local_commandPool = commandPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11016 | local_flags = flags; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11017 | countingStream->rewind(); |
| 11018 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11019 | uint64_t cgen_var_719; |
| 11020 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_719, 1); |
| 11021 | countingStream->write((uint64_t*)&cgen_var_719, 1 * 8); |
| 11022 | uint64_t cgen_var_720; |
| 11023 | countingStream->handleMapping()->mapHandles_VkCommandPool_u64(&local_commandPool, &cgen_var_720, 1); |
| 11024 | countingStream->write((uint64_t*)&cgen_var_720, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11025 | countingStream->write((VkCommandPoolTrimFlags*)&local_flags, sizeof(VkCommandPoolTrimFlags)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11026 | } |
| 11027 | uint32_t packetSize_vkTrimCommandPool = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 11028 | countingStream->rewind(); |
| 11029 | uint32_t opcode_vkTrimCommandPool = OP_vkTrimCommandPool; |
| 11030 | stream->write(&opcode_vkTrimCommandPool, sizeof(uint32_t)); |
| 11031 | stream->write(&packetSize_vkTrimCommandPool, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11032 | uint64_t cgen_var_721; |
| 11033 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_721, 1); |
| 11034 | stream->write((uint64_t*)&cgen_var_721, 1 * 8); |
| 11035 | uint64_t cgen_var_722; |
| 11036 | stream->handleMapping()->mapHandles_VkCommandPool_u64(&local_commandPool, &cgen_var_722, 1); |
| 11037 | stream->write((uint64_t*)&cgen_var_722, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11038 | stream->write((VkCommandPoolTrimFlags*)&local_flags, sizeof(VkCommandPoolTrimFlags)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 11039 | AEMU_SCOPED_TRACE("vkTrimCommandPool readParams"); |
| 11040 | AEMU_SCOPED_TRACE("vkTrimCommandPool returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11041 | mImpl->log("finish vkTrimCommandPool");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11042 | } |
| 11043 | |
| 11044 | void VkEncoder::vkGetDeviceQueue2( |
| 11045 | VkDevice device, |
| 11046 | const VkDeviceQueueInfo2* pQueueInfo, |
| 11047 | VkQueue* pQueue) |
| 11048 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 11049 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 11050 | AEMU_SCOPED_TRACE("vkGetDeviceQueue2 encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11051 | mImpl->log("start vkGetDeviceQueue2"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11052 | auto stream = mImpl->stream(); |
| 11053 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11054 | auto resources = mImpl->resources(); |
| 11055 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11056 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11057 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11058 | VkDeviceQueueInfo2* local_pQueueInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 11059 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11060 | local_pQueueInfo = nullptr; |
| 11061 | if (pQueueInfo) |
| 11062 | { |
| 11063 | local_pQueueInfo = (VkDeviceQueueInfo2*)pool->alloc(sizeof(const VkDeviceQueueInfo2)); |
| 11064 | deepcopy_VkDeviceQueueInfo2(pool, pQueueInfo, (VkDeviceQueueInfo2*)(local_pQueueInfo)); |
| 11065 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 11066 | if (local_pQueueInfo) |
| 11067 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 11068 | transform_tohost_VkDeviceQueueInfo2(mImpl->resources(), (VkDeviceQueueInfo2*)(local_pQueueInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 11069 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11070 | countingStream->rewind(); |
| 11071 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11072 | uint64_t cgen_var_723; |
| 11073 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_723, 1); |
| 11074 | countingStream->write((uint64_t*)&cgen_var_723, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11075 | marshal_VkDeviceQueueInfo2(countingStream, (VkDeviceQueueInfo2*)(local_pQueueInfo)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11076 | uint64_t cgen_var_724; |
| 11077 | countingStream->handleMapping()->mapHandles_VkQueue_u64(pQueue, &cgen_var_724, 1); |
| 11078 | countingStream->write((uint64_t*)&cgen_var_724, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11079 | } |
| 11080 | uint32_t packetSize_vkGetDeviceQueue2 = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 11081 | countingStream->rewind(); |
| 11082 | uint32_t opcode_vkGetDeviceQueue2 = OP_vkGetDeviceQueue2; |
| 11083 | stream->write(&opcode_vkGetDeviceQueue2, sizeof(uint32_t)); |
| 11084 | stream->write(&packetSize_vkGetDeviceQueue2, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11085 | uint64_t cgen_var_725; |
| 11086 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_725, 1); |
| 11087 | stream->write((uint64_t*)&cgen_var_725, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11088 | marshal_VkDeviceQueueInfo2(stream, (VkDeviceQueueInfo2*)(local_pQueueInfo)); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11089 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11090 | uint64_t cgen_var_726; |
| 11091 | stream->handleMapping()->mapHandles_VkQueue_u64(pQueue, &cgen_var_726, 1); |
| 11092 | stream->write((uint64_t*)&cgen_var_726, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11093 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 11094 | AEMU_SCOPED_TRACE("vkGetDeviceQueue2 readParams"); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11095 | uint64_t cgen_var_727; |
| 11096 | stream->read((uint64_t*)&cgen_var_727, 8); |
| 11097 | stream->handleMapping()->mapHandles_u64_VkQueue(&cgen_var_727, (VkQueue*)pQueue, 1); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 11098 | AEMU_SCOPED_TRACE("vkGetDeviceQueue2 returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11099 | mImpl->log("finish vkGetDeviceQueue2");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11100 | } |
| 11101 | |
| 11102 | VkResult VkEncoder::vkCreateSamplerYcbcrConversion( |
| 11103 | VkDevice device, |
| 11104 | const VkSamplerYcbcrConversionCreateInfo* pCreateInfo, |
| 11105 | const VkAllocationCallbacks* pAllocator, |
| 11106 | VkSamplerYcbcrConversion* pYcbcrConversion) |
| 11107 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 11108 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 11109 | AEMU_SCOPED_TRACE("vkCreateSamplerYcbcrConversion encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11110 | mImpl->log("start vkCreateSamplerYcbcrConversion"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11111 | auto stream = mImpl->stream(); |
| 11112 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11113 | auto resources = mImpl->resources(); |
| 11114 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11115 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11116 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11117 | VkSamplerYcbcrConversionCreateInfo* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 11118 | VkAllocationCallbacks* local_pAllocator; |
| 11119 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11120 | local_pCreateInfo = nullptr; |
| 11121 | if (pCreateInfo) |
| 11122 | { |
| 11123 | local_pCreateInfo = (VkSamplerYcbcrConversionCreateInfo*)pool->alloc(sizeof(const VkSamplerYcbcrConversionCreateInfo)); |
| 11124 | deepcopy_VkSamplerYcbcrConversionCreateInfo(pool, pCreateInfo, (VkSamplerYcbcrConversionCreateInfo*)(local_pCreateInfo)); |
| 11125 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11126 | local_pAllocator = nullptr; |
| 11127 | if (pAllocator) |
| 11128 | { |
| 11129 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 11130 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 11131 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 11132 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 11133 | if (local_pCreateInfo) |
| 11134 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 11135 | transform_tohost_VkSamplerYcbcrConversionCreateInfo(mImpl->resources(), (VkSamplerYcbcrConversionCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 11136 | } |
| 11137 | if (local_pAllocator) |
| 11138 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 11139 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 11140 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11141 | countingStream->rewind(); |
| 11142 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11143 | uint64_t cgen_var_728; |
| 11144 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_728, 1); |
| 11145 | countingStream->write((uint64_t*)&cgen_var_728, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11146 | marshal_VkSamplerYcbcrConversionCreateInfo(countingStream, (VkSamplerYcbcrConversionCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11147 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11148 | uint64_t cgen_var_729 = (uint64_t)(uintptr_t)local_pAllocator; |
| 11149 | countingStream->putBe64(cgen_var_729); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11150 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11151 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11152 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11153 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11154 | uint64_t cgen_var_730; |
| 11155 | countingStream->handleMapping()->mapHandles_VkSamplerYcbcrConversion_u64(pYcbcrConversion, &cgen_var_730, 1); |
| 11156 | countingStream->write((uint64_t*)&cgen_var_730, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11157 | } |
| 11158 | uint32_t packetSize_vkCreateSamplerYcbcrConversion = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 11159 | countingStream->rewind(); |
| 11160 | uint32_t opcode_vkCreateSamplerYcbcrConversion = OP_vkCreateSamplerYcbcrConversion; |
| 11161 | stream->write(&opcode_vkCreateSamplerYcbcrConversion, sizeof(uint32_t)); |
| 11162 | stream->write(&packetSize_vkCreateSamplerYcbcrConversion, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11163 | uint64_t cgen_var_731; |
| 11164 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_731, 1); |
| 11165 | stream->write((uint64_t*)&cgen_var_731, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11166 | marshal_VkSamplerYcbcrConversionCreateInfo(stream, (VkSamplerYcbcrConversionCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11167 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11168 | uint64_t cgen_var_732 = (uint64_t)(uintptr_t)local_pAllocator; |
| 11169 | stream->putBe64(cgen_var_732); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11170 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11171 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11172 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11173 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11174 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11175 | uint64_t cgen_var_733; |
| 11176 | stream->handleMapping()->mapHandles_VkSamplerYcbcrConversion_u64(pYcbcrConversion, &cgen_var_733, 1); |
| 11177 | stream->write((uint64_t*)&cgen_var_733, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11178 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 11179 | AEMU_SCOPED_TRACE("vkCreateSamplerYcbcrConversion readParams"); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11180 | stream->setHandleMapping(resources->createMapping()); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11181 | uint64_t cgen_var_734; |
| 11182 | stream->read((uint64_t*)&cgen_var_734, 8); |
| 11183 | stream->handleMapping()->mapHandles_u64_VkSamplerYcbcrConversion(&cgen_var_734, (VkSamplerYcbcrConversion*)pYcbcrConversion, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11184 | stream->unsetHandleMapping(); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 11185 | AEMU_SCOPED_TRACE("vkCreateSamplerYcbcrConversion returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11186 | VkResult vkCreateSamplerYcbcrConversion_VkResult_return = (VkResult)0; |
| 11187 | stream->read(&vkCreateSamplerYcbcrConversion_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11188 | countingStream->clearPool(); |
| 11189 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11190 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11191 | mImpl->log("finish vkCreateSamplerYcbcrConversion");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11192 | return vkCreateSamplerYcbcrConversion_VkResult_return; |
| 11193 | } |
| 11194 | |
| 11195 | void VkEncoder::vkDestroySamplerYcbcrConversion( |
| 11196 | VkDevice device, |
| 11197 | VkSamplerYcbcrConversion ycbcrConversion, |
| 11198 | const VkAllocationCallbacks* pAllocator) |
| 11199 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 11200 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 11201 | AEMU_SCOPED_TRACE("vkDestroySamplerYcbcrConversion encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11202 | mImpl->log("start vkDestroySamplerYcbcrConversion"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11203 | auto stream = mImpl->stream(); |
| 11204 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11205 | auto resources = mImpl->resources(); |
| 11206 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11207 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11208 | VkDevice local_device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 11209 | VkSamplerYcbcrConversion local_ycbcrConversion; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11210 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 11211 | local_device = device; |
| 11212 | local_ycbcrConversion = ycbcrConversion; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11213 | local_pAllocator = nullptr; |
| 11214 | if (pAllocator) |
| 11215 | { |
| 11216 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 11217 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 11218 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 11219 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 11220 | if (local_pAllocator) |
| 11221 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 11222 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 11223 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11224 | countingStream->rewind(); |
| 11225 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11226 | uint64_t cgen_var_735; |
| 11227 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_735, 1); |
| 11228 | countingStream->write((uint64_t*)&cgen_var_735, 1 * 8); |
| 11229 | uint64_t cgen_var_736; |
| 11230 | countingStream->handleMapping()->mapHandles_VkSamplerYcbcrConversion_u64(&local_ycbcrConversion, &cgen_var_736, 1); |
| 11231 | countingStream->write((uint64_t*)&cgen_var_736, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11232 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11233 | uint64_t cgen_var_737 = (uint64_t)(uintptr_t)local_pAllocator; |
| 11234 | countingStream->putBe64(cgen_var_737); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11235 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11236 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11237 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11238 | } |
| 11239 | } |
| 11240 | uint32_t packetSize_vkDestroySamplerYcbcrConversion = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 11241 | countingStream->rewind(); |
| 11242 | uint32_t opcode_vkDestroySamplerYcbcrConversion = OP_vkDestroySamplerYcbcrConversion; |
| 11243 | stream->write(&opcode_vkDestroySamplerYcbcrConversion, sizeof(uint32_t)); |
| 11244 | stream->write(&packetSize_vkDestroySamplerYcbcrConversion, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11245 | uint64_t cgen_var_738; |
| 11246 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_738, 1); |
| 11247 | stream->write((uint64_t*)&cgen_var_738, 1 * 8); |
| 11248 | uint64_t cgen_var_739; |
| 11249 | stream->handleMapping()->mapHandles_VkSamplerYcbcrConversion_u64(&local_ycbcrConversion, &cgen_var_739, 1); |
| 11250 | stream->write((uint64_t*)&cgen_var_739, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11251 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11252 | uint64_t cgen_var_740 = (uint64_t)(uintptr_t)local_pAllocator; |
| 11253 | stream->putBe64(cgen_var_740); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11254 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11255 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11256 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11257 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 11258 | AEMU_SCOPED_TRACE("vkDestroySamplerYcbcrConversion readParams"); |
| 11259 | AEMU_SCOPED_TRACE("vkDestroySamplerYcbcrConversion returnUnmarshal"); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11260 | resources->destroyMapping()->mapHandles_VkSamplerYcbcrConversion((VkSamplerYcbcrConversion*)&ycbcrConversion); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11261 | mImpl->log("finish vkDestroySamplerYcbcrConversion");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11262 | } |
| 11263 | |
| 11264 | VkResult VkEncoder::vkCreateDescriptorUpdateTemplate( |
| 11265 | VkDevice device, |
| 11266 | const VkDescriptorUpdateTemplateCreateInfo* pCreateInfo, |
| 11267 | const VkAllocationCallbacks* pAllocator, |
| 11268 | VkDescriptorUpdateTemplate* pDescriptorUpdateTemplate) |
| 11269 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 11270 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 11271 | AEMU_SCOPED_TRACE("vkCreateDescriptorUpdateTemplate encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11272 | mImpl->log("start vkCreateDescriptorUpdateTemplate"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11273 | auto stream = mImpl->stream(); |
| 11274 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11275 | auto resources = mImpl->resources(); |
| 11276 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11277 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11278 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11279 | VkDescriptorUpdateTemplateCreateInfo* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 11280 | VkAllocationCallbacks* local_pAllocator; |
| 11281 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11282 | local_pCreateInfo = nullptr; |
| 11283 | if (pCreateInfo) |
| 11284 | { |
| 11285 | local_pCreateInfo = (VkDescriptorUpdateTemplateCreateInfo*)pool->alloc(sizeof(const VkDescriptorUpdateTemplateCreateInfo)); |
| 11286 | deepcopy_VkDescriptorUpdateTemplateCreateInfo(pool, pCreateInfo, (VkDescriptorUpdateTemplateCreateInfo*)(local_pCreateInfo)); |
| 11287 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11288 | local_pAllocator = nullptr; |
| 11289 | if (pAllocator) |
| 11290 | { |
| 11291 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 11292 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 11293 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 11294 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 11295 | if (local_pCreateInfo) |
| 11296 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 11297 | transform_tohost_VkDescriptorUpdateTemplateCreateInfo(mImpl->resources(), (VkDescriptorUpdateTemplateCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 11298 | } |
| 11299 | if (local_pAllocator) |
| 11300 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 11301 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 11302 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11303 | countingStream->rewind(); |
| 11304 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11305 | uint64_t cgen_var_741; |
| 11306 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_741, 1); |
| 11307 | countingStream->write((uint64_t*)&cgen_var_741, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11308 | marshal_VkDescriptorUpdateTemplateCreateInfo(countingStream, (VkDescriptorUpdateTemplateCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11309 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11310 | uint64_t cgen_var_742 = (uint64_t)(uintptr_t)local_pAllocator; |
| 11311 | countingStream->putBe64(cgen_var_742); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11312 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11313 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11314 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11315 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11316 | uint64_t cgen_var_743; |
| 11317 | countingStream->handleMapping()->mapHandles_VkDescriptorUpdateTemplate_u64(pDescriptorUpdateTemplate, &cgen_var_743, 1); |
| 11318 | countingStream->write((uint64_t*)&cgen_var_743, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11319 | } |
| 11320 | uint32_t packetSize_vkCreateDescriptorUpdateTemplate = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 11321 | countingStream->rewind(); |
| 11322 | uint32_t opcode_vkCreateDescriptorUpdateTemplate = OP_vkCreateDescriptorUpdateTemplate; |
| 11323 | stream->write(&opcode_vkCreateDescriptorUpdateTemplate, sizeof(uint32_t)); |
| 11324 | stream->write(&packetSize_vkCreateDescriptorUpdateTemplate, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11325 | uint64_t cgen_var_744; |
| 11326 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_744, 1); |
| 11327 | stream->write((uint64_t*)&cgen_var_744, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11328 | marshal_VkDescriptorUpdateTemplateCreateInfo(stream, (VkDescriptorUpdateTemplateCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11329 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11330 | uint64_t cgen_var_745 = (uint64_t)(uintptr_t)local_pAllocator; |
| 11331 | stream->putBe64(cgen_var_745); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11332 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11333 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11334 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11335 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11336 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11337 | uint64_t cgen_var_746; |
| 11338 | stream->handleMapping()->mapHandles_VkDescriptorUpdateTemplate_u64(pDescriptorUpdateTemplate, &cgen_var_746, 1); |
| 11339 | stream->write((uint64_t*)&cgen_var_746, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11340 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 11341 | AEMU_SCOPED_TRACE("vkCreateDescriptorUpdateTemplate readParams"); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11342 | stream->setHandleMapping(resources->createMapping()); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11343 | uint64_t cgen_var_747; |
| 11344 | stream->read((uint64_t*)&cgen_var_747, 8); |
| 11345 | stream->handleMapping()->mapHandles_u64_VkDescriptorUpdateTemplate(&cgen_var_747, (VkDescriptorUpdateTemplate*)pDescriptorUpdateTemplate, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11346 | stream->unsetHandleMapping(); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 11347 | AEMU_SCOPED_TRACE("vkCreateDescriptorUpdateTemplate returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11348 | VkResult vkCreateDescriptorUpdateTemplate_VkResult_return = (VkResult)0; |
| 11349 | stream->read(&vkCreateDescriptorUpdateTemplate_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11350 | countingStream->clearPool(); |
| 11351 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11352 | pool->freeAll(); |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 11353 | encoderLock.unlock(); |
| Lingfeng Yang | 05d5ea3 | 2019-03-23 00:12:39 -0700 | [diff] [blame] | 11354 | mImpl->resources()->on_vkCreateDescriptorUpdateTemplate(this, vkCreateDescriptorUpdateTemplate_VkResult_return, device, pCreateInfo, pAllocator, pDescriptorUpdateTemplate); |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 11355 | encoderLock.lock(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11356 | mImpl->log("finish vkCreateDescriptorUpdateTemplate");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11357 | return vkCreateDescriptorUpdateTemplate_VkResult_return; |
| 11358 | } |
| 11359 | |
| 11360 | void VkEncoder::vkDestroyDescriptorUpdateTemplate( |
| 11361 | VkDevice device, |
| 11362 | VkDescriptorUpdateTemplate descriptorUpdateTemplate, |
| 11363 | const VkAllocationCallbacks* pAllocator) |
| 11364 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 11365 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 11366 | AEMU_SCOPED_TRACE("vkDestroyDescriptorUpdateTemplate encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11367 | mImpl->log("start vkDestroyDescriptorUpdateTemplate"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11368 | auto stream = mImpl->stream(); |
| 11369 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11370 | auto resources = mImpl->resources(); |
| 11371 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11372 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11373 | VkDevice local_device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 11374 | VkDescriptorUpdateTemplate local_descriptorUpdateTemplate; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11375 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 11376 | local_device = device; |
| 11377 | local_descriptorUpdateTemplate = descriptorUpdateTemplate; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11378 | local_pAllocator = nullptr; |
| 11379 | if (pAllocator) |
| 11380 | { |
| 11381 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 11382 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 11383 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 11384 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 11385 | if (local_pAllocator) |
| 11386 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 11387 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 11388 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11389 | countingStream->rewind(); |
| 11390 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11391 | uint64_t cgen_var_748; |
| 11392 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_748, 1); |
| 11393 | countingStream->write((uint64_t*)&cgen_var_748, 1 * 8); |
| 11394 | uint64_t cgen_var_749; |
| 11395 | countingStream->handleMapping()->mapHandles_VkDescriptorUpdateTemplate_u64(&local_descriptorUpdateTemplate, &cgen_var_749, 1); |
| 11396 | countingStream->write((uint64_t*)&cgen_var_749, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11397 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11398 | uint64_t cgen_var_750 = (uint64_t)(uintptr_t)local_pAllocator; |
| 11399 | countingStream->putBe64(cgen_var_750); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11400 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11401 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11402 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11403 | } |
| 11404 | } |
| 11405 | uint32_t packetSize_vkDestroyDescriptorUpdateTemplate = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 11406 | countingStream->rewind(); |
| 11407 | uint32_t opcode_vkDestroyDescriptorUpdateTemplate = OP_vkDestroyDescriptorUpdateTemplate; |
| 11408 | stream->write(&opcode_vkDestroyDescriptorUpdateTemplate, sizeof(uint32_t)); |
| 11409 | stream->write(&packetSize_vkDestroyDescriptorUpdateTemplate, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11410 | uint64_t cgen_var_751; |
| 11411 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_751, 1); |
| 11412 | stream->write((uint64_t*)&cgen_var_751, 1 * 8); |
| 11413 | uint64_t cgen_var_752; |
| 11414 | stream->handleMapping()->mapHandles_VkDescriptorUpdateTemplate_u64(&local_descriptorUpdateTemplate, &cgen_var_752, 1); |
| 11415 | stream->write((uint64_t*)&cgen_var_752, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11416 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11417 | uint64_t cgen_var_753 = (uint64_t)(uintptr_t)local_pAllocator; |
| 11418 | stream->putBe64(cgen_var_753); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11419 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11420 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11421 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11422 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 11423 | AEMU_SCOPED_TRACE("vkDestroyDescriptorUpdateTemplate readParams"); |
| 11424 | AEMU_SCOPED_TRACE("vkDestroyDescriptorUpdateTemplate returnUnmarshal"); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11425 | resources->destroyMapping()->mapHandles_VkDescriptorUpdateTemplate((VkDescriptorUpdateTemplate*)&descriptorUpdateTemplate); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11426 | mImpl->log("finish vkDestroyDescriptorUpdateTemplate");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11427 | } |
| 11428 | |
| 11429 | void VkEncoder::vkUpdateDescriptorSetWithTemplate( |
| 11430 | VkDevice device, |
| 11431 | VkDescriptorSet descriptorSet, |
| 11432 | VkDescriptorUpdateTemplate descriptorUpdateTemplate, |
| 11433 | const void* pData) |
| 11434 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 11435 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 11436 | AEMU_SCOPED_TRACE("vkUpdateDescriptorSetWithTemplate encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11437 | mImpl->log("start vkUpdateDescriptorSetWithTemplate"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11438 | auto stream = mImpl->stream(); |
| 11439 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11440 | auto resources = mImpl->resources(); |
| 11441 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11442 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11443 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11444 | VkDescriptorSet local_descriptorSet; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11445 | VkDescriptorUpdateTemplate local_descriptorUpdateTemplate; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11446 | void* local_pData; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 11447 | local_device = device; |
| 11448 | local_descriptorSet = descriptorSet; |
| 11449 | local_descriptorUpdateTemplate = descriptorUpdateTemplate; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11450 | local_pData = nullptr; |
| 11451 | if (pData) |
| 11452 | { |
| 11453 | local_pData = (void*)pool->dupArray(pData, sizeof(const uint8_t)); |
| 11454 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11455 | countingStream->rewind(); |
| 11456 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11457 | uint64_t cgen_var_754; |
| 11458 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_754, 1); |
| 11459 | countingStream->write((uint64_t*)&cgen_var_754, 1 * 8); |
| 11460 | uint64_t cgen_var_755; |
| 11461 | countingStream->handleMapping()->mapHandles_VkDescriptorSet_u64(&local_descriptorSet, &cgen_var_755, 1); |
| 11462 | countingStream->write((uint64_t*)&cgen_var_755, 1 * 8); |
| 11463 | uint64_t cgen_var_756; |
| 11464 | countingStream->handleMapping()->mapHandles_VkDescriptorUpdateTemplate_u64(&local_descriptorUpdateTemplate, &cgen_var_756, 1); |
| 11465 | countingStream->write((uint64_t*)&cgen_var_756, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11466 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11467 | uint64_t cgen_var_757 = (uint64_t)(uintptr_t)local_pData; |
| 11468 | countingStream->putBe64(cgen_var_757); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11469 | if (local_pData) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11470 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11471 | countingStream->write((void*)local_pData, sizeof(uint8_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11472 | } |
| 11473 | } |
| 11474 | uint32_t packetSize_vkUpdateDescriptorSetWithTemplate = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 11475 | countingStream->rewind(); |
| 11476 | uint32_t opcode_vkUpdateDescriptorSetWithTemplate = OP_vkUpdateDescriptorSetWithTemplate; |
| 11477 | stream->write(&opcode_vkUpdateDescriptorSetWithTemplate, sizeof(uint32_t)); |
| 11478 | stream->write(&packetSize_vkUpdateDescriptorSetWithTemplate, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11479 | uint64_t cgen_var_758; |
| 11480 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_758, 1); |
| 11481 | stream->write((uint64_t*)&cgen_var_758, 1 * 8); |
| 11482 | uint64_t cgen_var_759; |
| 11483 | stream->handleMapping()->mapHandles_VkDescriptorSet_u64(&local_descriptorSet, &cgen_var_759, 1); |
| 11484 | stream->write((uint64_t*)&cgen_var_759, 1 * 8); |
| 11485 | uint64_t cgen_var_760; |
| 11486 | stream->handleMapping()->mapHandles_VkDescriptorUpdateTemplate_u64(&local_descriptorUpdateTemplate, &cgen_var_760, 1); |
| 11487 | stream->write((uint64_t*)&cgen_var_760, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11488 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11489 | uint64_t cgen_var_761 = (uint64_t)(uintptr_t)local_pData; |
| 11490 | stream->putBe64(cgen_var_761); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11491 | if (local_pData) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11492 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11493 | stream->write((void*)local_pData, sizeof(uint8_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11494 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 11495 | AEMU_SCOPED_TRACE("vkUpdateDescriptorSetWithTemplate readParams"); |
| 11496 | AEMU_SCOPED_TRACE("vkUpdateDescriptorSetWithTemplate returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11497 | mImpl->log("finish vkUpdateDescriptorSetWithTemplate");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11498 | } |
| 11499 | |
| 11500 | void VkEncoder::vkGetPhysicalDeviceExternalBufferProperties( |
| 11501 | VkPhysicalDevice physicalDevice, |
| 11502 | const VkPhysicalDeviceExternalBufferInfo* pExternalBufferInfo, |
| 11503 | VkExternalBufferProperties* pExternalBufferProperties) |
| 11504 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 11505 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 11506 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceExternalBufferProperties encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11507 | mImpl->log("start vkGetPhysicalDeviceExternalBufferProperties"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11508 | auto stream = mImpl->stream(); |
| 11509 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11510 | auto resources = mImpl->resources(); |
| 11511 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11512 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11513 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11514 | VkPhysicalDeviceExternalBufferInfo* local_pExternalBufferInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 11515 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11516 | local_pExternalBufferInfo = nullptr; |
| 11517 | if (pExternalBufferInfo) |
| 11518 | { |
| 11519 | local_pExternalBufferInfo = (VkPhysicalDeviceExternalBufferInfo*)pool->alloc(sizeof(const VkPhysicalDeviceExternalBufferInfo)); |
| 11520 | deepcopy_VkPhysicalDeviceExternalBufferInfo(pool, pExternalBufferInfo, (VkPhysicalDeviceExternalBufferInfo*)(local_pExternalBufferInfo)); |
| 11521 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 11522 | if (local_pExternalBufferInfo) |
| 11523 | { |
| Lingfeng Yang | 2b1b8cf | 2019-02-08 09:53:36 -0800 | [diff] [blame] | 11524 | mImpl->resources()->transformImpl_VkPhysicalDeviceExternalBufferInfo_tohost(local_pExternalBufferInfo, 1); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 11525 | transform_tohost_VkPhysicalDeviceExternalBufferInfo(mImpl->resources(), (VkPhysicalDeviceExternalBufferInfo*)(local_pExternalBufferInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 11526 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11527 | countingStream->rewind(); |
| 11528 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11529 | uint64_t cgen_var_762; |
| 11530 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_762, 1); |
| 11531 | countingStream->write((uint64_t*)&cgen_var_762, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11532 | marshal_VkPhysicalDeviceExternalBufferInfo(countingStream, (VkPhysicalDeviceExternalBufferInfo*)(local_pExternalBufferInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11533 | marshal_VkExternalBufferProperties(countingStream, (VkExternalBufferProperties*)(pExternalBufferProperties)); |
| 11534 | } |
| 11535 | uint32_t packetSize_vkGetPhysicalDeviceExternalBufferProperties = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 11536 | countingStream->rewind(); |
| 11537 | uint32_t opcode_vkGetPhysicalDeviceExternalBufferProperties = OP_vkGetPhysicalDeviceExternalBufferProperties; |
| 11538 | stream->write(&opcode_vkGetPhysicalDeviceExternalBufferProperties, sizeof(uint32_t)); |
| 11539 | stream->write(&packetSize_vkGetPhysicalDeviceExternalBufferProperties, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11540 | uint64_t cgen_var_763; |
| 11541 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_763, 1); |
| 11542 | stream->write((uint64_t*)&cgen_var_763, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11543 | marshal_VkPhysicalDeviceExternalBufferInfo(stream, (VkPhysicalDeviceExternalBufferInfo*)(local_pExternalBufferInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11544 | marshal_VkExternalBufferProperties(stream, (VkExternalBufferProperties*)(pExternalBufferProperties)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 11545 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceExternalBufferProperties readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11546 | unmarshal_VkExternalBufferProperties(stream, (VkExternalBufferProperties*)(pExternalBufferProperties)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 11547 | if (pExternalBufferProperties) |
| 11548 | { |
| Lingfeng Yang | 2b1b8cf | 2019-02-08 09:53:36 -0800 | [diff] [blame] | 11549 | mImpl->resources()->transformImpl_VkExternalBufferProperties_fromhost(pExternalBufferProperties, 1); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 11550 | transform_fromhost_VkExternalBufferProperties(mImpl->resources(), (VkExternalBufferProperties*)(pExternalBufferProperties)); |
| 11551 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 11552 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceExternalBufferProperties returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11553 | mImpl->log("finish vkGetPhysicalDeviceExternalBufferProperties");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11554 | } |
| 11555 | |
| 11556 | void VkEncoder::vkGetPhysicalDeviceExternalFenceProperties( |
| 11557 | VkPhysicalDevice physicalDevice, |
| 11558 | const VkPhysicalDeviceExternalFenceInfo* pExternalFenceInfo, |
| 11559 | VkExternalFenceProperties* pExternalFenceProperties) |
| 11560 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 11561 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 11562 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceExternalFenceProperties encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11563 | mImpl->log("start vkGetPhysicalDeviceExternalFenceProperties"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11564 | auto stream = mImpl->stream(); |
| 11565 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11566 | auto resources = mImpl->resources(); |
| 11567 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11568 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11569 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11570 | VkPhysicalDeviceExternalFenceInfo* local_pExternalFenceInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 11571 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11572 | local_pExternalFenceInfo = nullptr; |
| 11573 | if (pExternalFenceInfo) |
| 11574 | { |
| 11575 | local_pExternalFenceInfo = (VkPhysicalDeviceExternalFenceInfo*)pool->alloc(sizeof(const VkPhysicalDeviceExternalFenceInfo)); |
| 11576 | deepcopy_VkPhysicalDeviceExternalFenceInfo(pool, pExternalFenceInfo, (VkPhysicalDeviceExternalFenceInfo*)(local_pExternalFenceInfo)); |
| 11577 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 11578 | if (local_pExternalFenceInfo) |
| 11579 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 11580 | transform_tohost_VkPhysicalDeviceExternalFenceInfo(mImpl->resources(), (VkPhysicalDeviceExternalFenceInfo*)(local_pExternalFenceInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 11581 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11582 | countingStream->rewind(); |
| 11583 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11584 | uint64_t cgen_var_764; |
| 11585 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_764, 1); |
| 11586 | countingStream->write((uint64_t*)&cgen_var_764, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11587 | marshal_VkPhysicalDeviceExternalFenceInfo(countingStream, (VkPhysicalDeviceExternalFenceInfo*)(local_pExternalFenceInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11588 | marshal_VkExternalFenceProperties(countingStream, (VkExternalFenceProperties*)(pExternalFenceProperties)); |
| 11589 | } |
| 11590 | uint32_t packetSize_vkGetPhysicalDeviceExternalFenceProperties = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 11591 | countingStream->rewind(); |
| 11592 | uint32_t opcode_vkGetPhysicalDeviceExternalFenceProperties = OP_vkGetPhysicalDeviceExternalFenceProperties; |
| 11593 | stream->write(&opcode_vkGetPhysicalDeviceExternalFenceProperties, sizeof(uint32_t)); |
| 11594 | stream->write(&packetSize_vkGetPhysicalDeviceExternalFenceProperties, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11595 | uint64_t cgen_var_765; |
| 11596 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_765, 1); |
| 11597 | stream->write((uint64_t*)&cgen_var_765, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11598 | marshal_VkPhysicalDeviceExternalFenceInfo(stream, (VkPhysicalDeviceExternalFenceInfo*)(local_pExternalFenceInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11599 | marshal_VkExternalFenceProperties(stream, (VkExternalFenceProperties*)(pExternalFenceProperties)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 11600 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceExternalFenceProperties readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11601 | unmarshal_VkExternalFenceProperties(stream, (VkExternalFenceProperties*)(pExternalFenceProperties)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 11602 | if (pExternalFenceProperties) |
| 11603 | { |
| 11604 | transform_fromhost_VkExternalFenceProperties(mImpl->resources(), (VkExternalFenceProperties*)(pExternalFenceProperties)); |
| 11605 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 11606 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceExternalFenceProperties returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11607 | mImpl->log("finish vkGetPhysicalDeviceExternalFenceProperties");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11608 | } |
| 11609 | |
| 11610 | void VkEncoder::vkGetPhysicalDeviceExternalSemaphoreProperties( |
| 11611 | VkPhysicalDevice physicalDevice, |
| 11612 | const VkPhysicalDeviceExternalSemaphoreInfo* pExternalSemaphoreInfo, |
| 11613 | VkExternalSemaphoreProperties* pExternalSemaphoreProperties) |
| 11614 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 11615 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 11616 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceExternalSemaphoreProperties encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11617 | mImpl->log("start vkGetPhysicalDeviceExternalSemaphoreProperties"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11618 | auto stream = mImpl->stream(); |
| 11619 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11620 | auto resources = mImpl->resources(); |
| 11621 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11622 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11623 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11624 | VkPhysicalDeviceExternalSemaphoreInfo* local_pExternalSemaphoreInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 11625 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11626 | local_pExternalSemaphoreInfo = nullptr; |
| 11627 | if (pExternalSemaphoreInfo) |
| 11628 | { |
| 11629 | local_pExternalSemaphoreInfo = (VkPhysicalDeviceExternalSemaphoreInfo*)pool->alloc(sizeof(const VkPhysicalDeviceExternalSemaphoreInfo)); |
| 11630 | deepcopy_VkPhysicalDeviceExternalSemaphoreInfo(pool, pExternalSemaphoreInfo, (VkPhysicalDeviceExternalSemaphoreInfo*)(local_pExternalSemaphoreInfo)); |
| 11631 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 11632 | if (local_pExternalSemaphoreInfo) |
| 11633 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 11634 | transform_tohost_VkPhysicalDeviceExternalSemaphoreInfo(mImpl->resources(), (VkPhysicalDeviceExternalSemaphoreInfo*)(local_pExternalSemaphoreInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 11635 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11636 | countingStream->rewind(); |
| 11637 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11638 | uint64_t cgen_var_766; |
| 11639 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_766, 1); |
| 11640 | countingStream->write((uint64_t*)&cgen_var_766, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11641 | marshal_VkPhysicalDeviceExternalSemaphoreInfo(countingStream, (VkPhysicalDeviceExternalSemaphoreInfo*)(local_pExternalSemaphoreInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11642 | marshal_VkExternalSemaphoreProperties(countingStream, (VkExternalSemaphoreProperties*)(pExternalSemaphoreProperties)); |
| 11643 | } |
| 11644 | uint32_t packetSize_vkGetPhysicalDeviceExternalSemaphoreProperties = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 11645 | countingStream->rewind(); |
| 11646 | uint32_t opcode_vkGetPhysicalDeviceExternalSemaphoreProperties = OP_vkGetPhysicalDeviceExternalSemaphoreProperties; |
| 11647 | stream->write(&opcode_vkGetPhysicalDeviceExternalSemaphoreProperties, sizeof(uint32_t)); |
| 11648 | stream->write(&packetSize_vkGetPhysicalDeviceExternalSemaphoreProperties, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11649 | uint64_t cgen_var_767; |
| 11650 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_767, 1); |
| 11651 | stream->write((uint64_t*)&cgen_var_767, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11652 | marshal_VkPhysicalDeviceExternalSemaphoreInfo(stream, (VkPhysicalDeviceExternalSemaphoreInfo*)(local_pExternalSemaphoreInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11653 | marshal_VkExternalSemaphoreProperties(stream, (VkExternalSemaphoreProperties*)(pExternalSemaphoreProperties)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 11654 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceExternalSemaphoreProperties readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11655 | unmarshal_VkExternalSemaphoreProperties(stream, (VkExternalSemaphoreProperties*)(pExternalSemaphoreProperties)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 11656 | if (pExternalSemaphoreProperties) |
| 11657 | { |
| 11658 | transform_fromhost_VkExternalSemaphoreProperties(mImpl->resources(), (VkExternalSemaphoreProperties*)(pExternalSemaphoreProperties)); |
| 11659 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 11660 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceExternalSemaphoreProperties returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11661 | mImpl->log("finish vkGetPhysicalDeviceExternalSemaphoreProperties");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11662 | } |
| 11663 | |
| 11664 | void VkEncoder::vkGetDescriptorSetLayoutSupport( |
| 11665 | VkDevice device, |
| 11666 | const VkDescriptorSetLayoutCreateInfo* pCreateInfo, |
| 11667 | VkDescriptorSetLayoutSupport* pSupport) |
| 11668 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 11669 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 11670 | AEMU_SCOPED_TRACE("vkGetDescriptorSetLayoutSupport encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11671 | mImpl->log("start vkGetDescriptorSetLayoutSupport"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11672 | auto stream = mImpl->stream(); |
| 11673 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11674 | auto resources = mImpl->resources(); |
| 11675 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11676 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11677 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11678 | VkDescriptorSetLayoutCreateInfo* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 11679 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11680 | local_pCreateInfo = nullptr; |
| 11681 | if (pCreateInfo) |
| 11682 | { |
| 11683 | local_pCreateInfo = (VkDescriptorSetLayoutCreateInfo*)pool->alloc(sizeof(const VkDescriptorSetLayoutCreateInfo)); |
| 11684 | deepcopy_VkDescriptorSetLayoutCreateInfo(pool, pCreateInfo, (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo)); |
| 11685 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 11686 | if (local_pCreateInfo) |
| 11687 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 11688 | transform_tohost_VkDescriptorSetLayoutCreateInfo(mImpl->resources(), (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 11689 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11690 | countingStream->rewind(); |
| 11691 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11692 | uint64_t cgen_var_768; |
| 11693 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_768, 1); |
| 11694 | countingStream->write((uint64_t*)&cgen_var_768, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11695 | marshal_VkDescriptorSetLayoutCreateInfo(countingStream, (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11696 | marshal_VkDescriptorSetLayoutSupport(countingStream, (VkDescriptorSetLayoutSupport*)(pSupport)); |
| 11697 | } |
| 11698 | uint32_t packetSize_vkGetDescriptorSetLayoutSupport = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 11699 | countingStream->rewind(); |
| 11700 | uint32_t opcode_vkGetDescriptorSetLayoutSupport = OP_vkGetDescriptorSetLayoutSupport; |
| 11701 | stream->write(&opcode_vkGetDescriptorSetLayoutSupport, sizeof(uint32_t)); |
| 11702 | stream->write(&packetSize_vkGetDescriptorSetLayoutSupport, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11703 | uint64_t cgen_var_769; |
| 11704 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_769, 1); |
| 11705 | stream->write((uint64_t*)&cgen_var_769, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11706 | marshal_VkDescriptorSetLayoutCreateInfo(stream, (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11707 | marshal_VkDescriptorSetLayoutSupport(stream, (VkDescriptorSetLayoutSupport*)(pSupport)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 11708 | AEMU_SCOPED_TRACE("vkGetDescriptorSetLayoutSupport readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11709 | unmarshal_VkDescriptorSetLayoutSupport(stream, (VkDescriptorSetLayoutSupport*)(pSupport)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 11710 | if (pSupport) |
| 11711 | { |
| 11712 | transform_fromhost_VkDescriptorSetLayoutSupport(mImpl->resources(), (VkDescriptorSetLayoutSupport*)(pSupport)); |
| 11713 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 11714 | AEMU_SCOPED_TRACE("vkGetDescriptorSetLayoutSupport returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11715 | mImpl->log("finish vkGetDescriptorSetLayoutSupport");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11716 | } |
| 11717 | |
| 11718 | #endif |
| 11719 | #ifdef VK_KHR_surface |
| 11720 | void VkEncoder::vkDestroySurfaceKHR( |
| 11721 | VkInstance instance, |
| 11722 | VkSurfaceKHR surface, |
| 11723 | const VkAllocationCallbacks* pAllocator) |
| 11724 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 11725 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 11726 | AEMU_SCOPED_TRACE("vkDestroySurfaceKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11727 | mImpl->log("start vkDestroySurfaceKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11728 | auto stream = mImpl->stream(); |
| 11729 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11730 | auto resources = mImpl->resources(); |
| 11731 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11732 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11733 | VkInstance local_instance; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 11734 | VkSurfaceKHR local_surface; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11735 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 11736 | local_instance = instance; |
| 11737 | local_surface = surface; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11738 | local_pAllocator = nullptr; |
| 11739 | if (pAllocator) |
| 11740 | { |
| 11741 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 11742 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 11743 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 11744 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 11745 | if (local_pAllocator) |
| 11746 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 11747 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 11748 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11749 | countingStream->rewind(); |
| 11750 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11751 | uint64_t cgen_var_770; |
| 11752 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_770, 1); |
| 11753 | countingStream->write((uint64_t*)&cgen_var_770, 1 * 8); |
| 11754 | uint64_t cgen_var_771; |
| 11755 | countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(&local_surface, &cgen_var_771, 1); |
| 11756 | countingStream->write((uint64_t*)&cgen_var_771, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11757 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11758 | uint64_t cgen_var_772 = (uint64_t)(uintptr_t)local_pAllocator; |
| 11759 | countingStream->putBe64(cgen_var_772); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11760 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11761 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11762 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11763 | } |
| 11764 | } |
| 11765 | uint32_t packetSize_vkDestroySurfaceKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 11766 | countingStream->rewind(); |
| 11767 | uint32_t opcode_vkDestroySurfaceKHR = OP_vkDestroySurfaceKHR; |
| 11768 | stream->write(&opcode_vkDestroySurfaceKHR, sizeof(uint32_t)); |
| 11769 | stream->write(&packetSize_vkDestroySurfaceKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11770 | uint64_t cgen_var_773; |
| 11771 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_773, 1); |
| 11772 | stream->write((uint64_t*)&cgen_var_773, 1 * 8); |
| 11773 | uint64_t cgen_var_774; |
| 11774 | stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(&local_surface, &cgen_var_774, 1); |
| 11775 | stream->write((uint64_t*)&cgen_var_774, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11776 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11777 | uint64_t cgen_var_775 = (uint64_t)(uintptr_t)local_pAllocator; |
| 11778 | stream->putBe64(cgen_var_775); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11779 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11780 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11781 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11782 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 11783 | AEMU_SCOPED_TRACE("vkDestroySurfaceKHR readParams"); |
| 11784 | AEMU_SCOPED_TRACE("vkDestroySurfaceKHR returnUnmarshal"); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11785 | resources->destroyMapping()->mapHandles_VkSurfaceKHR((VkSurfaceKHR*)&surface); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11786 | mImpl->log("finish vkDestroySurfaceKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11787 | } |
| 11788 | |
| 11789 | VkResult VkEncoder::vkGetPhysicalDeviceSurfaceSupportKHR( |
| 11790 | VkPhysicalDevice physicalDevice, |
| 11791 | uint32_t queueFamilyIndex, |
| 11792 | VkSurfaceKHR surface, |
| 11793 | VkBool32* pSupported) |
| 11794 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 11795 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 11796 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceSurfaceSupportKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11797 | mImpl->log("start vkGetPhysicalDeviceSurfaceSupportKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11798 | auto stream = mImpl->stream(); |
| 11799 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11800 | auto resources = mImpl->resources(); |
| 11801 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11802 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11803 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11804 | uint32_t local_queueFamilyIndex; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11805 | VkSurfaceKHR local_surface; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 11806 | local_physicalDevice = physicalDevice; |
| 11807 | local_queueFamilyIndex = queueFamilyIndex; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11808 | local_surface = surface; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11809 | countingStream->rewind(); |
| 11810 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11811 | uint64_t cgen_var_776; |
| 11812 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_776, 1); |
| 11813 | countingStream->write((uint64_t*)&cgen_var_776, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11814 | countingStream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11815 | uint64_t cgen_var_777; |
| 11816 | countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(&local_surface, &cgen_var_777, 1); |
| 11817 | countingStream->write((uint64_t*)&cgen_var_777, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11818 | countingStream->write((VkBool32*)pSupported, sizeof(VkBool32)); |
| 11819 | } |
| 11820 | uint32_t packetSize_vkGetPhysicalDeviceSurfaceSupportKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 11821 | countingStream->rewind(); |
| 11822 | uint32_t opcode_vkGetPhysicalDeviceSurfaceSupportKHR = OP_vkGetPhysicalDeviceSurfaceSupportKHR; |
| 11823 | stream->write(&opcode_vkGetPhysicalDeviceSurfaceSupportKHR, sizeof(uint32_t)); |
| 11824 | stream->write(&packetSize_vkGetPhysicalDeviceSurfaceSupportKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11825 | uint64_t cgen_var_778; |
| 11826 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_778, 1); |
| 11827 | stream->write((uint64_t*)&cgen_var_778, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11828 | stream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11829 | uint64_t cgen_var_779; |
| 11830 | stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(&local_surface, &cgen_var_779, 1); |
| 11831 | stream->write((uint64_t*)&cgen_var_779, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11832 | stream->write((VkBool32*)pSupported, sizeof(VkBool32)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 11833 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceSurfaceSupportKHR readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11834 | stream->read((VkBool32*)pSupported, sizeof(VkBool32)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 11835 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceSurfaceSupportKHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11836 | VkResult vkGetPhysicalDeviceSurfaceSupportKHR_VkResult_return = (VkResult)0; |
| 11837 | stream->read(&vkGetPhysicalDeviceSurfaceSupportKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11838 | countingStream->clearPool(); |
| 11839 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11840 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11841 | mImpl->log("finish vkGetPhysicalDeviceSurfaceSupportKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11842 | return vkGetPhysicalDeviceSurfaceSupportKHR_VkResult_return; |
| 11843 | } |
| 11844 | |
| 11845 | VkResult VkEncoder::vkGetPhysicalDeviceSurfaceCapabilitiesKHR( |
| 11846 | VkPhysicalDevice physicalDevice, |
| 11847 | VkSurfaceKHR surface, |
| 11848 | VkSurfaceCapabilitiesKHR* pSurfaceCapabilities) |
| 11849 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 11850 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 11851 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceSurfaceCapabilitiesKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11852 | mImpl->log("start vkGetPhysicalDeviceSurfaceCapabilitiesKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11853 | auto stream = mImpl->stream(); |
| 11854 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11855 | auto resources = mImpl->resources(); |
| 11856 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11857 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11858 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11859 | VkSurfaceKHR local_surface; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 11860 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11861 | local_surface = surface; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11862 | countingStream->rewind(); |
| 11863 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11864 | uint64_t cgen_var_780; |
| 11865 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_780, 1); |
| 11866 | countingStream->write((uint64_t*)&cgen_var_780, 1 * 8); |
| 11867 | uint64_t cgen_var_781; |
| 11868 | countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(&local_surface, &cgen_var_781, 1); |
| 11869 | countingStream->write((uint64_t*)&cgen_var_781, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11870 | marshal_VkSurfaceCapabilitiesKHR(countingStream, (VkSurfaceCapabilitiesKHR*)(pSurfaceCapabilities)); |
| 11871 | } |
| 11872 | uint32_t packetSize_vkGetPhysicalDeviceSurfaceCapabilitiesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 11873 | countingStream->rewind(); |
| 11874 | uint32_t opcode_vkGetPhysicalDeviceSurfaceCapabilitiesKHR = OP_vkGetPhysicalDeviceSurfaceCapabilitiesKHR; |
| 11875 | stream->write(&opcode_vkGetPhysicalDeviceSurfaceCapabilitiesKHR, sizeof(uint32_t)); |
| 11876 | stream->write(&packetSize_vkGetPhysicalDeviceSurfaceCapabilitiesKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11877 | uint64_t cgen_var_782; |
| 11878 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_782, 1); |
| 11879 | stream->write((uint64_t*)&cgen_var_782, 1 * 8); |
| 11880 | uint64_t cgen_var_783; |
| 11881 | stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(&local_surface, &cgen_var_783, 1); |
| 11882 | stream->write((uint64_t*)&cgen_var_783, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11883 | marshal_VkSurfaceCapabilitiesKHR(stream, (VkSurfaceCapabilitiesKHR*)(pSurfaceCapabilities)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 11884 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceSurfaceCapabilitiesKHR readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11885 | unmarshal_VkSurfaceCapabilitiesKHR(stream, (VkSurfaceCapabilitiesKHR*)(pSurfaceCapabilities)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 11886 | if (pSurfaceCapabilities) |
| 11887 | { |
| 11888 | transform_fromhost_VkSurfaceCapabilitiesKHR(mImpl->resources(), (VkSurfaceCapabilitiesKHR*)(pSurfaceCapabilities)); |
| 11889 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 11890 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceSurfaceCapabilitiesKHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11891 | VkResult vkGetPhysicalDeviceSurfaceCapabilitiesKHR_VkResult_return = (VkResult)0; |
| 11892 | stream->read(&vkGetPhysicalDeviceSurfaceCapabilitiesKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11893 | countingStream->clearPool(); |
| 11894 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11895 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11896 | mImpl->log("finish vkGetPhysicalDeviceSurfaceCapabilitiesKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11897 | return vkGetPhysicalDeviceSurfaceCapabilitiesKHR_VkResult_return; |
| 11898 | } |
| 11899 | |
| 11900 | VkResult VkEncoder::vkGetPhysicalDeviceSurfaceFormatsKHR( |
| 11901 | VkPhysicalDevice physicalDevice, |
| 11902 | VkSurfaceKHR surface, |
| 11903 | uint32_t* pSurfaceFormatCount, |
| 11904 | VkSurfaceFormatKHR* pSurfaceFormats) |
| 11905 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 11906 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 11907 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceSurfaceFormatsKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11908 | mImpl->log("start vkGetPhysicalDeviceSurfaceFormatsKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11909 | auto stream = mImpl->stream(); |
| 11910 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11911 | auto resources = mImpl->resources(); |
| 11912 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11913 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11914 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11915 | VkSurfaceKHR local_surface; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 11916 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11917 | local_surface = surface; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11918 | countingStream->rewind(); |
| 11919 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11920 | uint64_t cgen_var_784; |
| 11921 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_784, 1); |
| 11922 | countingStream->write((uint64_t*)&cgen_var_784, 1 * 8); |
| 11923 | uint64_t cgen_var_785; |
| 11924 | countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(&local_surface, &cgen_var_785, 1); |
| 11925 | countingStream->write((uint64_t*)&cgen_var_785, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11926 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11927 | uint64_t cgen_var_786 = (uint64_t)(uintptr_t)pSurfaceFormatCount; |
| 11928 | countingStream->putBe64(cgen_var_786); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11929 | if (pSurfaceFormatCount) |
| 11930 | { |
| 11931 | countingStream->write((uint32_t*)pSurfaceFormatCount, sizeof(uint32_t)); |
| 11932 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11933 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11934 | uint64_t cgen_var_787 = (uint64_t)(uintptr_t)pSurfaceFormats; |
| 11935 | countingStream->putBe64(cgen_var_787); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11936 | if (pSurfaceFormats) |
| 11937 | { |
| 11938 | for (uint32_t i = 0; i < (uint32_t)(*(pSurfaceFormatCount)); ++i) |
| 11939 | { |
| 11940 | marshal_VkSurfaceFormatKHR(countingStream, (VkSurfaceFormatKHR*)(pSurfaceFormats + i)); |
| 11941 | } |
| 11942 | } |
| 11943 | } |
| 11944 | uint32_t packetSize_vkGetPhysicalDeviceSurfaceFormatsKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 11945 | countingStream->rewind(); |
| 11946 | uint32_t opcode_vkGetPhysicalDeviceSurfaceFormatsKHR = OP_vkGetPhysicalDeviceSurfaceFormatsKHR; |
| 11947 | stream->write(&opcode_vkGetPhysicalDeviceSurfaceFormatsKHR, sizeof(uint32_t)); |
| 11948 | stream->write(&packetSize_vkGetPhysicalDeviceSurfaceFormatsKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11949 | uint64_t cgen_var_788; |
| 11950 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_788, 1); |
| 11951 | stream->write((uint64_t*)&cgen_var_788, 1 * 8); |
| 11952 | uint64_t cgen_var_789; |
| 11953 | stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(&local_surface, &cgen_var_789, 1); |
| 11954 | stream->write((uint64_t*)&cgen_var_789, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11955 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11956 | uint64_t cgen_var_790 = (uint64_t)(uintptr_t)pSurfaceFormatCount; |
| 11957 | stream->putBe64(cgen_var_790); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11958 | if (pSurfaceFormatCount) |
| 11959 | { |
| 11960 | stream->write((uint32_t*)pSurfaceFormatCount, sizeof(uint32_t)); |
| 11961 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11962 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11963 | uint64_t cgen_var_791 = (uint64_t)(uintptr_t)pSurfaceFormats; |
| 11964 | stream->putBe64(cgen_var_791); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11965 | if (pSurfaceFormats) |
| 11966 | { |
| 11967 | for (uint32_t i = 0; i < (uint32_t)(*(pSurfaceFormatCount)); ++i) |
| 11968 | { |
| 11969 | marshal_VkSurfaceFormatKHR(stream, (VkSurfaceFormatKHR*)(pSurfaceFormats + i)); |
| 11970 | } |
| 11971 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 11972 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceSurfaceFormatsKHR readParams"); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11973 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11974 | uint32_t* check_pSurfaceFormatCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11975 | check_pSurfaceFormatCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11976 | if (pSurfaceFormatCount) |
| 11977 | { |
| 11978 | if (!(check_pSurfaceFormatCount)) |
| 11979 | { |
| 11980 | fprintf(stderr, "fatal: pSurfaceFormatCount inconsistent between guest and host\n"); |
| 11981 | } |
| 11982 | stream->read((uint32_t*)pSurfaceFormatCount, sizeof(uint32_t)); |
| 11983 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11984 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11985 | VkSurfaceFormatKHR* check_pSurfaceFormats; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11986 | check_pSurfaceFormats = (VkSurfaceFormatKHR*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11987 | if (pSurfaceFormats) |
| 11988 | { |
| 11989 | if (!(check_pSurfaceFormats)) |
| 11990 | { |
| 11991 | fprintf(stderr, "fatal: pSurfaceFormats inconsistent between guest and host\n"); |
| 11992 | } |
| 11993 | for (uint32_t i = 0; i < (uint32_t)(*(pSurfaceFormatCount)); ++i) |
| 11994 | { |
| 11995 | unmarshal_VkSurfaceFormatKHR(stream, (VkSurfaceFormatKHR*)(pSurfaceFormats + i)); |
| 11996 | } |
| 11997 | } |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 11998 | if (pSurfaceFormats) |
| 11999 | { |
| 12000 | for (uint32_t i = 0; i < (uint32_t)(*(pSurfaceFormatCount)); ++i) |
| 12001 | { |
| 12002 | transform_fromhost_VkSurfaceFormatKHR(mImpl->resources(), (VkSurfaceFormatKHR*)(pSurfaceFormats + i)); |
| 12003 | } |
| 12004 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 12005 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceSurfaceFormatsKHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12006 | VkResult vkGetPhysicalDeviceSurfaceFormatsKHR_VkResult_return = (VkResult)0; |
| 12007 | stream->read(&vkGetPhysicalDeviceSurfaceFormatsKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12008 | countingStream->clearPool(); |
| 12009 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12010 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 12011 | mImpl->log("finish vkGetPhysicalDeviceSurfaceFormatsKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12012 | return vkGetPhysicalDeviceSurfaceFormatsKHR_VkResult_return; |
| 12013 | } |
| 12014 | |
| 12015 | VkResult VkEncoder::vkGetPhysicalDeviceSurfacePresentModesKHR( |
| 12016 | VkPhysicalDevice physicalDevice, |
| 12017 | VkSurfaceKHR surface, |
| 12018 | uint32_t* pPresentModeCount, |
| 12019 | VkPresentModeKHR* pPresentModes) |
| 12020 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 12021 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 12022 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceSurfacePresentModesKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 12023 | mImpl->log("start vkGetPhysicalDeviceSurfacePresentModesKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12024 | auto stream = mImpl->stream(); |
| 12025 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12026 | auto resources = mImpl->resources(); |
| 12027 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12028 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12029 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12030 | VkSurfaceKHR local_surface; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 12031 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12032 | local_surface = surface; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12033 | countingStream->rewind(); |
| 12034 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12035 | uint64_t cgen_var_794; |
| 12036 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_794, 1); |
| 12037 | countingStream->write((uint64_t*)&cgen_var_794, 1 * 8); |
| 12038 | uint64_t cgen_var_795; |
| 12039 | countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(&local_surface, &cgen_var_795, 1); |
| 12040 | countingStream->write((uint64_t*)&cgen_var_795, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12041 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12042 | uint64_t cgen_var_796 = (uint64_t)(uintptr_t)pPresentModeCount; |
| 12043 | countingStream->putBe64(cgen_var_796); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12044 | if (pPresentModeCount) |
| 12045 | { |
| 12046 | countingStream->write((uint32_t*)pPresentModeCount, sizeof(uint32_t)); |
| 12047 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12048 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12049 | uint64_t cgen_var_797 = (uint64_t)(uintptr_t)pPresentModes; |
| 12050 | countingStream->putBe64(cgen_var_797); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12051 | if (pPresentModes) |
| 12052 | { |
| 12053 | countingStream->write((VkPresentModeKHR*)pPresentModes, (*(pPresentModeCount)) * sizeof(VkPresentModeKHR)); |
| 12054 | } |
| 12055 | } |
| 12056 | uint32_t packetSize_vkGetPhysicalDeviceSurfacePresentModesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 12057 | countingStream->rewind(); |
| 12058 | uint32_t opcode_vkGetPhysicalDeviceSurfacePresentModesKHR = OP_vkGetPhysicalDeviceSurfacePresentModesKHR; |
| 12059 | stream->write(&opcode_vkGetPhysicalDeviceSurfacePresentModesKHR, sizeof(uint32_t)); |
| 12060 | stream->write(&packetSize_vkGetPhysicalDeviceSurfacePresentModesKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12061 | uint64_t cgen_var_798; |
| 12062 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_798, 1); |
| 12063 | stream->write((uint64_t*)&cgen_var_798, 1 * 8); |
| 12064 | uint64_t cgen_var_799; |
| 12065 | stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(&local_surface, &cgen_var_799, 1); |
| 12066 | stream->write((uint64_t*)&cgen_var_799, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12067 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12068 | uint64_t cgen_var_800 = (uint64_t)(uintptr_t)pPresentModeCount; |
| 12069 | stream->putBe64(cgen_var_800); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12070 | if (pPresentModeCount) |
| 12071 | { |
| 12072 | stream->write((uint32_t*)pPresentModeCount, sizeof(uint32_t)); |
| 12073 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12074 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12075 | uint64_t cgen_var_801 = (uint64_t)(uintptr_t)pPresentModes; |
| 12076 | stream->putBe64(cgen_var_801); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12077 | if (pPresentModes) |
| 12078 | { |
| 12079 | stream->write((VkPresentModeKHR*)pPresentModes, (*(pPresentModeCount)) * sizeof(VkPresentModeKHR)); |
| 12080 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 12081 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceSurfacePresentModesKHR readParams"); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12082 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12083 | uint32_t* check_pPresentModeCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12084 | check_pPresentModeCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12085 | if (pPresentModeCount) |
| 12086 | { |
| 12087 | if (!(check_pPresentModeCount)) |
| 12088 | { |
| 12089 | fprintf(stderr, "fatal: pPresentModeCount inconsistent between guest and host\n"); |
| 12090 | } |
| 12091 | stream->read((uint32_t*)pPresentModeCount, sizeof(uint32_t)); |
| 12092 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12093 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12094 | VkPresentModeKHR* check_pPresentModes; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12095 | check_pPresentModes = (VkPresentModeKHR*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12096 | if (pPresentModes) |
| 12097 | { |
| 12098 | if (!(check_pPresentModes)) |
| 12099 | { |
| 12100 | fprintf(stderr, "fatal: pPresentModes inconsistent between guest and host\n"); |
| 12101 | } |
| 12102 | stream->read((VkPresentModeKHR*)pPresentModes, (*(pPresentModeCount)) * sizeof(VkPresentModeKHR)); |
| 12103 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 12104 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceSurfacePresentModesKHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12105 | VkResult vkGetPhysicalDeviceSurfacePresentModesKHR_VkResult_return = (VkResult)0; |
| 12106 | stream->read(&vkGetPhysicalDeviceSurfacePresentModesKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12107 | countingStream->clearPool(); |
| 12108 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12109 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 12110 | mImpl->log("finish vkGetPhysicalDeviceSurfacePresentModesKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12111 | return vkGetPhysicalDeviceSurfacePresentModesKHR_VkResult_return; |
| 12112 | } |
| 12113 | |
| 12114 | #endif |
| 12115 | #ifdef VK_KHR_swapchain |
| 12116 | VkResult VkEncoder::vkCreateSwapchainKHR( |
| 12117 | VkDevice device, |
| 12118 | const VkSwapchainCreateInfoKHR* pCreateInfo, |
| 12119 | const VkAllocationCallbacks* pAllocator, |
| 12120 | VkSwapchainKHR* pSwapchain) |
| 12121 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 12122 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 12123 | AEMU_SCOPED_TRACE("vkCreateSwapchainKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 12124 | mImpl->log("start vkCreateSwapchainKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12125 | auto stream = mImpl->stream(); |
| 12126 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12127 | auto resources = mImpl->resources(); |
| 12128 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12129 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12130 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12131 | VkSwapchainCreateInfoKHR* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 12132 | VkAllocationCallbacks* local_pAllocator; |
| 12133 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12134 | local_pCreateInfo = nullptr; |
| 12135 | if (pCreateInfo) |
| 12136 | { |
| 12137 | local_pCreateInfo = (VkSwapchainCreateInfoKHR*)pool->alloc(sizeof(const VkSwapchainCreateInfoKHR)); |
| 12138 | deepcopy_VkSwapchainCreateInfoKHR(pool, pCreateInfo, (VkSwapchainCreateInfoKHR*)(local_pCreateInfo)); |
| 12139 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12140 | local_pAllocator = nullptr; |
| 12141 | if (pAllocator) |
| 12142 | { |
| 12143 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 12144 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 12145 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 12146 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 12147 | if (local_pCreateInfo) |
| 12148 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 12149 | transform_tohost_VkSwapchainCreateInfoKHR(mImpl->resources(), (VkSwapchainCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 12150 | } |
| 12151 | if (local_pAllocator) |
| 12152 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 12153 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 12154 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12155 | countingStream->rewind(); |
| 12156 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12157 | uint64_t cgen_var_804; |
| 12158 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_804, 1); |
| 12159 | countingStream->write((uint64_t*)&cgen_var_804, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12160 | marshal_VkSwapchainCreateInfoKHR(countingStream, (VkSwapchainCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12161 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12162 | uint64_t cgen_var_805 = (uint64_t)(uintptr_t)local_pAllocator; |
| 12163 | countingStream->putBe64(cgen_var_805); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12164 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12165 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12166 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12167 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12168 | uint64_t cgen_var_806; |
| 12169 | countingStream->handleMapping()->mapHandles_VkSwapchainKHR_u64(pSwapchain, &cgen_var_806, 1); |
| 12170 | countingStream->write((uint64_t*)&cgen_var_806, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12171 | } |
| 12172 | uint32_t packetSize_vkCreateSwapchainKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 12173 | countingStream->rewind(); |
| 12174 | uint32_t opcode_vkCreateSwapchainKHR = OP_vkCreateSwapchainKHR; |
| 12175 | stream->write(&opcode_vkCreateSwapchainKHR, sizeof(uint32_t)); |
| 12176 | stream->write(&packetSize_vkCreateSwapchainKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12177 | uint64_t cgen_var_807; |
| 12178 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_807, 1); |
| 12179 | stream->write((uint64_t*)&cgen_var_807, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12180 | marshal_VkSwapchainCreateInfoKHR(stream, (VkSwapchainCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12181 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12182 | uint64_t cgen_var_808 = (uint64_t)(uintptr_t)local_pAllocator; |
| 12183 | stream->putBe64(cgen_var_808); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12184 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12185 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12186 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12187 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12188 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12189 | uint64_t cgen_var_809; |
| 12190 | stream->handleMapping()->mapHandles_VkSwapchainKHR_u64(pSwapchain, &cgen_var_809, 1); |
| 12191 | stream->write((uint64_t*)&cgen_var_809, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12192 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 12193 | AEMU_SCOPED_TRACE("vkCreateSwapchainKHR readParams"); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12194 | stream->setHandleMapping(resources->createMapping()); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12195 | uint64_t cgen_var_810; |
| 12196 | stream->read((uint64_t*)&cgen_var_810, 8); |
| 12197 | stream->handleMapping()->mapHandles_u64_VkSwapchainKHR(&cgen_var_810, (VkSwapchainKHR*)pSwapchain, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12198 | stream->unsetHandleMapping(); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 12199 | AEMU_SCOPED_TRACE("vkCreateSwapchainKHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12200 | VkResult vkCreateSwapchainKHR_VkResult_return = (VkResult)0; |
| 12201 | stream->read(&vkCreateSwapchainKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12202 | countingStream->clearPool(); |
| 12203 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12204 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 12205 | mImpl->log("finish vkCreateSwapchainKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12206 | return vkCreateSwapchainKHR_VkResult_return; |
| 12207 | } |
| 12208 | |
| 12209 | void VkEncoder::vkDestroySwapchainKHR( |
| 12210 | VkDevice device, |
| 12211 | VkSwapchainKHR swapchain, |
| 12212 | const VkAllocationCallbacks* pAllocator) |
| 12213 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 12214 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 12215 | AEMU_SCOPED_TRACE("vkDestroySwapchainKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 12216 | mImpl->log("start vkDestroySwapchainKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12217 | auto stream = mImpl->stream(); |
| 12218 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12219 | auto resources = mImpl->resources(); |
| 12220 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12221 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12222 | VkDevice local_device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 12223 | VkSwapchainKHR local_swapchain; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12224 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 12225 | local_device = device; |
| 12226 | local_swapchain = swapchain; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12227 | local_pAllocator = nullptr; |
| 12228 | if (pAllocator) |
| 12229 | { |
| 12230 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 12231 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 12232 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 12233 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 12234 | if (local_pAllocator) |
| 12235 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 12236 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 12237 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12238 | countingStream->rewind(); |
| 12239 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12240 | uint64_t cgen_var_811; |
| 12241 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_811, 1); |
| 12242 | countingStream->write((uint64_t*)&cgen_var_811, 1 * 8); |
| 12243 | uint64_t cgen_var_812; |
| 12244 | countingStream->handleMapping()->mapHandles_VkSwapchainKHR_u64(&local_swapchain, &cgen_var_812, 1); |
| 12245 | countingStream->write((uint64_t*)&cgen_var_812, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12246 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12247 | uint64_t cgen_var_813 = (uint64_t)(uintptr_t)local_pAllocator; |
| 12248 | countingStream->putBe64(cgen_var_813); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12249 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12250 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12251 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12252 | } |
| 12253 | } |
| 12254 | uint32_t packetSize_vkDestroySwapchainKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 12255 | countingStream->rewind(); |
| 12256 | uint32_t opcode_vkDestroySwapchainKHR = OP_vkDestroySwapchainKHR; |
| 12257 | stream->write(&opcode_vkDestroySwapchainKHR, sizeof(uint32_t)); |
| 12258 | stream->write(&packetSize_vkDestroySwapchainKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12259 | uint64_t cgen_var_814; |
| 12260 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_814, 1); |
| 12261 | stream->write((uint64_t*)&cgen_var_814, 1 * 8); |
| 12262 | uint64_t cgen_var_815; |
| 12263 | stream->handleMapping()->mapHandles_VkSwapchainKHR_u64(&local_swapchain, &cgen_var_815, 1); |
| 12264 | stream->write((uint64_t*)&cgen_var_815, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12265 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12266 | uint64_t cgen_var_816 = (uint64_t)(uintptr_t)local_pAllocator; |
| 12267 | stream->putBe64(cgen_var_816); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12268 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12269 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12270 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12271 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 12272 | AEMU_SCOPED_TRACE("vkDestroySwapchainKHR readParams"); |
| 12273 | AEMU_SCOPED_TRACE("vkDestroySwapchainKHR returnUnmarshal"); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12274 | resources->destroyMapping()->mapHandles_VkSwapchainKHR((VkSwapchainKHR*)&swapchain); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 12275 | mImpl->log("finish vkDestroySwapchainKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12276 | } |
| 12277 | |
| 12278 | VkResult VkEncoder::vkGetSwapchainImagesKHR( |
| 12279 | VkDevice device, |
| 12280 | VkSwapchainKHR swapchain, |
| 12281 | uint32_t* pSwapchainImageCount, |
| 12282 | VkImage* pSwapchainImages) |
| 12283 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 12284 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 12285 | AEMU_SCOPED_TRACE("vkGetSwapchainImagesKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 12286 | mImpl->log("start vkGetSwapchainImagesKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12287 | auto stream = mImpl->stream(); |
| 12288 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12289 | auto resources = mImpl->resources(); |
| 12290 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12291 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12292 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12293 | VkSwapchainKHR local_swapchain; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 12294 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12295 | local_swapchain = swapchain; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12296 | countingStream->rewind(); |
| 12297 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12298 | uint64_t cgen_var_817; |
| 12299 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_817, 1); |
| 12300 | countingStream->write((uint64_t*)&cgen_var_817, 1 * 8); |
| 12301 | uint64_t cgen_var_818; |
| 12302 | countingStream->handleMapping()->mapHandles_VkSwapchainKHR_u64(&local_swapchain, &cgen_var_818, 1); |
| 12303 | countingStream->write((uint64_t*)&cgen_var_818, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12304 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12305 | uint64_t cgen_var_819 = (uint64_t)(uintptr_t)pSwapchainImageCount; |
| 12306 | countingStream->putBe64(cgen_var_819); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12307 | if (pSwapchainImageCount) |
| 12308 | { |
| 12309 | countingStream->write((uint32_t*)pSwapchainImageCount, sizeof(uint32_t)); |
| 12310 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12311 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12312 | uint64_t cgen_var_820 = (uint64_t)(uintptr_t)pSwapchainImages; |
| 12313 | countingStream->putBe64(cgen_var_820); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12314 | if (pSwapchainImages) |
| 12315 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12316 | if ((*(pSwapchainImageCount))) |
| 12317 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12318 | uint64_t* cgen_var_821; |
| 12319 | countingStream->alloc((void**)&cgen_var_821, (*(pSwapchainImageCount)) * 8); |
| 12320 | countingStream->handleMapping()->mapHandles_VkImage_u64(pSwapchainImages, cgen_var_821, (*(pSwapchainImageCount))); |
| 12321 | countingStream->write((uint64_t*)cgen_var_821, (*(pSwapchainImageCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12322 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12323 | } |
| 12324 | } |
| 12325 | uint32_t packetSize_vkGetSwapchainImagesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 12326 | countingStream->rewind(); |
| 12327 | uint32_t opcode_vkGetSwapchainImagesKHR = OP_vkGetSwapchainImagesKHR; |
| 12328 | stream->write(&opcode_vkGetSwapchainImagesKHR, sizeof(uint32_t)); |
| 12329 | stream->write(&packetSize_vkGetSwapchainImagesKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12330 | uint64_t cgen_var_822; |
| 12331 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_822, 1); |
| 12332 | stream->write((uint64_t*)&cgen_var_822, 1 * 8); |
| 12333 | uint64_t cgen_var_823; |
| 12334 | stream->handleMapping()->mapHandles_VkSwapchainKHR_u64(&local_swapchain, &cgen_var_823, 1); |
| 12335 | stream->write((uint64_t*)&cgen_var_823, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12336 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12337 | uint64_t cgen_var_824 = (uint64_t)(uintptr_t)pSwapchainImageCount; |
| 12338 | stream->putBe64(cgen_var_824); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12339 | if (pSwapchainImageCount) |
| 12340 | { |
| 12341 | stream->write((uint32_t*)pSwapchainImageCount, sizeof(uint32_t)); |
| 12342 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12343 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12344 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12345 | uint64_t cgen_var_825 = (uint64_t)(uintptr_t)pSwapchainImages; |
| 12346 | stream->putBe64(cgen_var_825); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12347 | if (pSwapchainImages) |
| 12348 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12349 | if ((*(pSwapchainImageCount))) |
| 12350 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12351 | uint64_t* cgen_var_826; |
| 12352 | stream->alloc((void**)&cgen_var_826, (*(pSwapchainImageCount)) * 8); |
| 12353 | stream->handleMapping()->mapHandles_VkImage_u64(pSwapchainImages, cgen_var_826, (*(pSwapchainImageCount))); |
| 12354 | stream->write((uint64_t*)cgen_var_826, (*(pSwapchainImageCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12355 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12356 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12357 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 12358 | AEMU_SCOPED_TRACE("vkGetSwapchainImagesKHR readParams"); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12359 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12360 | uint32_t* check_pSwapchainImageCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12361 | check_pSwapchainImageCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12362 | if (pSwapchainImageCount) |
| 12363 | { |
| 12364 | if (!(check_pSwapchainImageCount)) |
| 12365 | { |
| 12366 | fprintf(stderr, "fatal: pSwapchainImageCount inconsistent between guest and host\n"); |
| 12367 | } |
| 12368 | stream->read((uint32_t*)pSwapchainImageCount, sizeof(uint32_t)); |
| 12369 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12370 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12371 | VkImage* check_pSwapchainImages; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12372 | check_pSwapchainImages = (VkImage*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12373 | if (pSwapchainImages) |
| 12374 | { |
| 12375 | if (!(check_pSwapchainImages)) |
| 12376 | { |
| 12377 | fprintf(stderr, "fatal: pSwapchainImages inconsistent between guest and host\n"); |
| 12378 | } |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12379 | if ((*(pSwapchainImageCount))) |
| 12380 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12381 | uint64_t* cgen_var_829; |
| 12382 | stream->alloc((void**)&cgen_var_829, (*(pSwapchainImageCount)) * 8); |
| 12383 | stream->read((uint64_t*)cgen_var_829, (*(pSwapchainImageCount)) * 8); |
| 12384 | stream->handleMapping()->mapHandles_u64_VkImage(cgen_var_829, (VkImage*)pSwapchainImages, (*(pSwapchainImageCount))); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12385 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12386 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 12387 | AEMU_SCOPED_TRACE("vkGetSwapchainImagesKHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12388 | VkResult vkGetSwapchainImagesKHR_VkResult_return = (VkResult)0; |
| 12389 | stream->read(&vkGetSwapchainImagesKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12390 | countingStream->clearPool(); |
| 12391 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12392 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 12393 | mImpl->log("finish vkGetSwapchainImagesKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12394 | return vkGetSwapchainImagesKHR_VkResult_return; |
| 12395 | } |
| 12396 | |
| 12397 | VkResult VkEncoder::vkAcquireNextImageKHR( |
| 12398 | VkDevice device, |
| 12399 | VkSwapchainKHR swapchain, |
| 12400 | uint64_t timeout, |
| 12401 | VkSemaphore semaphore, |
| 12402 | VkFence fence, |
| 12403 | uint32_t* pImageIndex) |
| 12404 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 12405 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 12406 | AEMU_SCOPED_TRACE("vkAcquireNextImageKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 12407 | mImpl->log("start vkAcquireNextImageKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12408 | auto stream = mImpl->stream(); |
| 12409 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12410 | auto resources = mImpl->resources(); |
| 12411 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12412 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12413 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12414 | VkSwapchainKHR local_swapchain; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12415 | uint64_t local_timeout; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12416 | VkSemaphore local_semaphore; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12417 | VkFence local_fence; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 12418 | local_device = device; |
| 12419 | local_swapchain = swapchain; |
| 12420 | local_timeout = timeout; |
| 12421 | local_semaphore = semaphore; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12422 | local_fence = fence; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12423 | countingStream->rewind(); |
| 12424 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12425 | uint64_t cgen_var_830; |
| 12426 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_830, 1); |
| 12427 | countingStream->write((uint64_t*)&cgen_var_830, 1 * 8); |
| 12428 | uint64_t cgen_var_831; |
| 12429 | countingStream->handleMapping()->mapHandles_VkSwapchainKHR_u64(&local_swapchain, &cgen_var_831, 1); |
| 12430 | countingStream->write((uint64_t*)&cgen_var_831, 1 * 8); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 12431 | countingStream->write((uint64_t*)&local_timeout, sizeof(uint64_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12432 | uint64_t cgen_var_832; |
| 12433 | countingStream->handleMapping()->mapHandles_VkSemaphore_u64(&local_semaphore, &cgen_var_832, 1); |
| 12434 | countingStream->write((uint64_t*)&cgen_var_832, 1 * 8); |
| 12435 | uint64_t cgen_var_833; |
| 12436 | countingStream->handleMapping()->mapHandles_VkFence_u64(&local_fence, &cgen_var_833, 1); |
| 12437 | countingStream->write((uint64_t*)&cgen_var_833, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12438 | countingStream->write((uint32_t*)pImageIndex, sizeof(uint32_t)); |
| 12439 | } |
| 12440 | uint32_t packetSize_vkAcquireNextImageKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 12441 | countingStream->rewind(); |
| 12442 | uint32_t opcode_vkAcquireNextImageKHR = OP_vkAcquireNextImageKHR; |
| 12443 | stream->write(&opcode_vkAcquireNextImageKHR, sizeof(uint32_t)); |
| 12444 | stream->write(&packetSize_vkAcquireNextImageKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12445 | uint64_t cgen_var_834; |
| 12446 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_834, 1); |
| 12447 | stream->write((uint64_t*)&cgen_var_834, 1 * 8); |
| 12448 | uint64_t cgen_var_835; |
| 12449 | stream->handleMapping()->mapHandles_VkSwapchainKHR_u64(&local_swapchain, &cgen_var_835, 1); |
| 12450 | stream->write((uint64_t*)&cgen_var_835, 1 * 8); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 12451 | stream->write((uint64_t*)&local_timeout, sizeof(uint64_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12452 | uint64_t cgen_var_836; |
| 12453 | stream->handleMapping()->mapHandles_VkSemaphore_u64(&local_semaphore, &cgen_var_836, 1); |
| 12454 | stream->write((uint64_t*)&cgen_var_836, 1 * 8); |
| 12455 | uint64_t cgen_var_837; |
| 12456 | stream->handleMapping()->mapHandles_VkFence_u64(&local_fence, &cgen_var_837, 1); |
| 12457 | stream->write((uint64_t*)&cgen_var_837, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12458 | stream->write((uint32_t*)pImageIndex, sizeof(uint32_t)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 12459 | AEMU_SCOPED_TRACE("vkAcquireNextImageKHR readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12460 | stream->read((uint32_t*)pImageIndex, sizeof(uint32_t)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 12461 | AEMU_SCOPED_TRACE("vkAcquireNextImageKHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12462 | VkResult vkAcquireNextImageKHR_VkResult_return = (VkResult)0; |
| 12463 | stream->read(&vkAcquireNextImageKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12464 | countingStream->clearPool(); |
| 12465 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12466 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 12467 | mImpl->log("finish vkAcquireNextImageKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12468 | return vkAcquireNextImageKHR_VkResult_return; |
| 12469 | } |
| 12470 | |
| 12471 | VkResult VkEncoder::vkQueuePresentKHR( |
| 12472 | VkQueue queue, |
| 12473 | const VkPresentInfoKHR* pPresentInfo) |
| 12474 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 12475 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 12476 | AEMU_SCOPED_TRACE("vkQueuePresentKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 12477 | mImpl->log("start vkQueuePresentKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12478 | auto stream = mImpl->stream(); |
| 12479 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12480 | auto resources = mImpl->resources(); |
| 12481 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12482 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12483 | VkQueue local_queue; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12484 | VkPresentInfoKHR* local_pPresentInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 12485 | local_queue = queue; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12486 | local_pPresentInfo = nullptr; |
| 12487 | if (pPresentInfo) |
| 12488 | { |
| 12489 | local_pPresentInfo = (VkPresentInfoKHR*)pool->alloc(sizeof(const VkPresentInfoKHR)); |
| 12490 | deepcopy_VkPresentInfoKHR(pool, pPresentInfo, (VkPresentInfoKHR*)(local_pPresentInfo)); |
| 12491 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 12492 | if (local_pPresentInfo) |
| 12493 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 12494 | transform_tohost_VkPresentInfoKHR(mImpl->resources(), (VkPresentInfoKHR*)(local_pPresentInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 12495 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12496 | countingStream->rewind(); |
| 12497 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12498 | uint64_t cgen_var_838; |
| 12499 | countingStream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_838, 1); |
| 12500 | countingStream->write((uint64_t*)&cgen_var_838, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12501 | marshal_VkPresentInfoKHR(countingStream, (VkPresentInfoKHR*)(local_pPresentInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12502 | } |
| 12503 | uint32_t packetSize_vkQueuePresentKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 12504 | countingStream->rewind(); |
| 12505 | uint32_t opcode_vkQueuePresentKHR = OP_vkQueuePresentKHR; |
| 12506 | stream->write(&opcode_vkQueuePresentKHR, sizeof(uint32_t)); |
| 12507 | stream->write(&packetSize_vkQueuePresentKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12508 | uint64_t cgen_var_839; |
| 12509 | stream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_839, 1); |
| 12510 | stream->write((uint64_t*)&cgen_var_839, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12511 | marshal_VkPresentInfoKHR(stream, (VkPresentInfoKHR*)(local_pPresentInfo)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 12512 | AEMU_SCOPED_TRACE("vkQueuePresentKHR readParams"); |
| 12513 | AEMU_SCOPED_TRACE("vkQueuePresentKHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12514 | VkResult vkQueuePresentKHR_VkResult_return = (VkResult)0; |
| 12515 | stream->read(&vkQueuePresentKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12516 | countingStream->clearPool(); |
| 12517 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12518 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 12519 | mImpl->log("finish vkQueuePresentKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12520 | return vkQueuePresentKHR_VkResult_return; |
| 12521 | } |
| 12522 | |
| 12523 | VkResult VkEncoder::vkGetDeviceGroupPresentCapabilitiesKHR( |
| 12524 | VkDevice device, |
| 12525 | VkDeviceGroupPresentCapabilitiesKHR* pDeviceGroupPresentCapabilities) |
| 12526 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 12527 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 12528 | AEMU_SCOPED_TRACE("vkGetDeviceGroupPresentCapabilitiesKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 12529 | mImpl->log("start vkGetDeviceGroupPresentCapabilitiesKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12530 | auto stream = mImpl->stream(); |
| 12531 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12532 | auto resources = mImpl->resources(); |
| 12533 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12534 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12535 | VkDevice local_device; |
| 12536 | local_device = device; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12537 | countingStream->rewind(); |
| 12538 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12539 | uint64_t cgen_var_840; |
| 12540 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_840, 1); |
| 12541 | countingStream->write((uint64_t*)&cgen_var_840, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12542 | marshal_VkDeviceGroupPresentCapabilitiesKHR(countingStream, (VkDeviceGroupPresentCapabilitiesKHR*)(pDeviceGroupPresentCapabilities)); |
| 12543 | } |
| 12544 | uint32_t packetSize_vkGetDeviceGroupPresentCapabilitiesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 12545 | countingStream->rewind(); |
| 12546 | uint32_t opcode_vkGetDeviceGroupPresentCapabilitiesKHR = OP_vkGetDeviceGroupPresentCapabilitiesKHR; |
| 12547 | stream->write(&opcode_vkGetDeviceGroupPresentCapabilitiesKHR, sizeof(uint32_t)); |
| 12548 | stream->write(&packetSize_vkGetDeviceGroupPresentCapabilitiesKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12549 | uint64_t cgen_var_841; |
| 12550 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_841, 1); |
| 12551 | stream->write((uint64_t*)&cgen_var_841, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12552 | marshal_VkDeviceGroupPresentCapabilitiesKHR(stream, (VkDeviceGroupPresentCapabilitiesKHR*)(pDeviceGroupPresentCapabilities)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 12553 | AEMU_SCOPED_TRACE("vkGetDeviceGroupPresentCapabilitiesKHR readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12554 | unmarshal_VkDeviceGroupPresentCapabilitiesKHR(stream, (VkDeviceGroupPresentCapabilitiesKHR*)(pDeviceGroupPresentCapabilities)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 12555 | if (pDeviceGroupPresentCapabilities) |
| 12556 | { |
| 12557 | transform_fromhost_VkDeviceGroupPresentCapabilitiesKHR(mImpl->resources(), (VkDeviceGroupPresentCapabilitiesKHR*)(pDeviceGroupPresentCapabilities)); |
| 12558 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 12559 | AEMU_SCOPED_TRACE("vkGetDeviceGroupPresentCapabilitiesKHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12560 | VkResult vkGetDeviceGroupPresentCapabilitiesKHR_VkResult_return = (VkResult)0; |
| 12561 | stream->read(&vkGetDeviceGroupPresentCapabilitiesKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12562 | countingStream->clearPool(); |
| 12563 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12564 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 12565 | mImpl->log("finish vkGetDeviceGroupPresentCapabilitiesKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12566 | return vkGetDeviceGroupPresentCapabilitiesKHR_VkResult_return; |
| 12567 | } |
| 12568 | |
| 12569 | VkResult VkEncoder::vkGetDeviceGroupSurfacePresentModesKHR( |
| 12570 | VkDevice device, |
| 12571 | VkSurfaceKHR surface, |
| 12572 | VkDeviceGroupPresentModeFlagsKHR* pModes) |
| 12573 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 12574 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 12575 | AEMU_SCOPED_TRACE("vkGetDeviceGroupSurfacePresentModesKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 12576 | mImpl->log("start vkGetDeviceGroupSurfacePresentModesKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12577 | auto stream = mImpl->stream(); |
| 12578 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12579 | auto resources = mImpl->resources(); |
| 12580 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12581 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12582 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12583 | VkSurfaceKHR local_surface; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 12584 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12585 | local_surface = surface; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12586 | countingStream->rewind(); |
| 12587 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12588 | uint64_t cgen_var_842; |
| 12589 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_842, 1); |
| 12590 | countingStream->write((uint64_t*)&cgen_var_842, 1 * 8); |
| 12591 | uint64_t cgen_var_843; |
| 12592 | countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(&local_surface, &cgen_var_843, 1); |
| 12593 | countingStream->write((uint64_t*)&cgen_var_843, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12594 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12595 | uint64_t cgen_var_844 = (uint64_t)(uintptr_t)pModes; |
| 12596 | countingStream->putBe64(cgen_var_844); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12597 | if (pModes) |
| 12598 | { |
| 12599 | countingStream->write((VkDeviceGroupPresentModeFlagsKHR*)pModes, sizeof(VkDeviceGroupPresentModeFlagsKHR)); |
| 12600 | } |
| 12601 | } |
| 12602 | uint32_t packetSize_vkGetDeviceGroupSurfacePresentModesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 12603 | countingStream->rewind(); |
| 12604 | uint32_t opcode_vkGetDeviceGroupSurfacePresentModesKHR = OP_vkGetDeviceGroupSurfacePresentModesKHR; |
| 12605 | stream->write(&opcode_vkGetDeviceGroupSurfacePresentModesKHR, sizeof(uint32_t)); |
| 12606 | stream->write(&packetSize_vkGetDeviceGroupSurfacePresentModesKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12607 | uint64_t cgen_var_845; |
| 12608 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_845, 1); |
| 12609 | stream->write((uint64_t*)&cgen_var_845, 1 * 8); |
| 12610 | uint64_t cgen_var_846; |
| 12611 | stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(&local_surface, &cgen_var_846, 1); |
| 12612 | stream->write((uint64_t*)&cgen_var_846, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12613 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12614 | uint64_t cgen_var_847 = (uint64_t)(uintptr_t)pModes; |
| 12615 | stream->putBe64(cgen_var_847); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12616 | if (pModes) |
| 12617 | { |
| 12618 | stream->write((VkDeviceGroupPresentModeFlagsKHR*)pModes, sizeof(VkDeviceGroupPresentModeFlagsKHR)); |
| 12619 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 12620 | AEMU_SCOPED_TRACE("vkGetDeviceGroupSurfacePresentModesKHR readParams"); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12621 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12622 | VkDeviceGroupPresentModeFlagsKHR* check_pModes; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12623 | check_pModes = (VkDeviceGroupPresentModeFlagsKHR*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12624 | if (pModes) |
| 12625 | { |
| 12626 | if (!(check_pModes)) |
| 12627 | { |
| 12628 | fprintf(stderr, "fatal: pModes inconsistent between guest and host\n"); |
| 12629 | } |
| 12630 | stream->read((VkDeviceGroupPresentModeFlagsKHR*)pModes, sizeof(VkDeviceGroupPresentModeFlagsKHR)); |
| 12631 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 12632 | AEMU_SCOPED_TRACE("vkGetDeviceGroupSurfacePresentModesKHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12633 | VkResult vkGetDeviceGroupSurfacePresentModesKHR_VkResult_return = (VkResult)0; |
| 12634 | stream->read(&vkGetDeviceGroupSurfacePresentModesKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12635 | countingStream->clearPool(); |
| 12636 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12637 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 12638 | mImpl->log("finish vkGetDeviceGroupSurfacePresentModesKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12639 | return vkGetDeviceGroupSurfacePresentModesKHR_VkResult_return; |
| 12640 | } |
| 12641 | |
| 12642 | VkResult VkEncoder::vkGetPhysicalDevicePresentRectanglesKHR( |
| 12643 | VkPhysicalDevice physicalDevice, |
| 12644 | VkSurfaceKHR surface, |
| 12645 | uint32_t* pRectCount, |
| 12646 | VkRect2D* pRects) |
| 12647 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 12648 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 12649 | AEMU_SCOPED_TRACE("vkGetPhysicalDevicePresentRectanglesKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 12650 | mImpl->log("start vkGetPhysicalDevicePresentRectanglesKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12651 | auto stream = mImpl->stream(); |
| 12652 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12653 | auto resources = mImpl->resources(); |
| 12654 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12655 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12656 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12657 | VkSurfaceKHR local_surface; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 12658 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12659 | local_surface = surface; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12660 | countingStream->rewind(); |
| 12661 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12662 | uint64_t cgen_var_849; |
| 12663 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_849, 1); |
| 12664 | countingStream->write((uint64_t*)&cgen_var_849, 1 * 8); |
| 12665 | uint64_t cgen_var_850; |
| 12666 | countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(&local_surface, &cgen_var_850, 1); |
| 12667 | countingStream->write((uint64_t*)&cgen_var_850, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12668 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12669 | uint64_t cgen_var_851 = (uint64_t)(uintptr_t)pRectCount; |
| 12670 | countingStream->putBe64(cgen_var_851); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12671 | if (pRectCount) |
| 12672 | { |
| 12673 | countingStream->write((uint32_t*)pRectCount, sizeof(uint32_t)); |
| 12674 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12675 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12676 | uint64_t cgen_var_852 = (uint64_t)(uintptr_t)pRects; |
| 12677 | countingStream->putBe64(cgen_var_852); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12678 | if (pRects) |
| 12679 | { |
| 12680 | for (uint32_t i = 0; i < (uint32_t)(*(pRectCount)); ++i) |
| 12681 | { |
| 12682 | marshal_VkRect2D(countingStream, (VkRect2D*)(pRects + i)); |
| 12683 | } |
| 12684 | } |
| 12685 | } |
| 12686 | uint32_t packetSize_vkGetPhysicalDevicePresentRectanglesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 12687 | countingStream->rewind(); |
| 12688 | uint32_t opcode_vkGetPhysicalDevicePresentRectanglesKHR = OP_vkGetPhysicalDevicePresentRectanglesKHR; |
| 12689 | stream->write(&opcode_vkGetPhysicalDevicePresentRectanglesKHR, sizeof(uint32_t)); |
| 12690 | stream->write(&packetSize_vkGetPhysicalDevicePresentRectanglesKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12691 | uint64_t cgen_var_853; |
| 12692 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_853, 1); |
| 12693 | stream->write((uint64_t*)&cgen_var_853, 1 * 8); |
| 12694 | uint64_t cgen_var_854; |
| 12695 | stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(&local_surface, &cgen_var_854, 1); |
| 12696 | stream->write((uint64_t*)&cgen_var_854, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12697 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12698 | uint64_t cgen_var_855 = (uint64_t)(uintptr_t)pRectCount; |
| 12699 | stream->putBe64(cgen_var_855); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12700 | if (pRectCount) |
| 12701 | { |
| 12702 | stream->write((uint32_t*)pRectCount, sizeof(uint32_t)); |
| 12703 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12704 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12705 | uint64_t cgen_var_856 = (uint64_t)(uintptr_t)pRects; |
| 12706 | stream->putBe64(cgen_var_856); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12707 | if (pRects) |
| 12708 | { |
| 12709 | for (uint32_t i = 0; i < (uint32_t)(*(pRectCount)); ++i) |
| 12710 | { |
| 12711 | marshal_VkRect2D(stream, (VkRect2D*)(pRects + i)); |
| 12712 | } |
| 12713 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 12714 | AEMU_SCOPED_TRACE("vkGetPhysicalDevicePresentRectanglesKHR readParams"); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12715 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12716 | uint32_t* check_pRectCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12717 | check_pRectCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12718 | if (pRectCount) |
| 12719 | { |
| 12720 | if (!(check_pRectCount)) |
| 12721 | { |
| 12722 | fprintf(stderr, "fatal: pRectCount inconsistent between guest and host\n"); |
| 12723 | } |
| 12724 | stream->read((uint32_t*)pRectCount, sizeof(uint32_t)); |
| 12725 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12726 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12727 | VkRect2D* check_pRects; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12728 | check_pRects = (VkRect2D*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12729 | if (pRects) |
| 12730 | { |
| 12731 | if (!(check_pRects)) |
| 12732 | { |
| 12733 | fprintf(stderr, "fatal: pRects inconsistent between guest and host\n"); |
| 12734 | } |
| 12735 | for (uint32_t i = 0; i < (uint32_t)(*(pRectCount)); ++i) |
| 12736 | { |
| 12737 | unmarshal_VkRect2D(stream, (VkRect2D*)(pRects + i)); |
| 12738 | } |
| 12739 | } |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 12740 | if (pRects) |
| 12741 | { |
| 12742 | for (uint32_t i = 0; i < (uint32_t)(*(pRectCount)); ++i) |
| 12743 | { |
| 12744 | transform_fromhost_VkRect2D(mImpl->resources(), (VkRect2D*)(pRects + i)); |
| 12745 | } |
| 12746 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 12747 | AEMU_SCOPED_TRACE("vkGetPhysicalDevicePresentRectanglesKHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12748 | VkResult vkGetPhysicalDevicePresentRectanglesKHR_VkResult_return = (VkResult)0; |
| 12749 | stream->read(&vkGetPhysicalDevicePresentRectanglesKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12750 | countingStream->clearPool(); |
| 12751 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12752 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 12753 | mImpl->log("finish vkGetPhysicalDevicePresentRectanglesKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12754 | return vkGetPhysicalDevicePresentRectanglesKHR_VkResult_return; |
| 12755 | } |
| 12756 | |
| 12757 | VkResult VkEncoder::vkAcquireNextImage2KHR( |
| 12758 | VkDevice device, |
| 12759 | const VkAcquireNextImageInfoKHR* pAcquireInfo, |
| 12760 | uint32_t* pImageIndex) |
| 12761 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 12762 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 12763 | AEMU_SCOPED_TRACE("vkAcquireNextImage2KHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 12764 | mImpl->log("start vkAcquireNextImage2KHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12765 | auto stream = mImpl->stream(); |
| 12766 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12767 | auto resources = mImpl->resources(); |
| 12768 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12769 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12770 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12771 | VkAcquireNextImageInfoKHR* local_pAcquireInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 12772 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12773 | local_pAcquireInfo = nullptr; |
| 12774 | if (pAcquireInfo) |
| 12775 | { |
| 12776 | local_pAcquireInfo = (VkAcquireNextImageInfoKHR*)pool->alloc(sizeof(const VkAcquireNextImageInfoKHR)); |
| 12777 | deepcopy_VkAcquireNextImageInfoKHR(pool, pAcquireInfo, (VkAcquireNextImageInfoKHR*)(local_pAcquireInfo)); |
| 12778 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 12779 | if (local_pAcquireInfo) |
| 12780 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 12781 | transform_tohost_VkAcquireNextImageInfoKHR(mImpl->resources(), (VkAcquireNextImageInfoKHR*)(local_pAcquireInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 12782 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12783 | countingStream->rewind(); |
| 12784 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12785 | uint64_t cgen_var_859; |
| 12786 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_859, 1); |
| 12787 | countingStream->write((uint64_t*)&cgen_var_859, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12788 | marshal_VkAcquireNextImageInfoKHR(countingStream, (VkAcquireNextImageInfoKHR*)(local_pAcquireInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12789 | countingStream->write((uint32_t*)pImageIndex, sizeof(uint32_t)); |
| 12790 | } |
| 12791 | uint32_t packetSize_vkAcquireNextImage2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 12792 | countingStream->rewind(); |
| 12793 | uint32_t opcode_vkAcquireNextImage2KHR = OP_vkAcquireNextImage2KHR; |
| 12794 | stream->write(&opcode_vkAcquireNextImage2KHR, sizeof(uint32_t)); |
| 12795 | stream->write(&packetSize_vkAcquireNextImage2KHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12796 | uint64_t cgen_var_860; |
| 12797 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_860, 1); |
| 12798 | stream->write((uint64_t*)&cgen_var_860, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12799 | marshal_VkAcquireNextImageInfoKHR(stream, (VkAcquireNextImageInfoKHR*)(local_pAcquireInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12800 | stream->write((uint32_t*)pImageIndex, sizeof(uint32_t)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 12801 | AEMU_SCOPED_TRACE("vkAcquireNextImage2KHR readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12802 | stream->read((uint32_t*)pImageIndex, sizeof(uint32_t)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 12803 | AEMU_SCOPED_TRACE("vkAcquireNextImage2KHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12804 | VkResult vkAcquireNextImage2KHR_VkResult_return = (VkResult)0; |
| 12805 | stream->read(&vkAcquireNextImage2KHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12806 | countingStream->clearPool(); |
| 12807 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12808 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 12809 | mImpl->log("finish vkAcquireNextImage2KHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12810 | return vkAcquireNextImage2KHR_VkResult_return; |
| 12811 | } |
| 12812 | |
| 12813 | #endif |
| 12814 | #ifdef VK_KHR_display |
| 12815 | VkResult VkEncoder::vkGetPhysicalDeviceDisplayPropertiesKHR( |
| 12816 | VkPhysicalDevice physicalDevice, |
| 12817 | uint32_t* pPropertyCount, |
| 12818 | VkDisplayPropertiesKHR* pProperties) |
| 12819 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 12820 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 12821 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceDisplayPropertiesKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 12822 | mImpl->log("start vkGetPhysicalDeviceDisplayPropertiesKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12823 | auto stream = mImpl->stream(); |
| 12824 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12825 | auto resources = mImpl->resources(); |
| 12826 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12827 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12828 | VkPhysicalDevice local_physicalDevice; |
| 12829 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12830 | countingStream->rewind(); |
| 12831 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12832 | uint64_t cgen_var_861; |
| 12833 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_861, 1); |
| 12834 | countingStream->write((uint64_t*)&cgen_var_861, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12835 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12836 | uint64_t cgen_var_862 = (uint64_t)(uintptr_t)pPropertyCount; |
| 12837 | countingStream->putBe64(cgen_var_862); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12838 | if (pPropertyCount) |
| 12839 | { |
| 12840 | countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 12841 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12842 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12843 | uint64_t cgen_var_863 = (uint64_t)(uintptr_t)pProperties; |
| 12844 | countingStream->putBe64(cgen_var_863); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12845 | if (pProperties) |
| 12846 | { |
| 12847 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 12848 | { |
| 12849 | marshal_VkDisplayPropertiesKHR(countingStream, (VkDisplayPropertiesKHR*)(pProperties + i)); |
| 12850 | } |
| 12851 | } |
| 12852 | } |
| 12853 | uint32_t packetSize_vkGetPhysicalDeviceDisplayPropertiesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 12854 | countingStream->rewind(); |
| 12855 | uint32_t opcode_vkGetPhysicalDeviceDisplayPropertiesKHR = OP_vkGetPhysicalDeviceDisplayPropertiesKHR; |
| 12856 | stream->write(&opcode_vkGetPhysicalDeviceDisplayPropertiesKHR, sizeof(uint32_t)); |
| 12857 | stream->write(&packetSize_vkGetPhysicalDeviceDisplayPropertiesKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12858 | uint64_t cgen_var_864; |
| 12859 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_864, 1); |
| 12860 | stream->write((uint64_t*)&cgen_var_864, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12861 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12862 | uint64_t cgen_var_865 = (uint64_t)(uintptr_t)pPropertyCount; |
| 12863 | stream->putBe64(cgen_var_865); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12864 | if (pPropertyCount) |
| 12865 | { |
| 12866 | stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 12867 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12868 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12869 | uint64_t cgen_var_866 = (uint64_t)(uintptr_t)pProperties; |
| 12870 | stream->putBe64(cgen_var_866); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12871 | if (pProperties) |
| 12872 | { |
| 12873 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 12874 | { |
| 12875 | marshal_VkDisplayPropertiesKHR(stream, (VkDisplayPropertiesKHR*)(pProperties + i)); |
| 12876 | } |
| 12877 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 12878 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceDisplayPropertiesKHR readParams"); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12879 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12880 | uint32_t* check_pPropertyCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12881 | check_pPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12882 | if (pPropertyCount) |
| 12883 | { |
| 12884 | if (!(check_pPropertyCount)) |
| 12885 | { |
| 12886 | fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n"); |
| 12887 | } |
| 12888 | stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 12889 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12890 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12891 | VkDisplayPropertiesKHR* check_pProperties; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12892 | check_pProperties = (VkDisplayPropertiesKHR*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12893 | if (pProperties) |
| 12894 | { |
| 12895 | if (!(check_pProperties)) |
| 12896 | { |
| 12897 | fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n"); |
| 12898 | } |
| 12899 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 12900 | { |
| 12901 | unmarshal_VkDisplayPropertiesKHR(stream, (VkDisplayPropertiesKHR*)(pProperties + i)); |
| 12902 | } |
| 12903 | } |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 12904 | if (pProperties) |
| 12905 | { |
| 12906 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 12907 | { |
| 12908 | transform_fromhost_VkDisplayPropertiesKHR(mImpl->resources(), (VkDisplayPropertiesKHR*)(pProperties + i)); |
| 12909 | } |
| 12910 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 12911 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceDisplayPropertiesKHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12912 | VkResult vkGetPhysicalDeviceDisplayPropertiesKHR_VkResult_return = (VkResult)0; |
| 12913 | stream->read(&vkGetPhysicalDeviceDisplayPropertiesKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12914 | countingStream->clearPool(); |
| 12915 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12916 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 12917 | mImpl->log("finish vkGetPhysicalDeviceDisplayPropertiesKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12918 | return vkGetPhysicalDeviceDisplayPropertiesKHR_VkResult_return; |
| 12919 | } |
| 12920 | |
| 12921 | VkResult VkEncoder::vkGetPhysicalDeviceDisplayPlanePropertiesKHR( |
| 12922 | VkPhysicalDevice physicalDevice, |
| 12923 | uint32_t* pPropertyCount, |
| 12924 | VkDisplayPlanePropertiesKHR* pProperties) |
| 12925 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 12926 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 12927 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceDisplayPlanePropertiesKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 12928 | mImpl->log("start vkGetPhysicalDeviceDisplayPlanePropertiesKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12929 | auto stream = mImpl->stream(); |
| 12930 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12931 | auto resources = mImpl->resources(); |
| 12932 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12933 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12934 | VkPhysicalDevice local_physicalDevice; |
| 12935 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12936 | countingStream->rewind(); |
| 12937 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12938 | uint64_t cgen_var_869; |
| 12939 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_869, 1); |
| 12940 | countingStream->write((uint64_t*)&cgen_var_869, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12941 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12942 | uint64_t cgen_var_870 = (uint64_t)(uintptr_t)pPropertyCount; |
| 12943 | countingStream->putBe64(cgen_var_870); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12944 | if (pPropertyCount) |
| 12945 | { |
| 12946 | countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 12947 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12948 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12949 | uint64_t cgen_var_871 = (uint64_t)(uintptr_t)pProperties; |
| 12950 | countingStream->putBe64(cgen_var_871); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12951 | if (pProperties) |
| 12952 | { |
| 12953 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 12954 | { |
| 12955 | marshal_VkDisplayPlanePropertiesKHR(countingStream, (VkDisplayPlanePropertiesKHR*)(pProperties + i)); |
| 12956 | } |
| 12957 | } |
| 12958 | } |
| 12959 | uint32_t packetSize_vkGetPhysicalDeviceDisplayPlanePropertiesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 12960 | countingStream->rewind(); |
| 12961 | uint32_t opcode_vkGetPhysicalDeviceDisplayPlanePropertiesKHR = OP_vkGetPhysicalDeviceDisplayPlanePropertiesKHR; |
| 12962 | stream->write(&opcode_vkGetPhysicalDeviceDisplayPlanePropertiesKHR, sizeof(uint32_t)); |
| 12963 | stream->write(&packetSize_vkGetPhysicalDeviceDisplayPlanePropertiesKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12964 | uint64_t cgen_var_872; |
| 12965 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_872, 1); |
| 12966 | stream->write((uint64_t*)&cgen_var_872, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12967 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12968 | uint64_t cgen_var_873 = (uint64_t)(uintptr_t)pPropertyCount; |
| 12969 | stream->putBe64(cgen_var_873); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12970 | if (pPropertyCount) |
| 12971 | { |
| 12972 | stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 12973 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12974 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12975 | uint64_t cgen_var_874 = (uint64_t)(uintptr_t)pProperties; |
| 12976 | stream->putBe64(cgen_var_874); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12977 | if (pProperties) |
| 12978 | { |
| 12979 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 12980 | { |
| 12981 | marshal_VkDisplayPlanePropertiesKHR(stream, (VkDisplayPlanePropertiesKHR*)(pProperties + i)); |
| 12982 | } |
| 12983 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 12984 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceDisplayPlanePropertiesKHR readParams"); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12985 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12986 | uint32_t* check_pPropertyCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12987 | check_pPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12988 | if (pPropertyCount) |
| 12989 | { |
| 12990 | if (!(check_pPropertyCount)) |
| 12991 | { |
| 12992 | fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n"); |
| 12993 | } |
| 12994 | stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 12995 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12996 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12997 | VkDisplayPlanePropertiesKHR* check_pProperties; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12998 | check_pProperties = (VkDisplayPlanePropertiesKHR*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12999 | if (pProperties) |
| 13000 | { |
| 13001 | if (!(check_pProperties)) |
| 13002 | { |
| 13003 | fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n"); |
| 13004 | } |
| 13005 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 13006 | { |
| 13007 | unmarshal_VkDisplayPlanePropertiesKHR(stream, (VkDisplayPlanePropertiesKHR*)(pProperties + i)); |
| 13008 | } |
| 13009 | } |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 13010 | if (pProperties) |
| 13011 | { |
| 13012 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 13013 | { |
| 13014 | transform_fromhost_VkDisplayPlanePropertiesKHR(mImpl->resources(), (VkDisplayPlanePropertiesKHR*)(pProperties + i)); |
| 13015 | } |
| 13016 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 13017 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceDisplayPlanePropertiesKHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13018 | VkResult vkGetPhysicalDeviceDisplayPlanePropertiesKHR_VkResult_return = (VkResult)0; |
| 13019 | stream->read(&vkGetPhysicalDeviceDisplayPlanePropertiesKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13020 | countingStream->clearPool(); |
| 13021 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13022 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 13023 | mImpl->log("finish vkGetPhysicalDeviceDisplayPlanePropertiesKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13024 | return vkGetPhysicalDeviceDisplayPlanePropertiesKHR_VkResult_return; |
| 13025 | } |
| 13026 | |
| 13027 | VkResult VkEncoder::vkGetDisplayPlaneSupportedDisplaysKHR( |
| 13028 | VkPhysicalDevice physicalDevice, |
| 13029 | uint32_t planeIndex, |
| 13030 | uint32_t* pDisplayCount, |
| 13031 | VkDisplayKHR* pDisplays) |
| 13032 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 13033 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 13034 | AEMU_SCOPED_TRACE("vkGetDisplayPlaneSupportedDisplaysKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 13035 | mImpl->log("start vkGetDisplayPlaneSupportedDisplaysKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13036 | auto stream = mImpl->stream(); |
| 13037 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13038 | auto resources = mImpl->resources(); |
| 13039 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13040 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13041 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13042 | uint32_t local_planeIndex; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 13043 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13044 | local_planeIndex = planeIndex; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13045 | countingStream->rewind(); |
| 13046 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13047 | uint64_t cgen_var_877; |
| 13048 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_877, 1); |
| 13049 | countingStream->write((uint64_t*)&cgen_var_877, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13050 | countingStream->write((uint32_t*)&local_planeIndex, sizeof(uint32_t)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13051 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13052 | uint64_t cgen_var_878 = (uint64_t)(uintptr_t)pDisplayCount; |
| 13053 | countingStream->putBe64(cgen_var_878); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13054 | if (pDisplayCount) |
| 13055 | { |
| 13056 | countingStream->write((uint32_t*)pDisplayCount, sizeof(uint32_t)); |
| 13057 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13058 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13059 | uint64_t cgen_var_879 = (uint64_t)(uintptr_t)pDisplays; |
| 13060 | countingStream->putBe64(cgen_var_879); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13061 | if (pDisplays) |
| 13062 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13063 | if ((*(pDisplayCount))) |
| 13064 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13065 | uint64_t* cgen_var_880; |
| 13066 | countingStream->alloc((void**)&cgen_var_880, (*(pDisplayCount)) * 8); |
| 13067 | countingStream->handleMapping()->mapHandles_VkDisplayKHR_u64(pDisplays, cgen_var_880, (*(pDisplayCount))); |
| 13068 | countingStream->write((uint64_t*)cgen_var_880, (*(pDisplayCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13069 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13070 | } |
| 13071 | } |
| 13072 | uint32_t packetSize_vkGetDisplayPlaneSupportedDisplaysKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 13073 | countingStream->rewind(); |
| 13074 | uint32_t opcode_vkGetDisplayPlaneSupportedDisplaysKHR = OP_vkGetDisplayPlaneSupportedDisplaysKHR; |
| 13075 | stream->write(&opcode_vkGetDisplayPlaneSupportedDisplaysKHR, sizeof(uint32_t)); |
| 13076 | stream->write(&packetSize_vkGetDisplayPlaneSupportedDisplaysKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13077 | uint64_t cgen_var_881; |
| 13078 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_881, 1); |
| 13079 | stream->write((uint64_t*)&cgen_var_881, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13080 | stream->write((uint32_t*)&local_planeIndex, sizeof(uint32_t)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13081 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13082 | uint64_t cgen_var_882 = (uint64_t)(uintptr_t)pDisplayCount; |
| 13083 | stream->putBe64(cgen_var_882); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13084 | if (pDisplayCount) |
| 13085 | { |
| 13086 | stream->write((uint32_t*)pDisplayCount, sizeof(uint32_t)); |
| 13087 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13088 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13089 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13090 | uint64_t cgen_var_883 = (uint64_t)(uintptr_t)pDisplays; |
| 13091 | stream->putBe64(cgen_var_883); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13092 | if (pDisplays) |
| 13093 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13094 | if ((*(pDisplayCount))) |
| 13095 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13096 | uint64_t* cgen_var_884; |
| 13097 | stream->alloc((void**)&cgen_var_884, (*(pDisplayCount)) * 8); |
| 13098 | stream->handleMapping()->mapHandles_VkDisplayKHR_u64(pDisplays, cgen_var_884, (*(pDisplayCount))); |
| 13099 | stream->write((uint64_t*)cgen_var_884, (*(pDisplayCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13100 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13101 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13102 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 13103 | AEMU_SCOPED_TRACE("vkGetDisplayPlaneSupportedDisplaysKHR readParams"); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13104 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13105 | uint32_t* check_pDisplayCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13106 | check_pDisplayCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13107 | if (pDisplayCount) |
| 13108 | { |
| 13109 | if (!(check_pDisplayCount)) |
| 13110 | { |
| 13111 | fprintf(stderr, "fatal: pDisplayCount inconsistent between guest and host\n"); |
| 13112 | } |
| 13113 | stream->read((uint32_t*)pDisplayCount, sizeof(uint32_t)); |
| 13114 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13115 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13116 | VkDisplayKHR* check_pDisplays; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13117 | check_pDisplays = (VkDisplayKHR*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13118 | if (pDisplays) |
| 13119 | { |
| 13120 | if (!(check_pDisplays)) |
| 13121 | { |
| 13122 | fprintf(stderr, "fatal: pDisplays inconsistent between guest and host\n"); |
| 13123 | } |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13124 | if ((*(pDisplayCount))) |
| 13125 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13126 | uint64_t* cgen_var_887; |
| 13127 | stream->alloc((void**)&cgen_var_887, (*(pDisplayCount)) * 8); |
| 13128 | stream->read((uint64_t*)cgen_var_887, (*(pDisplayCount)) * 8); |
| 13129 | stream->handleMapping()->mapHandles_u64_VkDisplayKHR(cgen_var_887, (VkDisplayKHR*)pDisplays, (*(pDisplayCount))); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13130 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13131 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 13132 | AEMU_SCOPED_TRACE("vkGetDisplayPlaneSupportedDisplaysKHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13133 | VkResult vkGetDisplayPlaneSupportedDisplaysKHR_VkResult_return = (VkResult)0; |
| 13134 | stream->read(&vkGetDisplayPlaneSupportedDisplaysKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13135 | countingStream->clearPool(); |
| 13136 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13137 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 13138 | mImpl->log("finish vkGetDisplayPlaneSupportedDisplaysKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13139 | return vkGetDisplayPlaneSupportedDisplaysKHR_VkResult_return; |
| 13140 | } |
| 13141 | |
| 13142 | VkResult VkEncoder::vkGetDisplayModePropertiesKHR( |
| 13143 | VkPhysicalDevice physicalDevice, |
| 13144 | VkDisplayKHR display, |
| 13145 | uint32_t* pPropertyCount, |
| 13146 | VkDisplayModePropertiesKHR* pProperties) |
| 13147 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 13148 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 13149 | AEMU_SCOPED_TRACE("vkGetDisplayModePropertiesKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 13150 | mImpl->log("start vkGetDisplayModePropertiesKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13151 | auto stream = mImpl->stream(); |
| 13152 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13153 | auto resources = mImpl->resources(); |
| 13154 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13155 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13156 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13157 | VkDisplayKHR local_display; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 13158 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13159 | local_display = display; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13160 | countingStream->rewind(); |
| 13161 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13162 | uint64_t cgen_var_888; |
| 13163 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_888, 1); |
| 13164 | countingStream->write((uint64_t*)&cgen_var_888, 1 * 8); |
| 13165 | uint64_t cgen_var_889; |
| 13166 | countingStream->handleMapping()->mapHandles_VkDisplayKHR_u64(&local_display, &cgen_var_889, 1); |
| 13167 | countingStream->write((uint64_t*)&cgen_var_889, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13168 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13169 | uint64_t cgen_var_890 = (uint64_t)(uintptr_t)pPropertyCount; |
| 13170 | countingStream->putBe64(cgen_var_890); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13171 | if (pPropertyCount) |
| 13172 | { |
| 13173 | countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 13174 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13175 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13176 | uint64_t cgen_var_891 = (uint64_t)(uintptr_t)pProperties; |
| 13177 | countingStream->putBe64(cgen_var_891); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13178 | if (pProperties) |
| 13179 | { |
| 13180 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 13181 | { |
| 13182 | marshal_VkDisplayModePropertiesKHR(countingStream, (VkDisplayModePropertiesKHR*)(pProperties + i)); |
| 13183 | } |
| 13184 | } |
| 13185 | } |
| 13186 | uint32_t packetSize_vkGetDisplayModePropertiesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 13187 | countingStream->rewind(); |
| 13188 | uint32_t opcode_vkGetDisplayModePropertiesKHR = OP_vkGetDisplayModePropertiesKHR; |
| 13189 | stream->write(&opcode_vkGetDisplayModePropertiesKHR, sizeof(uint32_t)); |
| 13190 | stream->write(&packetSize_vkGetDisplayModePropertiesKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13191 | uint64_t cgen_var_892; |
| 13192 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_892, 1); |
| 13193 | stream->write((uint64_t*)&cgen_var_892, 1 * 8); |
| 13194 | uint64_t cgen_var_893; |
| 13195 | stream->handleMapping()->mapHandles_VkDisplayKHR_u64(&local_display, &cgen_var_893, 1); |
| 13196 | stream->write((uint64_t*)&cgen_var_893, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13197 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13198 | uint64_t cgen_var_894 = (uint64_t)(uintptr_t)pPropertyCount; |
| 13199 | stream->putBe64(cgen_var_894); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13200 | if (pPropertyCount) |
| 13201 | { |
| 13202 | stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 13203 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13204 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13205 | uint64_t cgen_var_895 = (uint64_t)(uintptr_t)pProperties; |
| 13206 | stream->putBe64(cgen_var_895); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13207 | if (pProperties) |
| 13208 | { |
| 13209 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 13210 | { |
| 13211 | marshal_VkDisplayModePropertiesKHR(stream, (VkDisplayModePropertiesKHR*)(pProperties + i)); |
| 13212 | } |
| 13213 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 13214 | AEMU_SCOPED_TRACE("vkGetDisplayModePropertiesKHR readParams"); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13215 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13216 | uint32_t* check_pPropertyCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13217 | check_pPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13218 | if (pPropertyCount) |
| 13219 | { |
| 13220 | if (!(check_pPropertyCount)) |
| 13221 | { |
| 13222 | fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n"); |
| 13223 | } |
| 13224 | stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 13225 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13226 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13227 | VkDisplayModePropertiesKHR* check_pProperties; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13228 | check_pProperties = (VkDisplayModePropertiesKHR*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13229 | if (pProperties) |
| 13230 | { |
| 13231 | if (!(check_pProperties)) |
| 13232 | { |
| 13233 | fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n"); |
| 13234 | } |
| 13235 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 13236 | { |
| 13237 | unmarshal_VkDisplayModePropertiesKHR(stream, (VkDisplayModePropertiesKHR*)(pProperties + i)); |
| 13238 | } |
| 13239 | } |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 13240 | if (pProperties) |
| 13241 | { |
| 13242 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 13243 | { |
| 13244 | transform_fromhost_VkDisplayModePropertiesKHR(mImpl->resources(), (VkDisplayModePropertiesKHR*)(pProperties + i)); |
| 13245 | } |
| 13246 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 13247 | AEMU_SCOPED_TRACE("vkGetDisplayModePropertiesKHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13248 | VkResult vkGetDisplayModePropertiesKHR_VkResult_return = (VkResult)0; |
| 13249 | stream->read(&vkGetDisplayModePropertiesKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13250 | countingStream->clearPool(); |
| 13251 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13252 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 13253 | mImpl->log("finish vkGetDisplayModePropertiesKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13254 | return vkGetDisplayModePropertiesKHR_VkResult_return; |
| 13255 | } |
| 13256 | |
| 13257 | VkResult VkEncoder::vkCreateDisplayModeKHR( |
| 13258 | VkPhysicalDevice physicalDevice, |
| 13259 | VkDisplayKHR display, |
| 13260 | const VkDisplayModeCreateInfoKHR* pCreateInfo, |
| 13261 | const VkAllocationCallbacks* pAllocator, |
| 13262 | VkDisplayModeKHR* pMode) |
| 13263 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 13264 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 13265 | AEMU_SCOPED_TRACE("vkCreateDisplayModeKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 13266 | mImpl->log("start vkCreateDisplayModeKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13267 | auto stream = mImpl->stream(); |
| 13268 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13269 | auto resources = mImpl->resources(); |
| 13270 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13271 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13272 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13273 | VkDisplayKHR local_display; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13274 | VkDisplayModeCreateInfoKHR* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 13275 | VkAllocationCallbacks* local_pAllocator; |
| 13276 | local_physicalDevice = physicalDevice; |
| 13277 | local_display = display; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13278 | local_pCreateInfo = nullptr; |
| 13279 | if (pCreateInfo) |
| 13280 | { |
| 13281 | local_pCreateInfo = (VkDisplayModeCreateInfoKHR*)pool->alloc(sizeof(const VkDisplayModeCreateInfoKHR)); |
| 13282 | deepcopy_VkDisplayModeCreateInfoKHR(pool, pCreateInfo, (VkDisplayModeCreateInfoKHR*)(local_pCreateInfo)); |
| 13283 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13284 | local_pAllocator = nullptr; |
| 13285 | if (pAllocator) |
| 13286 | { |
| 13287 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 13288 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 13289 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 13290 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 13291 | if (local_pCreateInfo) |
| 13292 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 13293 | transform_tohost_VkDisplayModeCreateInfoKHR(mImpl->resources(), (VkDisplayModeCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 13294 | } |
| 13295 | if (local_pAllocator) |
| 13296 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 13297 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 13298 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13299 | countingStream->rewind(); |
| 13300 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13301 | uint64_t cgen_var_898; |
| 13302 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_898, 1); |
| 13303 | countingStream->write((uint64_t*)&cgen_var_898, 1 * 8); |
| 13304 | uint64_t cgen_var_899; |
| 13305 | countingStream->handleMapping()->mapHandles_VkDisplayKHR_u64(&local_display, &cgen_var_899, 1); |
| 13306 | countingStream->write((uint64_t*)&cgen_var_899, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13307 | marshal_VkDisplayModeCreateInfoKHR(countingStream, (VkDisplayModeCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13308 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13309 | uint64_t cgen_var_900 = (uint64_t)(uintptr_t)local_pAllocator; |
| 13310 | countingStream->putBe64(cgen_var_900); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13311 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13312 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13313 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13314 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13315 | uint64_t cgen_var_901; |
| 13316 | countingStream->handleMapping()->mapHandles_VkDisplayModeKHR_u64(pMode, &cgen_var_901, 1); |
| 13317 | countingStream->write((uint64_t*)&cgen_var_901, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13318 | } |
| 13319 | uint32_t packetSize_vkCreateDisplayModeKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 13320 | countingStream->rewind(); |
| 13321 | uint32_t opcode_vkCreateDisplayModeKHR = OP_vkCreateDisplayModeKHR; |
| 13322 | stream->write(&opcode_vkCreateDisplayModeKHR, sizeof(uint32_t)); |
| 13323 | stream->write(&packetSize_vkCreateDisplayModeKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13324 | uint64_t cgen_var_902; |
| 13325 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_902, 1); |
| 13326 | stream->write((uint64_t*)&cgen_var_902, 1 * 8); |
| 13327 | uint64_t cgen_var_903; |
| 13328 | stream->handleMapping()->mapHandles_VkDisplayKHR_u64(&local_display, &cgen_var_903, 1); |
| 13329 | stream->write((uint64_t*)&cgen_var_903, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13330 | marshal_VkDisplayModeCreateInfoKHR(stream, (VkDisplayModeCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13331 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13332 | uint64_t cgen_var_904 = (uint64_t)(uintptr_t)local_pAllocator; |
| 13333 | stream->putBe64(cgen_var_904); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13334 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13335 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13336 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13337 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13338 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13339 | uint64_t cgen_var_905; |
| 13340 | stream->handleMapping()->mapHandles_VkDisplayModeKHR_u64(pMode, &cgen_var_905, 1); |
| 13341 | stream->write((uint64_t*)&cgen_var_905, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13342 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 13343 | AEMU_SCOPED_TRACE("vkCreateDisplayModeKHR readParams"); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13344 | stream->setHandleMapping(resources->createMapping()); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13345 | uint64_t cgen_var_906; |
| 13346 | stream->read((uint64_t*)&cgen_var_906, 8); |
| 13347 | stream->handleMapping()->mapHandles_u64_VkDisplayModeKHR(&cgen_var_906, (VkDisplayModeKHR*)pMode, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13348 | stream->unsetHandleMapping(); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 13349 | AEMU_SCOPED_TRACE("vkCreateDisplayModeKHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13350 | VkResult vkCreateDisplayModeKHR_VkResult_return = (VkResult)0; |
| 13351 | stream->read(&vkCreateDisplayModeKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13352 | countingStream->clearPool(); |
| 13353 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13354 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 13355 | mImpl->log("finish vkCreateDisplayModeKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13356 | return vkCreateDisplayModeKHR_VkResult_return; |
| 13357 | } |
| 13358 | |
| 13359 | VkResult VkEncoder::vkGetDisplayPlaneCapabilitiesKHR( |
| 13360 | VkPhysicalDevice physicalDevice, |
| 13361 | VkDisplayModeKHR mode, |
| 13362 | uint32_t planeIndex, |
| 13363 | VkDisplayPlaneCapabilitiesKHR* pCapabilities) |
| 13364 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 13365 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 13366 | AEMU_SCOPED_TRACE("vkGetDisplayPlaneCapabilitiesKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 13367 | mImpl->log("start vkGetDisplayPlaneCapabilitiesKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13368 | auto stream = mImpl->stream(); |
| 13369 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13370 | auto resources = mImpl->resources(); |
| 13371 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13372 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13373 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13374 | VkDisplayModeKHR local_mode; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13375 | uint32_t local_planeIndex; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 13376 | local_physicalDevice = physicalDevice; |
| 13377 | local_mode = mode; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13378 | local_planeIndex = planeIndex; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13379 | countingStream->rewind(); |
| 13380 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13381 | uint64_t cgen_var_907; |
| 13382 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_907, 1); |
| 13383 | countingStream->write((uint64_t*)&cgen_var_907, 1 * 8); |
| 13384 | uint64_t cgen_var_908; |
| 13385 | countingStream->handleMapping()->mapHandles_VkDisplayModeKHR_u64(&local_mode, &cgen_var_908, 1); |
| 13386 | countingStream->write((uint64_t*)&cgen_var_908, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13387 | countingStream->write((uint32_t*)&local_planeIndex, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13388 | marshal_VkDisplayPlaneCapabilitiesKHR(countingStream, (VkDisplayPlaneCapabilitiesKHR*)(pCapabilities)); |
| 13389 | } |
| 13390 | uint32_t packetSize_vkGetDisplayPlaneCapabilitiesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 13391 | countingStream->rewind(); |
| 13392 | uint32_t opcode_vkGetDisplayPlaneCapabilitiesKHR = OP_vkGetDisplayPlaneCapabilitiesKHR; |
| 13393 | stream->write(&opcode_vkGetDisplayPlaneCapabilitiesKHR, sizeof(uint32_t)); |
| 13394 | stream->write(&packetSize_vkGetDisplayPlaneCapabilitiesKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13395 | uint64_t cgen_var_909; |
| 13396 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_909, 1); |
| 13397 | stream->write((uint64_t*)&cgen_var_909, 1 * 8); |
| 13398 | uint64_t cgen_var_910; |
| 13399 | stream->handleMapping()->mapHandles_VkDisplayModeKHR_u64(&local_mode, &cgen_var_910, 1); |
| 13400 | stream->write((uint64_t*)&cgen_var_910, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13401 | stream->write((uint32_t*)&local_planeIndex, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13402 | marshal_VkDisplayPlaneCapabilitiesKHR(stream, (VkDisplayPlaneCapabilitiesKHR*)(pCapabilities)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 13403 | AEMU_SCOPED_TRACE("vkGetDisplayPlaneCapabilitiesKHR readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13404 | unmarshal_VkDisplayPlaneCapabilitiesKHR(stream, (VkDisplayPlaneCapabilitiesKHR*)(pCapabilities)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 13405 | if (pCapabilities) |
| 13406 | { |
| 13407 | transform_fromhost_VkDisplayPlaneCapabilitiesKHR(mImpl->resources(), (VkDisplayPlaneCapabilitiesKHR*)(pCapabilities)); |
| 13408 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 13409 | AEMU_SCOPED_TRACE("vkGetDisplayPlaneCapabilitiesKHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13410 | VkResult vkGetDisplayPlaneCapabilitiesKHR_VkResult_return = (VkResult)0; |
| 13411 | stream->read(&vkGetDisplayPlaneCapabilitiesKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13412 | countingStream->clearPool(); |
| 13413 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13414 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 13415 | mImpl->log("finish vkGetDisplayPlaneCapabilitiesKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13416 | return vkGetDisplayPlaneCapabilitiesKHR_VkResult_return; |
| 13417 | } |
| 13418 | |
| 13419 | VkResult VkEncoder::vkCreateDisplayPlaneSurfaceKHR( |
| 13420 | VkInstance instance, |
| 13421 | const VkDisplaySurfaceCreateInfoKHR* pCreateInfo, |
| 13422 | const VkAllocationCallbacks* pAllocator, |
| 13423 | VkSurfaceKHR* pSurface) |
| 13424 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 13425 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 13426 | AEMU_SCOPED_TRACE("vkCreateDisplayPlaneSurfaceKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 13427 | mImpl->log("start vkCreateDisplayPlaneSurfaceKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13428 | auto stream = mImpl->stream(); |
| 13429 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13430 | auto resources = mImpl->resources(); |
| 13431 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13432 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13433 | VkInstance local_instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13434 | VkDisplaySurfaceCreateInfoKHR* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 13435 | VkAllocationCallbacks* local_pAllocator; |
| 13436 | local_instance = instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13437 | local_pCreateInfo = nullptr; |
| 13438 | if (pCreateInfo) |
| 13439 | { |
| 13440 | local_pCreateInfo = (VkDisplaySurfaceCreateInfoKHR*)pool->alloc(sizeof(const VkDisplaySurfaceCreateInfoKHR)); |
| 13441 | deepcopy_VkDisplaySurfaceCreateInfoKHR(pool, pCreateInfo, (VkDisplaySurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| 13442 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13443 | local_pAllocator = nullptr; |
| 13444 | if (pAllocator) |
| 13445 | { |
| 13446 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 13447 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 13448 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 13449 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 13450 | if (local_pCreateInfo) |
| 13451 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 13452 | transform_tohost_VkDisplaySurfaceCreateInfoKHR(mImpl->resources(), (VkDisplaySurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 13453 | } |
| 13454 | if (local_pAllocator) |
| 13455 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 13456 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 13457 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13458 | countingStream->rewind(); |
| 13459 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13460 | uint64_t cgen_var_911; |
| 13461 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_911, 1); |
| 13462 | countingStream->write((uint64_t*)&cgen_var_911, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13463 | marshal_VkDisplaySurfaceCreateInfoKHR(countingStream, (VkDisplaySurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13464 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13465 | uint64_t cgen_var_912 = (uint64_t)(uintptr_t)local_pAllocator; |
| 13466 | countingStream->putBe64(cgen_var_912); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13467 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13468 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13469 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13470 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13471 | uint64_t cgen_var_913; |
| 13472 | countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_913, 1); |
| 13473 | countingStream->write((uint64_t*)&cgen_var_913, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13474 | } |
| 13475 | uint32_t packetSize_vkCreateDisplayPlaneSurfaceKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 13476 | countingStream->rewind(); |
| 13477 | uint32_t opcode_vkCreateDisplayPlaneSurfaceKHR = OP_vkCreateDisplayPlaneSurfaceKHR; |
| 13478 | stream->write(&opcode_vkCreateDisplayPlaneSurfaceKHR, sizeof(uint32_t)); |
| 13479 | stream->write(&packetSize_vkCreateDisplayPlaneSurfaceKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13480 | uint64_t cgen_var_914; |
| 13481 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_914, 1); |
| 13482 | stream->write((uint64_t*)&cgen_var_914, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13483 | marshal_VkDisplaySurfaceCreateInfoKHR(stream, (VkDisplaySurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13484 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13485 | uint64_t cgen_var_915 = (uint64_t)(uintptr_t)local_pAllocator; |
| 13486 | stream->putBe64(cgen_var_915); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13487 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13488 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13489 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13490 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13491 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13492 | uint64_t cgen_var_916; |
| 13493 | stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_916, 1); |
| 13494 | stream->write((uint64_t*)&cgen_var_916, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13495 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 13496 | AEMU_SCOPED_TRACE("vkCreateDisplayPlaneSurfaceKHR readParams"); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13497 | uint64_t cgen_var_917; |
| 13498 | stream->read((uint64_t*)&cgen_var_917, 8); |
| 13499 | stream->handleMapping()->mapHandles_u64_VkSurfaceKHR(&cgen_var_917, (VkSurfaceKHR*)pSurface, 1); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 13500 | AEMU_SCOPED_TRACE("vkCreateDisplayPlaneSurfaceKHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13501 | VkResult vkCreateDisplayPlaneSurfaceKHR_VkResult_return = (VkResult)0; |
| 13502 | stream->read(&vkCreateDisplayPlaneSurfaceKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13503 | countingStream->clearPool(); |
| 13504 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13505 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 13506 | mImpl->log("finish vkCreateDisplayPlaneSurfaceKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13507 | return vkCreateDisplayPlaneSurfaceKHR_VkResult_return; |
| 13508 | } |
| 13509 | |
| 13510 | #endif |
| 13511 | #ifdef VK_KHR_display_swapchain |
| 13512 | VkResult VkEncoder::vkCreateSharedSwapchainsKHR( |
| 13513 | VkDevice device, |
| 13514 | uint32_t swapchainCount, |
| 13515 | const VkSwapchainCreateInfoKHR* pCreateInfos, |
| 13516 | const VkAllocationCallbacks* pAllocator, |
| 13517 | VkSwapchainKHR* pSwapchains) |
| 13518 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 13519 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 13520 | AEMU_SCOPED_TRACE("vkCreateSharedSwapchainsKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 13521 | mImpl->log("start vkCreateSharedSwapchainsKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13522 | auto stream = mImpl->stream(); |
| 13523 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13524 | auto resources = mImpl->resources(); |
| 13525 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13526 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13527 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13528 | uint32_t local_swapchainCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13529 | VkSwapchainCreateInfoKHR* local_pCreateInfos; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 13530 | VkAllocationCallbacks* local_pAllocator; |
| 13531 | local_device = device; |
| 13532 | local_swapchainCount = swapchainCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13533 | local_pCreateInfos = nullptr; |
| 13534 | if (pCreateInfos) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13535 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13536 | local_pCreateInfos = (VkSwapchainCreateInfoKHR*)pool->alloc(((swapchainCount)) * sizeof(const VkSwapchainCreateInfoKHR)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13537 | for (uint32_t i = 0; i < (uint32_t)((swapchainCount)); ++i) |
| 13538 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13539 | deepcopy_VkSwapchainCreateInfoKHR(pool, pCreateInfos + i, (VkSwapchainCreateInfoKHR*)(local_pCreateInfos + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13540 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13541 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13542 | local_pAllocator = nullptr; |
| 13543 | if (pAllocator) |
| 13544 | { |
| 13545 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 13546 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 13547 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 13548 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 13549 | if (local_pCreateInfos) |
| 13550 | { |
| 13551 | for (uint32_t i = 0; i < (uint32_t)((swapchainCount)); ++i) |
| 13552 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 13553 | transform_tohost_VkSwapchainCreateInfoKHR(mImpl->resources(), (VkSwapchainCreateInfoKHR*)(local_pCreateInfos + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 13554 | } |
| 13555 | } |
| 13556 | if (local_pAllocator) |
| 13557 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 13558 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 13559 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13560 | countingStream->rewind(); |
| 13561 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13562 | uint64_t cgen_var_918; |
| 13563 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_918, 1); |
| 13564 | countingStream->write((uint64_t*)&cgen_var_918, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13565 | countingStream->write((uint32_t*)&local_swapchainCount, sizeof(uint32_t)); |
| 13566 | for (uint32_t i = 0; i < (uint32_t)((swapchainCount)); ++i) |
| 13567 | { |
| 13568 | marshal_VkSwapchainCreateInfoKHR(countingStream, (VkSwapchainCreateInfoKHR*)(local_pCreateInfos + i)); |
| 13569 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13570 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13571 | uint64_t cgen_var_919 = (uint64_t)(uintptr_t)local_pAllocator; |
| 13572 | countingStream->putBe64(cgen_var_919); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13573 | if (local_pAllocator) |
| 13574 | { |
| 13575 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13576 | } |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13577 | if (((swapchainCount))) |
| 13578 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13579 | uint64_t* cgen_var_920; |
| 13580 | countingStream->alloc((void**)&cgen_var_920, ((swapchainCount)) * 8); |
| 13581 | countingStream->handleMapping()->mapHandles_VkSwapchainKHR_u64(pSwapchains, cgen_var_920, ((swapchainCount))); |
| 13582 | countingStream->write((uint64_t*)cgen_var_920, ((swapchainCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13583 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13584 | } |
| 13585 | uint32_t packetSize_vkCreateSharedSwapchainsKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 13586 | countingStream->rewind(); |
| 13587 | uint32_t opcode_vkCreateSharedSwapchainsKHR = OP_vkCreateSharedSwapchainsKHR; |
| 13588 | stream->write(&opcode_vkCreateSharedSwapchainsKHR, sizeof(uint32_t)); |
| 13589 | stream->write(&packetSize_vkCreateSharedSwapchainsKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13590 | uint64_t cgen_var_921; |
| 13591 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_921, 1); |
| 13592 | stream->write((uint64_t*)&cgen_var_921, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13593 | stream->write((uint32_t*)&local_swapchainCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13594 | for (uint32_t i = 0; i < (uint32_t)((swapchainCount)); ++i) |
| 13595 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13596 | marshal_VkSwapchainCreateInfoKHR(stream, (VkSwapchainCreateInfoKHR*)(local_pCreateInfos + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13597 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13598 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13599 | uint64_t cgen_var_922 = (uint64_t)(uintptr_t)local_pAllocator; |
| 13600 | stream->putBe64(cgen_var_922); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13601 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13602 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13603 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13604 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13605 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13606 | if (((swapchainCount))) |
| 13607 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13608 | uint64_t* cgen_var_923; |
| 13609 | stream->alloc((void**)&cgen_var_923, ((swapchainCount)) * 8); |
| 13610 | stream->handleMapping()->mapHandles_VkSwapchainKHR_u64(pSwapchains, cgen_var_923, ((swapchainCount))); |
| 13611 | stream->write((uint64_t*)cgen_var_923, ((swapchainCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13612 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13613 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 13614 | AEMU_SCOPED_TRACE("vkCreateSharedSwapchainsKHR readParams"); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13615 | if (((swapchainCount))) |
| 13616 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13617 | uint64_t* cgen_var_924; |
| 13618 | stream->alloc((void**)&cgen_var_924, ((swapchainCount)) * 8); |
| 13619 | stream->read((uint64_t*)cgen_var_924, ((swapchainCount)) * 8); |
| 13620 | stream->handleMapping()->mapHandles_u64_VkSwapchainKHR(cgen_var_924, (VkSwapchainKHR*)pSwapchains, ((swapchainCount))); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13621 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 13622 | AEMU_SCOPED_TRACE("vkCreateSharedSwapchainsKHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13623 | VkResult vkCreateSharedSwapchainsKHR_VkResult_return = (VkResult)0; |
| 13624 | stream->read(&vkCreateSharedSwapchainsKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13625 | countingStream->clearPool(); |
| 13626 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13627 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 13628 | mImpl->log("finish vkCreateSharedSwapchainsKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13629 | return vkCreateSharedSwapchainsKHR_VkResult_return; |
| 13630 | } |
| 13631 | |
| 13632 | #endif |
| 13633 | #ifdef VK_KHR_xlib_surface |
| 13634 | VkResult VkEncoder::vkCreateXlibSurfaceKHR( |
| 13635 | VkInstance instance, |
| 13636 | const VkXlibSurfaceCreateInfoKHR* pCreateInfo, |
| 13637 | const VkAllocationCallbacks* pAllocator, |
| 13638 | VkSurfaceKHR* pSurface) |
| 13639 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 13640 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 13641 | AEMU_SCOPED_TRACE("vkCreateXlibSurfaceKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 13642 | mImpl->log("start vkCreateXlibSurfaceKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13643 | auto stream = mImpl->stream(); |
| 13644 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13645 | auto resources = mImpl->resources(); |
| 13646 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13647 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13648 | VkInstance local_instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13649 | VkXlibSurfaceCreateInfoKHR* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 13650 | VkAllocationCallbacks* local_pAllocator; |
| 13651 | local_instance = instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13652 | local_pCreateInfo = nullptr; |
| 13653 | if (pCreateInfo) |
| 13654 | { |
| 13655 | local_pCreateInfo = (VkXlibSurfaceCreateInfoKHR*)pool->alloc(sizeof(const VkXlibSurfaceCreateInfoKHR)); |
| 13656 | deepcopy_VkXlibSurfaceCreateInfoKHR(pool, pCreateInfo, (VkXlibSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| 13657 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13658 | local_pAllocator = nullptr; |
| 13659 | if (pAllocator) |
| 13660 | { |
| 13661 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 13662 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 13663 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 13664 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 13665 | if (local_pCreateInfo) |
| 13666 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 13667 | transform_tohost_VkXlibSurfaceCreateInfoKHR(mImpl->resources(), (VkXlibSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 13668 | } |
| 13669 | if (local_pAllocator) |
| 13670 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 13671 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 13672 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13673 | countingStream->rewind(); |
| 13674 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13675 | uint64_t cgen_var_925; |
| 13676 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_925, 1); |
| 13677 | countingStream->write((uint64_t*)&cgen_var_925, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13678 | marshal_VkXlibSurfaceCreateInfoKHR(countingStream, (VkXlibSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13679 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13680 | uint64_t cgen_var_926 = (uint64_t)(uintptr_t)local_pAllocator; |
| 13681 | countingStream->putBe64(cgen_var_926); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13682 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13683 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13684 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13685 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13686 | uint64_t cgen_var_927; |
| 13687 | countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_927, 1); |
| 13688 | countingStream->write((uint64_t*)&cgen_var_927, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13689 | } |
| 13690 | uint32_t packetSize_vkCreateXlibSurfaceKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 13691 | countingStream->rewind(); |
| 13692 | uint32_t opcode_vkCreateXlibSurfaceKHR = OP_vkCreateXlibSurfaceKHR; |
| 13693 | stream->write(&opcode_vkCreateXlibSurfaceKHR, sizeof(uint32_t)); |
| 13694 | stream->write(&packetSize_vkCreateXlibSurfaceKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13695 | uint64_t cgen_var_928; |
| 13696 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_928, 1); |
| 13697 | stream->write((uint64_t*)&cgen_var_928, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13698 | marshal_VkXlibSurfaceCreateInfoKHR(stream, (VkXlibSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13699 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13700 | uint64_t cgen_var_929 = (uint64_t)(uintptr_t)local_pAllocator; |
| 13701 | stream->putBe64(cgen_var_929); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13702 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13703 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13704 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13705 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13706 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13707 | uint64_t cgen_var_930; |
| 13708 | stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_930, 1); |
| 13709 | stream->write((uint64_t*)&cgen_var_930, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13710 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 13711 | AEMU_SCOPED_TRACE("vkCreateXlibSurfaceKHR readParams"); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13712 | uint64_t cgen_var_931; |
| 13713 | stream->read((uint64_t*)&cgen_var_931, 8); |
| 13714 | stream->handleMapping()->mapHandles_u64_VkSurfaceKHR(&cgen_var_931, (VkSurfaceKHR*)pSurface, 1); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 13715 | AEMU_SCOPED_TRACE("vkCreateXlibSurfaceKHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13716 | VkResult vkCreateXlibSurfaceKHR_VkResult_return = (VkResult)0; |
| 13717 | stream->read(&vkCreateXlibSurfaceKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13718 | countingStream->clearPool(); |
| 13719 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13720 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 13721 | mImpl->log("finish vkCreateXlibSurfaceKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13722 | return vkCreateXlibSurfaceKHR_VkResult_return; |
| 13723 | } |
| 13724 | |
| 13725 | VkBool32 VkEncoder::vkGetPhysicalDeviceXlibPresentationSupportKHR( |
| 13726 | VkPhysicalDevice physicalDevice, |
| 13727 | uint32_t queueFamilyIndex, |
| 13728 | Display* dpy, |
| 13729 | VisualID visualID) |
| 13730 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 13731 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 13732 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceXlibPresentationSupportKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 13733 | mImpl->log("start vkGetPhysicalDeviceXlibPresentationSupportKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13734 | auto stream = mImpl->stream(); |
| 13735 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13736 | auto resources = mImpl->resources(); |
| 13737 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13738 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13739 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13740 | uint32_t local_queueFamilyIndex; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13741 | VisualID local_visualID; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 13742 | local_physicalDevice = physicalDevice; |
| 13743 | local_queueFamilyIndex = queueFamilyIndex; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13744 | local_visualID = visualID; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13745 | countingStream->rewind(); |
| 13746 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13747 | uint64_t cgen_var_932; |
| 13748 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_932, 1); |
| 13749 | countingStream->write((uint64_t*)&cgen_var_932, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13750 | countingStream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13751 | countingStream->write((Display*)dpy, sizeof(Display)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13752 | countingStream->write((VisualID*)&local_visualID, sizeof(VisualID)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13753 | } |
| 13754 | uint32_t packetSize_vkGetPhysicalDeviceXlibPresentationSupportKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 13755 | countingStream->rewind(); |
| 13756 | uint32_t opcode_vkGetPhysicalDeviceXlibPresentationSupportKHR = OP_vkGetPhysicalDeviceXlibPresentationSupportKHR; |
| 13757 | stream->write(&opcode_vkGetPhysicalDeviceXlibPresentationSupportKHR, sizeof(uint32_t)); |
| 13758 | stream->write(&packetSize_vkGetPhysicalDeviceXlibPresentationSupportKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13759 | uint64_t cgen_var_933; |
| 13760 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_933, 1); |
| 13761 | stream->write((uint64_t*)&cgen_var_933, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13762 | stream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13763 | stream->write((Display*)dpy, sizeof(Display)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13764 | stream->write((VisualID*)&local_visualID, sizeof(VisualID)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 13765 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceXlibPresentationSupportKHR readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13766 | stream->read((Display*)dpy, sizeof(Display)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 13767 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceXlibPresentationSupportKHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13768 | VkBool32 vkGetPhysicalDeviceXlibPresentationSupportKHR_VkBool32_return = (VkBool32)0; |
| 13769 | stream->read(&vkGetPhysicalDeviceXlibPresentationSupportKHR_VkBool32_return, sizeof(VkBool32)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13770 | countingStream->clearPool(); |
| 13771 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13772 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 13773 | mImpl->log("finish vkGetPhysicalDeviceXlibPresentationSupportKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13774 | return vkGetPhysicalDeviceXlibPresentationSupportKHR_VkBool32_return; |
| 13775 | } |
| 13776 | |
| 13777 | #endif |
| 13778 | #ifdef VK_KHR_xcb_surface |
| 13779 | VkResult VkEncoder::vkCreateXcbSurfaceKHR( |
| 13780 | VkInstance instance, |
| 13781 | const VkXcbSurfaceCreateInfoKHR* pCreateInfo, |
| 13782 | const VkAllocationCallbacks* pAllocator, |
| 13783 | VkSurfaceKHR* pSurface) |
| 13784 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 13785 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 13786 | AEMU_SCOPED_TRACE("vkCreateXcbSurfaceKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 13787 | mImpl->log("start vkCreateXcbSurfaceKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13788 | auto stream = mImpl->stream(); |
| 13789 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13790 | auto resources = mImpl->resources(); |
| 13791 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13792 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13793 | VkInstance local_instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13794 | VkXcbSurfaceCreateInfoKHR* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 13795 | VkAllocationCallbacks* local_pAllocator; |
| 13796 | local_instance = instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13797 | local_pCreateInfo = nullptr; |
| 13798 | if (pCreateInfo) |
| 13799 | { |
| 13800 | local_pCreateInfo = (VkXcbSurfaceCreateInfoKHR*)pool->alloc(sizeof(const VkXcbSurfaceCreateInfoKHR)); |
| 13801 | deepcopy_VkXcbSurfaceCreateInfoKHR(pool, pCreateInfo, (VkXcbSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| 13802 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13803 | local_pAllocator = nullptr; |
| 13804 | if (pAllocator) |
| 13805 | { |
| 13806 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 13807 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 13808 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 13809 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 13810 | if (local_pCreateInfo) |
| 13811 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 13812 | transform_tohost_VkXcbSurfaceCreateInfoKHR(mImpl->resources(), (VkXcbSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 13813 | } |
| 13814 | if (local_pAllocator) |
| 13815 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 13816 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 13817 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13818 | countingStream->rewind(); |
| 13819 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13820 | uint64_t cgen_var_934; |
| 13821 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_934, 1); |
| 13822 | countingStream->write((uint64_t*)&cgen_var_934, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13823 | marshal_VkXcbSurfaceCreateInfoKHR(countingStream, (VkXcbSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13824 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13825 | uint64_t cgen_var_935 = (uint64_t)(uintptr_t)local_pAllocator; |
| 13826 | countingStream->putBe64(cgen_var_935); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13827 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13828 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13829 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13830 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13831 | uint64_t cgen_var_936; |
| 13832 | countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_936, 1); |
| 13833 | countingStream->write((uint64_t*)&cgen_var_936, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13834 | } |
| 13835 | uint32_t packetSize_vkCreateXcbSurfaceKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 13836 | countingStream->rewind(); |
| 13837 | uint32_t opcode_vkCreateXcbSurfaceKHR = OP_vkCreateXcbSurfaceKHR; |
| 13838 | stream->write(&opcode_vkCreateXcbSurfaceKHR, sizeof(uint32_t)); |
| 13839 | stream->write(&packetSize_vkCreateXcbSurfaceKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13840 | uint64_t cgen_var_937; |
| 13841 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_937, 1); |
| 13842 | stream->write((uint64_t*)&cgen_var_937, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13843 | marshal_VkXcbSurfaceCreateInfoKHR(stream, (VkXcbSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13844 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13845 | uint64_t cgen_var_938 = (uint64_t)(uintptr_t)local_pAllocator; |
| 13846 | stream->putBe64(cgen_var_938); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13847 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13848 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13849 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13850 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13851 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13852 | uint64_t cgen_var_939; |
| 13853 | stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_939, 1); |
| 13854 | stream->write((uint64_t*)&cgen_var_939, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13855 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 13856 | AEMU_SCOPED_TRACE("vkCreateXcbSurfaceKHR readParams"); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13857 | uint64_t cgen_var_940; |
| 13858 | stream->read((uint64_t*)&cgen_var_940, 8); |
| 13859 | stream->handleMapping()->mapHandles_u64_VkSurfaceKHR(&cgen_var_940, (VkSurfaceKHR*)pSurface, 1); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 13860 | AEMU_SCOPED_TRACE("vkCreateXcbSurfaceKHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13861 | VkResult vkCreateXcbSurfaceKHR_VkResult_return = (VkResult)0; |
| 13862 | stream->read(&vkCreateXcbSurfaceKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13863 | countingStream->clearPool(); |
| 13864 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13865 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 13866 | mImpl->log("finish vkCreateXcbSurfaceKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13867 | return vkCreateXcbSurfaceKHR_VkResult_return; |
| 13868 | } |
| 13869 | |
| 13870 | VkBool32 VkEncoder::vkGetPhysicalDeviceXcbPresentationSupportKHR( |
| 13871 | VkPhysicalDevice physicalDevice, |
| 13872 | uint32_t queueFamilyIndex, |
| 13873 | xcb_connection_t* connection, |
| 13874 | xcb_visualid_t visual_id) |
| 13875 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 13876 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 13877 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceXcbPresentationSupportKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 13878 | mImpl->log("start vkGetPhysicalDeviceXcbPresentationSupportKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13879 | auto stream = mImpl->stream(); |
| 13880 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13881 | auto resources = mImpl->resources(); |
| 13882 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13883 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13884 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13885 | uint32_t local_queueFamilyIndex; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13886 | xcb_visualid_t local_visual_id; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 13887 | local_physicalDevice = physicalDevice; |
| 13888 | local_queueFamilyIndex = queueFamilyIndex; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13889 | local_visual_id = visual_id; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13890 | countingStream->rewind(); |
| 13891 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13892 | uint64_t cgen_var_941; |
| 13893 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_941, 1); |
| 13894 | countingStream->write((uint64_t*)&cgen_var_941, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13895 | countingStream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13896 | countingStream->write((xcb_connection_t*)connection, sizeof(xcb_connection_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13897 | countingStream->write((xcb_visualid_t*)&local_visual_id, sizeof(xcb_visualid_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13898 | } |
| 13899 | uint32_t packetSize_vkGetPhysicalDeviceXcbPresentationSupportKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 13900 | countingStream->rewind(); |
| 13901 | uint32_t opcode_vkGetPhysicalDeviceXcbPresentationSupportKHR = OP_vkGetPhysicalDeviceXcbPresentationSupportKHR; |
| 13902 | stream->write(&opcode_vkGetPhysicalDeviceXcbPresentationSupportKHR, sizeof(uint32_t)); |
| 13903 | stream->write(&packetSize_vkGetPhysicalDeviceXcbPresentationSupportKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13904 | uint64_t cgen_var_942; |
| 13905 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_942, 1); |
| 13906 | stream->write((uint64_t*)&cgen_var_942, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13907 | stream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13908 | stream->write((xcb_connection_t*)connection, sizeof(xcb_connection_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13909 | stream->write((xcb_visualid_t*)&local_visual_id, sizeof(xcb_visualid_t)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 13910 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceXcbPresentationSupportKHR readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13911 | stream->read((xcb_connection_t*)connection, sizeof(xcb_connection_t)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 13912 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceXcbPresentationSupportKHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13913 | VkBool32 vkGetPhysicalDeviceXcbPresentationSupportKHR_VkBool32_return = (VkBool32)0; |
| 13914 | stream->read(&vkGetPhysicalDeviceXcbPresentationSupportKHR_VkBool32_return, sizeof(VkBool32)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13915 | countingStream->clearPool(); |
| 13916 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13917 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 13918 | mImpl->log("finish vkGetPhysicalDeviceXcbPresentationSupportKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13919 | return vkGetPhysicalDeviceXcbPresentationSupportKHR_VkBool32_return; |
| 13920 | } |
| 13921 | |
| 13922 | #endif |
| 13923 | #ifdef VK_KHR_wayland_surface |
| 13924 | VkResult VkEncoder::vkCreateWaylandSurfaceKHR( |
| 13925 | VkInstance instance, |
| 13926 | const VkWaylandSurfaceCreateInfoKHR* pCreateInfo, |
| 13927 | const VkAllocationCallbacks* pAllocator, |
| 13928 | VkSurfaceKHR* pSurface) |
| 13929 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 13930 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 13931 | AEMU_SCOPED_TRACE("vkCreateWaylandSurfaceKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 13932 | mImpl->log("start vkCreateWaylandSurfaceKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13933 | auto stream = mImpl->stream(); |
| 13934 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13935 | auto resources = mImpl->resources(); |
| 13936 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13937 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13938 | VkInstance local_instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13939 | VkWaylandSurfaceCreateInfoKHR* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 13940 | VkAllocationCallbacks* local_pAllocator; |
| 13941 | local_instance = instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13942 | local_pCreateInfo = nullptr; |
| 13943 | if (pCreateInfo) |
| 13944 | { |
| 13945 | local_pCreateInfo = (VkWaylandSurfaceCreateInfoKHR*)pool->alloc(sizeof(const VkWaylandSurfaceCreateInfoKHR)); |
| 13946 | deepcopy_VkWaylandSurfaceCreateInfoKHR(pool, pCreateInfo, (VkWaylandSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| 13947 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13948 | local_pAllocator = nullptr; |
| 13949 | if (pAllocator) |
| 13950 | { |
| 13951 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 13952 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 13953 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 13954 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 13955 | if (local_pCreateInfo) |
| 13956 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 13957 | transform_tohost_VkWaylandSurfaceCreateInfoKHR(mImpl->resources(), (VkWaylandSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 13958 | } |
| 13959 | if (local_pAllocator) |
| 13960 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 13961 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 13962 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13963 | countingStream->rewind(); |
| 13964 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13965 | uint64_t cgen_var_943; |
| 13966 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_943, 1); |
| 13967 | countingStream->write((uint64_t*)&cgen_var_943, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13968 | marshal_VkWaylandSurfaceCreateInfoKHR(countingStream, (VkWaylandSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13969 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13970 | uint64_t cgen_var_944 = (uint64_t)(uintptr_t)local_pAllocator; |
| 13971 | countingStream->putBe64(cgen_var_944); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13972 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13973 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13974 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13975 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13976 | uint64_t cgen_var_945; |
| 13977 | countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_945, 1); |
| 13978 | countingStream->write((uint64_t*)&cgen_var_945, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13979 | } |
| 13980 | uint32_t packetSize_vkCreateWaylandSurfaceKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 13981 | countingStream->rewind(); |
| 13982 | uint32_t opcode_vkCreateWaylandSurfaceKHR = OP_vkCreateWaylandSurfaceKHR; |
| 13983 | stream->write(&opcode_vkCreateWaylandSurfaceKHR, sizeof(uint32_t)); |
| 13984 | stream->write(&packetSize_vkCreateWaylandSurfaceKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13985 | uint64_t cgen_var_946; |
| 13986 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_946, 1); |
| 13987 | stream->write((uint64_t*)&cgen_var_946, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13988 | marshal_VkWaylandSurfaceCreateInfoKHR(stream, (VkWaylandSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13989 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13990 | uint64_t cgen_var_947 = (uint64_t)(uintptr_t)local_pAllocator; |
| 13991 | stream->putBe64(cgen_var_947); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13992 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13993 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13994 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13995 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13996 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13997 | uint64_t cgen_var_948; |
| 13998 | stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_948, 1); |
| 13999 | stream->write((uint64_t*)&cgen_var_948, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14000 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 14001 | AEMU_SCOPED_TRACE("vkCreateWaylandSurfaceKHR readParams"); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14002 | uint64_t cgen_var_949; |
| 14003 | stream->read((uint64_t*)&cgen_var_949, 8); |
| 14004 | stream->handleMapping()->mapHandles_u64_VkSurfaceKHR(&cgen_var_949, (VkSurfaceKHR*)pSurface, 1); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 14005 | AEMU_SCOPED_TRACE("vkCreateWaylandSurfaceKHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14006 | VkResult vkCreateWaylandSurfaceKHR_VkResult_return = (VkResult)0; |
| 14007 | stream->read(&vkCreateWaylandSurfaceKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 14008 | countingStream->clearPool(); |
| 14009 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14010 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14011 | mImpl->log("finish vkCreateWaylandSurfaceKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14012 | return vkCreateWaylandSurfaceKHR_VkResult_return; |
| 14013 | } |
| 14014 | |
| 14015 | VkBool32 VkEncoder::vkGetPhysicalDeviceWaylandPresentationSupportKHR( |
| 14016 | VkPhysicalDevice physicalDevice, |
| 14017 | uint32_t queueFamilyIndex, |
| 14018 | wl_display* display) |
| 14019 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 14020 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 14021 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceWaylandPresentationSupportKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14022 | mImpl->log("start vkGetPhysicalDeviceWaylandPresentationSupportKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14023 | auto stream = mImpl->stream(); |
| 14024 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14025 | auto resources = mImpl->resources(); |
| 14026 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14027 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14028 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14029 | uint32_t local_queueFamilyIndex; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 14030 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14031 | local_queueFamilyIndex = queueFamilyIndex; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14032 | countingStream->rewind(); |
| 14033 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14034 | uint64_t cgen_var_950; |
| 14035 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_950, 1); |
| 14036 | countingStream->write((uint64_t*)&cgen_var_950, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14037 | countingStream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14038 | countingStream->write((wl_display*)display, sizeof(wl_display)); |
| 14039 | } |
| 14040 | uint32_t packetSize_vkGetPhysicalDeviceWaylandPresentationSupportKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 14041 | countingStream->rewind(); |
| 14042 | uint32_t opcode_vkGetPhysicalDeviceWaylandPresentationSupportKHR = OP_vkGetPhysicalDeviceWaylandPresentationSupportKHR; |
| 14043 | stream->write(&opcode_vkGetPhysicalDeviceWaylandPresentationSupportKHR, sizeof(uint32_t)); |
| 14044 | stream->write(&packetSize_vkGetPhysicalDeviceWaylandPresentationSupportKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14045 | uint64_t cgen_var_951; |
| 14046 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_951, 1); |
| 14047 | stream->write((uint64_t*)&cgen_var_951, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14048 | stream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14049 | stream->write((wl_display*)display, sizeof(wl_display)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 14050 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceWaylandPresentationSupportKHR readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14051 | stream->read((wl_display*)display, sizeof(wl_display)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 14052 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceWaylandPresentationSupportKHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14053 | VkBool32 vkGetPhysicalDeviceWaylandPresentationSupportKHR_VkBool32_return = (VkBool32)0; |
| 14054 | stream->read(&vkGetPhysicalDeviceWaylandPresentationSupportKHR_VkBool32_return, sizeof(VkBool32)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 14055 | countingStream->clearPool(); |
| 14056 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14057 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14058 | mImpl->log("finish vkGetPhysicalDeviceWaylandPresentationSupportKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14059 | return vkGetPhysicalDeviceWaylandPresentationSupportKHR_VkBool32_return; |
| 14060 | } |
| 14061 | |
| 14062 | #endif |
| 14063 | #ifdef VK_KHR_mir_surface |
| 14064 | VkResult VkEncoder::vkCreateMirSurfaceKHR( |
| 14065 | VkInstance instance, |
| 14066 | const VkMirSurfaceCreateInfoKHR* pCreateInfo, |
| 14067 | const VkAllocationCallbacks* pAllocator, |
| 14068 | VkSurfaceKHR* pSurface) |
| 14069 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 14070 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 14071 | AEMU_SCOPED_TRACE("vkCreateMirSurfaceKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14072 | mImpl->log("start vkCreateMirSurfaceKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14073 | auto stream = mImpl->stream(); |
| 14074 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14075 | auto resources = mImpl->resources(); |
| 14076 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14077 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14078 | VkInstance local_instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14079 | VkMirSurfaceCreateInfoKHR* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 14080 | VkAllocationCallbacks* local_pAllocator; |
| 14081 | local_instance = instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14082 | local_pCreateInfo = nullptr; |
| 14083 | if (pCreateInfo) |
| 14084 | { |
| 14085 | local_pCreateInfo = (VkMirSurfaceCreateInfoKHR*)pool->alloc(sizeof(const VkMirSurfaceCreateInfoKHR)); |
| 14086 | deepcopy_VkMirSurfaceCreateInfoKHR(pool, pCreateInfo, (VkMirSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| 14087 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14088 | local_pAllocator = nullptr; |
| 14089 | if (pAllocator) |
| 14090 | { |
| 14091 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 14092 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 14093 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 14094 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 14095 | if (local_pCreateInfo) |
| 14096 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 14097 | transform_tohost_VkMirSurfaceCreateInfoKHR(mImpl->resources(), (VkMirSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 14098 | } |
| 14099 | if (local_pAllocator) |
| 14100 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 14101 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 14102 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14103 | countingStream->rewind(); |
| 14104 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14105 | uint64_t cgen_var_952; |
| 14106 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_952, 1); |
| 14107 | countingStream->write((uint64_t*)&cgen_var_952, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14108 | marshal_VkMirSurfaceCreateInfoKHR(countingStream, (VkMirSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14109 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14110 | uint64_t cgen_var_953 = (uint64_t)(uintptr_t)local_pAllocator; |
| 14111 | countingStream->putBe64(cgen_var_953); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14112 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14113 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14114 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14115 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14116 | uint64_t cgen_var_954; |
| 14117 | countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_954, 1); |
| 14118 | countingStream->write((uint64_t*)&cgen_var_954, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14119 | } |
| 14120 | uint32_t packetSize_vkCreateMirSurfaceKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 14121 | countingStream->rewind(); |
| 14122 | uint32_t opcode_vkCreateMirSurfaceKHR = OP_vkCreateMirSurfaceKHR; |
| 14123 | stream->write(&opcode_vkCreateMirSurfaceKHR, sizeof(uint32_t)); |
| 14124 | stream->write(&packetSize_vkCreateMirSurfaceKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14125 | uint64_t cgen_var_955; |
| 14126 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_955, 1); |
| 14127 | stream->write((uint64_t*)&cgen_var_955, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14128 | marshal_VkMirSurfaceCreateInfoKHR(stream, (VkMirSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14129 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14130 | uint64_t cgen_var_956 = (uint64_t)(uintptr_t)local_pAllocator; |
| 14131 | stream->putBe64(cgen_var_956); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14132 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14133 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14134 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14135 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14136 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14137 | uint64_t cgen_var_957; |
| 14138 | stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_957, 1); |
| 14139 | stream->write((uint64_t*)&cgen_var_957, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14140 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 14141 | AEMU_SCOPED_TRACE("vkCreateMirSurfaceKHR readParams"); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14142 | uint64_t cgen_var_958; |
| 14143 | stream->read((uint64_t*)&cgen_var_958, 8); |
| 14144 | stream->handleMapping()->mapHandles_u64_VkSurfaceKHR(&cgen_var_958, (VkSurfaceKHR*)pSurface, 1); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 14145 | AEMU_SCOPED_TRACE("vkCreateMirSurfaceKHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14146 | VkResult vkCreateMirSurfaceKHR_VkResult_return = (VkResult)0; |
| 14147 | stream->read(&vkCreateMirSurfaceKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 14148 | countingStream->clearPool(); |
| 14149 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14150 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14151 | mImpl->log("finish vkCreateMirSurfaceKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14152 | return vkCreateMirSurfaceKHR_VkResult_return; |
| 14153 | } |
| 14154 | |
| 14155 | VkBool32 VkEncoder::vkGetPhysicalDeviceMirPresentationSupportKHR( |
| 14156 | VkPhysicalDevice physicalDevice, |
| 14157 | uint32_t queueFamilyIndex, |
| 14158 | MirConnection* connection) |
| 14159 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 14160 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 14161 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceMirPresentationSupportKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14162 | mImpl->log("start vkGetPhysicalDeviceMirPresentationSupportKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14163 | auto stream = mImpl->stream(); |
| 14164 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14165 | auto resources = mImpl->resources(); |
| 14166 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14167 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14168 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14169 | uint32_t local_queueFamilyIndex; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 14170 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14171 | local_queueFamilyIndex = queueFamilyIndex; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14172 | countingStream->rewind(); |
| 14173 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14174 | uint64_t cgen_var_959; |
| 14175 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_959, 1); |
| 14176 | countingStream->write((uint64_t*)&cgen_var_959, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14177 | countingStream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14178 | countingStream->write((MirConnection*)connection, sizeof(MirConnection)); |
| 14179 | } |
| 14180 | uint32_t packetSize_vkGetPhysicalDeviceMirPresentationSupportKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 14181 | countingStream->rewind(); |
| 14182 | uint32_t opcode_vkGetPhysicalDeviceMirPresentationSupportKHR = OP_vkGetPhysicalDeviceMirPresentationSupportKHR; |
| 14183 | stream->write(&opcode_vkGetPhysicalDeviceMirPresentationSupportKHR, sizeof(uint32_t)); |
| 14184 | stream->write(&packetSize_vkGetPhysicalDeviceMirPresentationSupportKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14185 | uint64_t cgen_var_960; |
| 14186 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_960, 1); |
| 14187 | stream->write((uint64_t*)&cgen_var_960, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14188 | stream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14189 | stream->write((MirConnection*)connection, sizeof(MirConnection)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 14190 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceMirPresentationSupportKHR readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14191 | stream->read((MirConnection*)connection, sizeof(MirConnection)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 14192 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceMirPresentationSupportKHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14193 | VkBool32 vkGetPhysicalDeviceMirPresentationSupportKHR_VkBool32_return = (VkBool32)0; |
| 14194 | stream->read(&vkGetPhysicalDeviceMirPresentationSupportKHR_VkBool32_return, sizeof(VkBool32)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 14195 | countingStream->clearPool(); |
| 14196 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14197 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14198 | mImpl->log("finish vkGetPhysicalDeviceMirPresentationSupportKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14199 | return vkGetPhysicalDeviceMirPresentationSupportKHR_VkBool32_return; |
| 14200 | } |
| 14201 | |
| 14202 | #endif |
| 14203 | #ifdef VK_KHR_android_surface |
| 14204 | VkResult VkEncoder::vkCreateAndroidSurfaceKHR( |
| 14205 | VkInstance instance, |
| 14206 | const VkAndroidSurfaceCreateInfoKHR* pCreateInfo, |
| 14207 | const VkAllocationCallbacks* pAllocator, |
| 14208 | VkSurfaceKHR* pSurface) |
| 14209 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 14210 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 14211 | AEMU_SCOPED_TRACE("vkCreateAndroidSurfaceKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14212 | mImpl->log("start vkCreateAndroidSurfaceKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14213 | auto stream = mImpl->stream(); |
| 14214 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14215 | auto resources = mImpl->resources(); |
| 14216 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14217 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14218 | VkInstance local_instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14219 | VkAndroidSurfaceCreateInfoKHR* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 14220 | VkAllocationCallbacks* local_pAllocator; |
| 14221 | local_instance = instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14222 | local_pCreateInfo = nullptr; |
| 14223 | if (pCreateInfo) |
| 14224 | { |
| 14225 | local_pCreateInfo = (VkAndroidSurfaceCreateInfoKHR*)pool->alloc(sizeof(const VkAndroidSurfaceCreateInfoKHR)); |
| 14226 | deepcopy_VkAndroidSurfaceCreateInfoKHR(pool, pCreateInfo, (VkAndroidSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| 14227 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14228 | local_pAllocator = nullptr; |
| 14229 | if (pAllocator) |
| 14230 | { |
| 14231 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 14232 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 14233 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 14234 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 14235 | if (local_pCreateInfo) |
| 14236 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 14237 | transform_tohost_VkAndroidSurfaceCreateInfoKHR(mImpl->resources(), (VkAndroidSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 14238 | } |
| 14239 | if (local_pAllocator) |
| 14240 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 14241 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 14242 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14243 | countingStream->rewind(); |
| 14244 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14245 | uint64_t cgen_var_961; |
| 14246 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_961, 1); |
| 14247 | countingStream->write((uint64_t*)&cgen_var_961, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14248 | marshal_VkAndroidSurfaceCreateInfoKHR(countingStream, (VkAndroidSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14249 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14250 | uint64_t cgen_var_962 = (uint64_t)(uintptr_t)local_pAllocator; |
| 14251 | countingStream->putBe64(cgen_var_962); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14252 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14253 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14254 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14255 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14256 | uint64_t cgen_var_963; |
| 14257 | countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_963, 1); |
| 14258 | countingStream->write((uint64_t*)&cgen_var_963, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14259 | } |
| 14260 | uint32_t packetSize_vkCreateAndroidSurfaceKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 14261 | countingStream->rewind(); |
| 14262 | uint32_t opcode_vkCreateAndroidSurfaceKHR = OP_vkCreateAndroidSurfaceKHR; |
| 14263 | stream->write(&opcode_vkCreateAndroidSurfaceKHR, sizeof(uint32_t)); |
| 14264 | stream->write(&packetSize_vkCreateAndroidSurfaceKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14265 | uint64_t cgen_var_964; |
| 14266 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_964, 1); |
| 14267 | stream->write((uint64_t*)&cgen_var_964, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14268 | marshal_VkAndroidSurfaceCreateInfoKHR(stream, (VkAndroidSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14269 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14270 | uint64_t cgen_var_965 = (uint64_t)(uintptr_t)local_pAllocator; |
| 14271 | stream->putBe64(cgen_var_965); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14272 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14273 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14274 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14275 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14276 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14277 | uint64_t cgen_var_966; |
| 14278 | stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_966, 1); |
| 14279 | stream->write((uint64_t*)&cgen_var_966, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14280 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 14281 | AEMU_SCOPED_TRACE("vkCreateAndroidSurfaceKHR readParams"); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14282 | uint64_t cgen_var_967; |
| 14283 | stream->read((uint64_t*)&cgen_var_967, 8); |
| 14284 | stream->handleMapping()->mapHandles_u64_VkSurfaceKHR(&cgen_var_967, (VkSurfaceKHR*)pSurface, 1); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 14285 | AEMU_SCOPED_TRACE("vkCreateAndroidSurfaceKHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14286 | VkResult vkCreateAndroidSurfaceKHR_VkResult_return = (VkResult)0; |
| 14287 | stream->read(&vkCreateAndroidSurfaceKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 14288 | countingStream->clearPool(); |
| 14289 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14290 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14291 | mImpl->log("finish vkCreateAndroidSurfaceKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14292 | return vkCreateAndroidSurfaceKHR_VkResult_return; |
| 14293 | } |
| 14294 | |
| 14295 | #endif |
| 14296 | #ifdef VK_KHR_win32_surface |
| 14297 | VkResult VkEncoder::vkCreateWin32SurfaceKHR( |
| 14298 | VkInstance instance, |
| 14299 | const VkWin32SurfaceCreateInfoKHR* pCreateInfo, |
| 14300 | const VkAllocationCallbacks* pAllocator, |
| 14301 | VkSurfaceKHR* pSurface) |
| 14302 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 14303 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 14304 | AEMU_SCOPED_TRACE("vkCreateWin32SurfaceKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14305 | mImpl->log("start vkCreateWin32SurfaceKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14306 | auto stream = mImpl->stream(); |
| 14307 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14308 | auto resources = mImpl->resources(); |
| 14309 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14310 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14311 | VkInstance local_instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14312 | VkWin32SurfaceCreateInfoKHR* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 14313 | VkAllocationCallbacks* local_pAllocator; |
| 14314 | local_instance = instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14315 | local_pCreateInfo = nullptr; |
| 14316 | if (pCreateInfo) |
| 14317 | { |
| 14318 | local_pCreateInfo = (VkWin32SurfaceCreateInfoKHR*)pool->alloc(sizeof(const VkWin32SurfaceCreateInfoKHR)); |
| 14319 | deepcopy_VkWin32SurfaceCreateInfoKHR(pool, pCreateInfo, (VkWin32SurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| 14320 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14321 | local_pAllocator = nullptr; |
| 14322 | if (pAllocator) |
| 14323 | { |
| 14324 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 14325 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 14326 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 14327 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 14328 | if (local_pCreateInfo) |
| 14329 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 14330 | transform_tohost_VkWin32SurfaceCreateInfoKHR(mImpl->resources(), (VkWin32SurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 14331 | } |
| 14332 | if (local_pAllocator) |
| 14333 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 14334 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 14335 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14336 | countingStream->rewind(); |
| 14337 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14338 | uint64_t cgen_var_968; |
| 14339 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_968, 1); |
| 14340 | countingStream->write((uint64_t*)&cgen_var_968, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14341 | marshal_VkWin32SurfaceCreateInfoKHR(countingStream, (VkWin32SurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14342 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14343 | uint64_t cgen_var_969 = (uint64_t)(uintptr_t)local_pAllocator; |
| 14344 | countingStream->putBe64(cgen_var_969); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14345 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14346 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14347 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14348 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14349 | uint64_t cgen_var_970; |
| 14350 | countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_970, 1); |
| 14351 | countingStream->write((uint64_t*)&cgen_var_970, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14352 | } |
| 14353 | uint32_t packetSize_vkCreateWin32SurfaceKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 14354 | countingStream->rewind(); |
| 14355 | uint32_t opcode_vkCreateWin32SurfaceKHR = OP_vkCreateWin32SurfaceKHR; |
| 14356 | stream->write(&opcode_vkCreateWin32SurfaceKHR, sizeof(uint32_t)); |
| 14357 | stream->write(&packetSize_vkCreateWin32SurfaceKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14358 | uint64_t cgen_var_971; |
| 14359 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_971, 1); |
| 14360 | stream->write((uint64_t*)&cgen_var_971, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14361 | marshal_VkWin32SurfaceCreateInfoKHR(stream, (VkWin32SurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14362 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14363 | uint64_t cgen_var_972 = (uint64_t)(uintptr_t)local_pAllocator; |
| 14364 | stream->putBe64(cgen_var_972); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14365 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14366 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14367 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14368 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14369 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14370 | uint64_t cgen_var_973; |
| 14371 | stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_973, 1); |
| 14372 | stream->write((uint64_t*)&cgen_var_973, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14373 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 14374 | AEMU_SCOPED_TRACE("vkCreateWin32SurfaceKHR readParams"); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14375 | uint64_t cgen_var_974; |
| 14376 | stream->read((uint64_t*)&cgen_var_974, 8); |
| 14377 | stream->handleMapping()->mapHandles_u64_VkSurfaceKHR(&cgen_var_974, (VkSurfaceKHR*)pSurface, 1); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 14378 | AEMU_SCOPED_TRACE("vkCreateWin32SurfaceKHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14379 | VkResult vkCreateWin32SurfaceKHR_VkResult_return = (VkResult)0; |
| 14380 | stream->read(&vkCreateWin32SurfaceKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 14381 | countingStream->clearPool(); |
| 14382 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14383 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14384 | mImpl->log("finish vkCreateWin32SurfaceKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14385 | return vkCreateWin32SurfaceKHR_VkResult_return; |
| 14386 | } |
| 14387 | |
| 14388 | VkBool32 VkEncoder::vkGetPhysicalDeviceWin32PresentationSupportKHR( |
| 14389 | VkPhysicalDevice physicalDevice, |
| 14390 | uint32_t queueFamilyIndex) |
| 14391 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 14392 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 14393 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceWin32PresentationSupportKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14394 | mImpl->log("start vkGetPhysicalDeviceWin32PresentationSupportKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14395 | auto stream = mImpl->stream(); |
| 14396 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14397 | auto resources = mImpl->resources(); |
| 14398 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14399 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14400 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14401 | uint32_t local_queueFamilyIndex; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 14402 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14403 | local_queueFamilyIndex = queueFamilyIndex; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14404 | countingStream->rewind(); |
| 14405 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14406 | uint64_t cgen_var_975; |
| 14407 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_975, 1); |
| 14408 | countingStream->write((uint64_t*)&cgen_var_975, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14409 | countingStream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14410 | } |
| 14411 | uint32_t packetSize_vkGetPhysicalDeviceWin32PresentationSupportKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 14412 | countingStream->rewind(); |
| 14413 | uint32_t opcode_vkGetPhysicalDeviceWin32PresentationSupportKHR = OP_vkGetPhysicalDeviceWin32PresentationSupportKHR; |
| 14414 | stream->write(&opcode_vkGetPhysicalDeviceWin32PresentationSupportKHR, sizeof(uint32_t)); |
| 14415 | stream->write(&packetSize_vkGetPhysicalDeviceWin32PresentationSupportKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14416 | uint64_t cgen_var_976; |
| 14417 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_976, 1); |
| 14418 | stream->write((uint64_t*)&cgen_var_976, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14419 | stream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 14420 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceWin32PresentationSupportKHR readParams"); |
| 14421 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceWin32PresentationSupportKHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14422 | VkBool32 vkGetPhysicalDeviceWin32PresentationSupportKHR_VkBool32_return = (VkBool32)0; |
| 14423 | stream->read(&vkGetPhysicalDeviceWin32PresentationSupportKHR_VkBool32_return, sizeof(VkBool32)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 14424 | countingStream->clearPool(); |
| 14425 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14426 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14427 | mImpl->log("finish vkGetPhysicalDeviceWin32PresentationSupportKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14428 | return vkGetPhysicalDeviceWin32PresentationSupportKHR_VkBool32_return; |
| 14429 | } |
| 14430 | |
| 14431 | #endif |
| 14432 | #ifdef VK_KHR_sampler_mirror_clamp_to_edge |
| 14433 | #endif |
| 14434 | #ifdef VK_KHR_multiview |
| 14435 | #endif |
| 14436 | #ifdef VK_KHR_get_physical_device_properties2 |
| 14437 | void VkEncoder::vkGetPhysicalDeviceFeatures2KHR( |
| 14438 | VkPhysicalDevice physicalDevice, |
| 14439 | VkPhysicalDeviceFeatures2* pFeatures) |
| 14440 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 14441 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 14442 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceFeatures2KHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14443 | mImpl->log("start vkGetPhysicalDeviceFeatures2KHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14444 | auto stream = mImpl->stream(); |
| 14445 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14446 | auto resources = mImpl->resources(); |
| 14447 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14448 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14449 | VkPhysicalDevice local_physicalDevice; |
| 14450 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14451 | countingStream->rewind(); |
| 14452 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14453 | uint64_t cgen_var_977; |
| 14454 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_977, 1); |
| 14455 | countingStream->write((uint64_t*)&cgen_var_977, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14456 | marshal_VkPhysicalDeviceFeatures2(countingStream, (VkPhysicalDeviceFeatures2*)(pFeatures)); |
| 14457 | } |
| 14458 | uint32_t packetSize_vkGetPhysicalDeviceFeatures2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 14459 | countingStream->rewind(); |
| 14460 | uint32_t opcode_vkGetPhysicalDeviceFeatures2KHR = OP_vkGetPhysicalDeviceFeatures2KHR; |
| 14461 | stream->write(&opcode_vkGetPhysicalDeviceFeatures2KHR, sizeof(uint32_t)); |
| 14462 | stream->write(&packetSize_vkGetPhysicalDeviceFeatures2KHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14463 | uint64_t cgen_var_978; |
| 14464 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_978, 1); |
| 14465 | stream->write((uint64_t*)&cgen_var_978, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14466 | marshal_VkPhysicalDeviceFeatures2(stream, (VkPhysicalDeviceFeatures2*)(pFeatures)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 14467 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceFeatures2KHR readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14468 | unmarshal_VkPhysicalDeviceFeatures2(stream, (VkPhysicalDeviceFeatures2*)(pFeatures)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 14469 | if (pFeatures) |
| 14470 | { |
| 14471 | transform_fromhost_VkPhysicalDeviceFeatures2(mImpl->resources(), (VkPhysicalDeviceFeatures2*)(pFeatures)); |
| 14472 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 14473 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceFeatures2KHR returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14474 | mImpl->log("finish vkGetPhysicalDeviceFeatures2KHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14475 | } |
| 14476 | |
| 14477 | void VkEncoder::vkGetPhysicalDeviceProperties2KHR( |
| 14478 | VkPhysicalDevice physicalDevice, |
| 14479 | VkPhysicalDeviceProperties2* pProperties) |
| 14480 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 14481 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 14482 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceProperties2KHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14483 | mImpl->log("start vkGetPhysicalDeviceProperties2KHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14484 | auto stream = mImpl->stream(); |
| 14485 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14486 | auto resources = mImpl->resources(); |
| 14487 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14488 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14489 | VkPhysicalDevice local_physicalDevice; |
| 14490 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14491 | countingStream->rewind(); |
| 14492 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14493 | uint64_t cgen_var_979; |
| 14494 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_979, 1); |
| 14495 | countingStream->write((uint64_t*)&cgen_var_979, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14496 | marshal_VkPhysicalDeviceProperties2(countingStream, (VkPhysicalDeviceProperties2*)(pProperties)); |
| 14497 | } |
| 14498 | uint32_t packetSize_vkGetPhysicalDeviceProperties2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 14499 | countingStream->rewind(); |
| 14500 | uint32_t opcode_vkGetPhysicalDeviceProperties2KHR = OP_vkGetPhysicalDeviceProperties2KHR; |
| 14501 | stream->write(&opcode_vkGetPhysicalDeviceProperties2KHR, sizeof(uint32_t)); |
| 14502 | stream->write(&packetSize_vkGetPhysicalDeviceProperties2KHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14503 | uint64_t cgen_var_980; |
| 14504 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_980, 1); |
| 14505 | stream->write((uint64_t*)&cgen_var_980, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14506 | marshal_VkPhysicalDeviceProperties2(stream, (VkPhysicalDeviceProperties2*)(pProperties)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 14507 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceProperties2KHR readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14508 | unmarshal_VkPhysicalDeviceProperties2(stream, (VkPhysicalDeviceProperties2*)(pProperties)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 14509 | if (pProperties) |
| 14510 | { |
| 14511 | transform_fromhost_VkPhysicalDeviceProperties2(mImpl->resources(), (VkPhysicalDeviceProperties2*)(pProperties)); |
| 14512 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 14513 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceProperties2KHR returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14514 | mImpl->log("finish vkGetPhysicalDeviceProperties2KHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14515 | } |
| 14516 | |
| 14517 | void VkEncoder::vkGetPhysicalDeviceFormatProperties2KHR( |
| 14518 | VkPhysicalDevice physicalDevice, |
| 14519 | VkFormat format, |
| 14520 | VkFormatProperties2* pFormatProperties) |
| 14521 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 14522 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 14523 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceFormatProperties2KHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14524 | mImpl->log("start vkGetPhysicalDeviceFormatProperties2KHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14525 | auto stream = mImpl->stream(); |
| 14526 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14527 | auto resources = mImpl->resources(); |
| 14528 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14529 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14530 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14531 | VkFormat local_format; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 14532 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14533 | local_format = format; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14534 | countingStream->rewind(); |
| 14535 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14536 | uint64_t cgen_var_981; |
| 14537 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_981, 1); |
| 14538 | countingStream->write((uint64_t*)&cgen_var_981, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14539 | countingStream->write((VkFormat*)&local_format, sizeof(VkFormat)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14540 | marshal_VkFormatProperties2(countingStream, (VkFormatProperties2*)(pFormatProperties)); |
| 14541 | } |
| 14542 | uint32_t packetSize_vkGetPhysicalDeviceFormatProperties2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 14543 | countingStream->rewind(); |
| 14544 | uint32_t opcode_vkGetPhysicalDeviceFormatProperties2KHR = OP_vkGetPhysicalDeviceFormatProperties2KHR; |
| 14545 | stream->write(&opcode_vkGetPhysicalDeviceFormatProperties2KHR, sizeof(uint32_t)); |
| 14546 | stream->write(&packetSize_vkGetPhysicalDeviceFormatProperties2KHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14547 | uint64_t cgen_var_982; |
| 14548 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_982, 1); |
| 14549 | stream->write((uint64_t*)&cgen_var_982, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14550 | stream->write((VkFormat*)&local_format, sizeof(VkFormat)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14551 | marshal_VkFormatProperties2(stream, (VkFormatProperties2*)(pFormatProperties)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 14552 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceFormatProperties2KHR readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14553 | unmarshal_VkFormatProperties2(stream, (VkFormatProperties2*)(pFormatProperties)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 14554 | if (pFormatProperties) |
| 14555 | { |
| 14556 | transform_fromhost_VkFormatProperties2(mImpl->resources(), (VkFormatProperties2*)(pFormatProperties)); |
| 14557 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 14558 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceFormatProperties2KHR returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14559 | mImpl->log("finish vkGetPhysicalDeviceFormatProperties2KHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14560 | } |
| 14561 | |
| 14562 | VkResult VkEncoder::vkGetPhysicalDeviceImageFormatProperties2KHR( |
| 14563 | VkPhysicalDevice physicalDevice, |
| 14564 | const VkPhysicalDeviceImageFormatInfo2* pImageFormatInfo, |
| 14565 | VkImageFormatProperties2* pImageFormatProperties) |
| 14566 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 14567 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 14568 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceImageFormatProperties2KHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14569 | mImpl->log("start vkGetPhysicalDeviceImageFormatProperties2KHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14570 | auto stream = mImpl->stream(); |
| 14571 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14572 | auto resources = mImpl->resources(); |
| 14573 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14574 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14575 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14576 | VkPhysicalDeviceImageFormatInfo2* local_pImageFormatInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 14577 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14578 | local_pImageFormatInfo = nullptr; |
| 14579 | if (pImageFormatInfo) |
| 14580 | { |
| 14581 | local_pImageFormatInfo = (VkPhysicalDeviceImageFormatInfo2*)pool->alloc(sizeof(const VkPhysicalDeviceImageFormatInfo2)); |
| 14582 | deepcopy_VkPhysicalDeviceImageFormatInfo2(pool, pImageFormatInfo, (VkPhysicalDeviceImageFormatInfo2*)(local_pImageFormatInfo)); |
| 14583 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 14584 | if (local_pImageFormatInfo) |
| 14585 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 14586 | transform_tohost_VkPhysicalDeviceImageFormatInfo2(mImpl->resources(), (VkPhysicalDeviceImageFormatInfo2*)(local_pImageFormatInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 14587 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14588 | countingStream->rewind(); |
| 14589 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14590 | uint64_t cgen_var_983; |
| 14591 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_983, 1); |
| 14592 | countingStream->write((uint64_t*)&cgen_var_983, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14593 | marshal_VkPhysicalDeviceImageFormatInfo2(countingStream, (VkPhysicalDeviceImageFormatInfo2*)(local_pImageFormatInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14594 | marshal_VkImageFormatProperties2(countingStream, (VkImageFormatProperties2*)(pImageFormatProperties)); |
| 14595 | } |
| 14596 | uint32_t packetSize_vkGetPhysicalDeviceImageFormatProperties2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 14597 | countingStream->rewind(); |
| 14598 | uint32_t opcode_vkGetPhysicalDeviceImageFormatProperties2KHR = OP_vkGetPhysicalDeviceImageFormatProperties2KHR; |
| 14599 | stream->write(&opcode_vkGetPhysicalDeviceImageFormatProperties2KHR, sizeof(uint32_t)); |
| 14600 | stream->write(&packetSize_vkGetPhysicalDeviceImageFormatProperties2KHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14601 | uint64_t cgen_var_984; |
| 14602 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_984, 1); |
| 14603 | stream->write((uint64_t*)&cgen_var_984, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14604 | marshal_VkPhysicalDeviceImageFormatInfo2(stream, (VkPhysicalDeviceImageFormatInfo2*)(local_pImageFormatInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14605 | marshal_VkImageFormatProperties2(stream, (VkImageFormatProperties2*)(pImageFormatProperties)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 14606 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceImageFormatProperties2KHR readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14607 | unmarshal_VkImageFormatProperties2(stream, (VkImageFormatProperties2*)(pImageFormatProperties)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 14608 | if (pImageFormatProperties) |
| 14609 | { |
| 14610 | transform_fromhost_VkImageFormatProperties2(mImpl->resources(), (VkImageFormatProperties2*)(pImageFormatProperties)); |
| 14611 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 14612 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceImageFormatProperties2KHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14613 | VkResult vkGetPhysicalDeviceImageFormatProperties2KHR_VkResult_return = (VkResult)0; |
| 14614 | stream->read(&vkGetPhysicalDeviceImageFormatProperties2KHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 14615 | countingStream->clearPool(); |
| 14616 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14617 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14618 | mImpl->log("finish vkGetPhysicalDeviceImageFormatProperties2KHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14619 | return vkGetPhysicalDeviceImageFormatProperties2KHR_VkResult_return; |
| 14620 | } |
| 14621 | |
| 14622 | void VkEncoder::vkGetPhysicalDeviceQueueFamilyProperties2KHR( |
| 14623 | VkPhysicalDevice physicalDevice, |
| 14624 | uint32_t* pQueueFamilyPropertyCount, |
| 14625 | VkQueueFamilyProperties2* pQueueFamilyProperties) |
| 14626 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 14627 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 14628 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceQueueFamilyProperties2KHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14629 | mImpl->log("start vkGetPhysicalDeviceQueueFamilyProperties2KHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14630 | auto stream = mImpl->stream(); |
| 14631 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14632 | auto resources = mImpl->resources(); |
| 14633 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14634 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14635 | VkPhysicalDevice local_physicalDevice; |
| 14636 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14637 | countingStream->rewind(); |
| 14638 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14639 | uint64_t cgen_var_985; |
| 14640 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_985, 1); |
| 14641 | countingStream->write((uint64_t*)&cgen_var_985, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14642 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14643 | uint64_t cgen_var_986 = (uint64_t)(uintptr_t)pQueueFamilyPropertyCount; |
| 14644 | countingStream->putBe64(cgen_var_986); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14645 | if (pQueueFamilyPropertyCount) |
| 14646 | { |
| 14647 | countingStream->write((uint32_t*)pQueueFamilyPropertyCount, sizeof(uint32_t)); |
| 14648 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14649 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14650 | uint64_t cgen_var_987 = (uint64_t)(uintptr_t)pQueueFamilyProperties; |
| 14651 | countingStream->putBe64(cgen_var_987); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14652 | if (pQueueFamilyProperties) |
| 14653 | { |
| 14654 | for (uint32_t i = 0; i < (uint32_t)(*(pQueueFamilyPropertyCount)); ++i) |
| 14655 | { |
| 14656 | marshal_VkQueueFamilyProperties2(countingStream, (VkQueueFamilyProperties2*)(pQueueFamilyProperties + i)); |
| 14657 | } |
| 14658 | } |
| 14659 | } |
| 14660 | uint32_t packetSize_vkGetPhysicalDeviceQueueFamilyProperties2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 14661 | countingStream->rewind(); |
| 14662 | uint32_t opcode_vkGetPhysicalDeviceQueueFamilyProperties2KHR = OP_vkGetPhysicalDeviceQueueFamilyProperties2KHR; |
| 14663 | stream->write(&opcode_vkGetPhysicalDeviceQueueFamilyProperties2KHR, sizeof(uint32_t)); |
| 14664 | stream->write(&packetSize_vkGetPhysicalDeviceQueueFamilyProperties2KHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14665 | uint64_t cgen_var_988; |
| 14666 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_988, 1); |
| 14667 | stream->write((uint64_t*)&cgen_var_988, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14668 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14669 | uint64_t cgen_var_989 = (uint64_t)(uintptr_t)pQueueFamilyPropertyCount; |
| 14670 | stream->putBe64(cgen_var_989); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14671 | if (pQueueFamilyPropertyCount) |
| 14672 | { |
| 14673 | stream->write((uint32_t*)pQueueFamilyPropertyCount, sizeof(uint32_t)); |
| 14674 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14675 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14676 | uint64_t cgen_var_990 = (uint64_t)(uintptr_t)pQueueFamilyProperties; |
| 14677 | stream->putBe64(cgen_var_990); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14678 | if (pQueueFamilyProperties) |
| 14679 | { |
| 14680 | for (uint32_t i = 0; i < (uint32_t)(*(pQueueFamilyPropertyCount)); ++i) |
| 14681 | { |
| 14682 | marshal_VkQueueFamilyProperties2(stream, (VkQueueFamilyProperties2*)(pQueueFamilyProperties + i)); |
| 14683 | } |
| 14684 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 14685 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceQueueFamilyProperties2KHR readParams"); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14686 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14687 | uint32_t* check_pQueueFamilyPropertyCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14688 | check_pQueueFamilyPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14689 | if (pQueueFamilyPropertyCount) |
| 14690 | { |
| 14691 | if (!(check_pQueueFamilyPropertyCount)) |
| 14692 | { |
| 14693 | fprintf(stderr, "fatal: pQueueFamilyPropertyCount inconsistent between guest and host\n"); |
| 14694 | } |
| 14695 | stream->read((uint32_t*)pQueueFamilyPropertyCount, sizeof(uint32_t)); |
| 14696 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14697 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14698 | VkQueueFamilyProperties2* check_pQueueFamilyProperties; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14699 | check_pQueueFamilyProperties = (VkQueueFamilyProperties2*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14700 | if (pQueueFamilyProperties) |
| 14701 | { |
| 14702 | if (!(check_pQueueFamilyProperties)) |
| 14703 | { |
| 14704 | fprintf(stderr, "fatal: pQueueFamilyProperties inconsistent between guest and host\n"); |
| 14705 | } |
| 14706 | for (uint32_t i = 0; i < (uint32_t)(*(pQueueFamilyPropertyCount)); ++i) |
| 14707 | { |
| 14708 | unmarshal_VkQueueFamilyProperties2(stream, (VkQueueFamilyProperties2*)(pQueueFamilyProperties + i)); |
| 14709 | } |
| 14710 | } |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 14711 | if (pQueueFamilyProperties) |
| 14712 | { |
| 14713 | for (uint32_t i = 0; i < (uint32_t)(*(pQueueFamilyPropertyCount)); ++i) |
| 14714 | { |
| 14715 | transform_fromhost_VkQueueFamilyProperties2(mImpl->resources(), (VkQueueFamilyProperties2*)(pQueueFamilyProperties + i)); |
| 14716 | } |
| 14717 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 14718 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceQueueFamilyProperties2KHR returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14719 | mImpl->log("finish vkGetPhysicalDeviceQueueFamilyProperties2KHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14720 | } |
| 14721 | |
| 14722 | void VkEncoder::vkGetPhysicalDeviceMemoryProperties2KHR( |
| 14723 | VkPhysicalDevice physicalDevice, |
| 14724 | VkPhysicalDeviceMemoryProperties2* pMemoryProperties) |
| 14725 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 14726 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 14727 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceMemoryProperties2KHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14728 | mImpl->log("start vkGetPhysicalDeviceMemoryProperties2KHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14729 | auto stream = mImpl->stream(); |
| 14730 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14731 | auto resources = mImpl->resources(); |
| 14732 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14733 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14734 | VkPhysicalDevice local_physicalDevice; |
| 14735 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14736 | countingStream->rewind(); |
| 14737 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14738 | uint64_t cgen_var_993; |
| 14739 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_993, 1); |
| 14740 | countingStream->write((uint64_t*)&cgen_var_993, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14741 | marshal_VkPhysicalDeviceMemoryProperties2(countingStream, (VkPhysicalDeviceMemoryProperties2*)(pMemoryProperties)); |
| 14742 | } |
| 14743 | uint32_t packetSize_vkGetPhysicalDeviceMemoryProperties2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 14744 | countingStream->rewind(); |
| 14745 | uint32_t opcode_vkGetPhysicalDeviceMemoryProperties2KHR = OP_vkGetPhysicalDeviceMemoryProperties2KHR; |
| 14746 | stream->write(&opcode_vkGetPhysicalDeviceMemoryProperties2KHR, sizeof(uint32_t)); |
| 14747 | stream->write(&packetSize_vkGetPhysicalDeviceMemoryProperties2KHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14748 | uint64_t cgen_var_994; |
| 14749 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_994, 1); |
| 14750 | stream->write((uint64_t*)&cgen_var_994, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14751 | marshal_VkPhysicalDeviceMemoryProperties2(stream, (VkPhysicalDeviceMemoryProperties2*)(pMemoryProperties)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 14752 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceMemoryProperties2KHR readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14753 | unmarshal_VkPhysicalDeviceMemoryProperties2(stream, (VkPhysicalDeviceMemoryProperties2*)(pMemoryProperties)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 14754 | if (pMemoryProperties) |
| 14755 | { |
| 14756 | transform_fromhost_VkPhysicalDeviceMemoryProperties2(mImpl->resources(), (VkPhysicalDeviceMemoryProperties2*)(pMemoryProperties)); |
| 14757 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 14758 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceMemoryProperties2KHR returnUnmarshal"); |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 14759 | encoderLock.unlock(); |
| Lingfeng Yang | 154a33c | 2019-01-29 19:06:23 -0800 | [diff] [blame] | 14760 | mImpl->resources()->on_vkGetPhysicalDeviceMemoryProperties2KHR(this, physicalDevice, pMemoryProperties); |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 14761 | encoderLock.lock(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14762 | mImpl->log("finish vkGetPhysicalDeviceMemoryProperties2KHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14763 | } |
| 14764 | |
| 14765 | void VkEncoder::vkGetPhysicalDeviceSparseImageFormatProperties2KHR( |
| 14766 | VkPhysicalDevice physicalDevice, |
| 14767 | const VkPhysicalDeviceSparseImageFormatInfo2* pFormatInfo, |
| 14768 | uint32_t* pPropertyCount, |
| 14769 | VkSparseImageFormatProperties2* pProperties) |
| 14770 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 14771 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 14772 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceSparseImageFormatProperties2KHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14773 | mImpl->log("start vkGetPhysicalDeviceSparseImageFormatProperties2KHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14774 | auto stream = mImpl->stream(); |
| 14775 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14776 | auto resources = mImpl->resources(); |
| 14777 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14778 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14779 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14780 | VkPhysicalDeviceSparseImageFormatInfo2* local_pFormatInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 14781 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14782 | local_pFormatInfo = nullptr; |
| 14783 | if (pFormatInfo) |
| 14784 | { |
| 14785 | local_pFormatInfo = (VkPhysicalDeviceSparseImageFormatInfo2*)pool->alloc(sizeof(const VkPhysicalDeviceSparseImageFormatInfo2)); |
| 14786 | deepcopy_VkPhysicalDeviceSparseImageFormatInfo2(pool, pFormatInfo, (VkPhysicalDeviceSparseImageFormatInfo2*)(local_pFormatInfo)); |
| 14787 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 14788 | if (local_pFormatInfo) |
| 14789 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 14790 | transform_tohost_VkPhysicalDeviceSparseImageFormatInfo2(mImpl->resources(), (VkPhysicalDeviceSparseImageFormatInfo2*)(local_pFormatInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 14791 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14792 | countingStream->rewind(); |
| 14793 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14794 | uint64_t cgen_var_995; |
| 14795 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_995, 1); |
| 14796 | countingStream->write((uint64_t*)&cgen_var_995, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14797 | marshal_VkPhysicalDeviceSparseImageFormatInfo2(countingStream, (VkPhysicalDeviceSparseImageFormatInfo2*)(local_pFormatInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14798 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14799 | uint64_t cgen_var_996 = (uint64_t)(uintptr_t)pPropertyCount; |
| 14800 | countingStream->putBe64(cgen_var_996); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14801 | if (pPropertyCount) |
| 14802 | { |
| 14803 | countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 14804 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14805 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14806 | uint64_t cgen_var_997 = (uint64_t)(uintptr_t)pProperties; |
| 14807 | countingStream->putBe64(cgen_var_997); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14808 | if (pProperties) |
| 14809 | { |
| 14810 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 14811 | { |
| 14812 | marshal_VkSparseImageFormatProperties2(countingStream, (VkSparseImageFormatProperties2*)(pProperties + i)); |
| 14813 | } |
| 14814 | } |
| 14815 | } |
| 14816 | uint32_t packetSize_vkGetPhysicalDeviceSparseImageFormatProperties2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 14817 | countingStream->rewind(); |
| 14818 | uint32_t opcode_vkGetPhysicalDeviceSparseImageFormatProperties2KHR = OP_vkGetPhysicalDeviceSparseImageFormatProperties2KHR; |
| 14819 | stream->write(&opcode_vkGetPhysicalDeviceSparseImageFormatProperties2KHR, sizeof(uint32_t)); |
| 14820 | stream->write(&packetSize_vkGetPhysicalDeviceSparseImageFormatProperties2KHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14821 | uint64_t cgen_var_998; |
| 14822 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_998, 1); |
| 14823 | stream->write((uint64_t*)&cgen_var_998, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14824 | marshal_VkPhysicalDeviceSparseImageFormatInfo2(stream, (VkPhysicalDeviceSparseImageFormatInfo2*)(local_pFormatInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14825 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14826 | uint64_t cgen_var_999 = (uint64_t)(uintptr_t)pPropertyCount; |
| 14827 | stream->putBe64(cgen_var_999); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14828 | if (pPropertyCount) |
| 14829 | { |
| 14830 | stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 14831 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14832 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14833 | uint64_t cgen_var_1000 = (uint64_t)(uintptr_t)pProperties; |
| 14834 | stream->putBe64(cgen_var_1000); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14835 | if (pProperties) |
| 14836 | { |
| 14837 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 14838 | { |
| 14839 | marshal_VkSparseImageFormatProperties2(stream, (VkSparseImageFormatProperties2*)(pProperties + i)); |
| 14840 | } |
| 14841 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 14842 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceSparseImageFormatProperties2KHR readParams"); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14843 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14844 | uint32_t* check_pPropertyCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14845 | check_pPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14846 | if (pPropertyCount) |
| 14847 | { |
| 14848 | if (!(check_pPropertyCount)) |
| 14849 | { |
| 14850 | fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n"); |
| 14851 | } |
| 14852 | stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 14853 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14854 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14855 | VkSparseImageFormatProperties2* check_pProperties; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14856 | check_pProperties = (VkSparseImageFormatProperties2*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14857 | if (pProperties) |
| 14858 | { |
| 14859 | if (!(check_pProperties)) |
| 14860 | { |
| 14861 | fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n"); |
| 14862 | } |
| 14863 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 14864 | { |
| 14865 | unmarshal_VkSparseImageFormatProperties2(stream, (VkSparseImageFormatProperties2*)(pProperties + i)); |
| 14866 | } |
| 14867 | } |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 14868 | if (pProperties) |
| 14869 | { |
| 14870 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 14871 | { |
| 14872 | transform_fromhost_VkSparseImageFormatProperties2(mImpl->resources(), (VkSparseImageFormatProperties2*)(pProperties + i)); |
| 14873 | } |
| 14874 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 14875 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceSparseImageFormatProperties2KHR returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14876 | mImpl->log("finish vkGetPhysicalDeviceSparseImageFormatProperties2KHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14877 | } |
| 14878 | |
| 14879 | #endif |
| 14880 | #ifdef VK_KHR_device_group |
| 14881 | void VkEncoder::vkGetDeviceGroupPeerMemoryFeaturesKHR( |
| 14882 | VkDevice device, |
| 14883 | uint32_t heapIndex, |
| 14884 | uint32_t localDeviceIndex, |
| 14885 | uint32_t remoteDeviceIndex, |
| 14886 | VkPeerMemoryFeatureFlags* pPeerMemoryFeatures) |
| 14887 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 14888 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 14889 | AEMU_SCOPED_TRACE("vkGetDeviceGroupPeerMemoryFeaturesKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14890 | mImpl->log("start vkGetDeviceGroupPeerMemoryFeaturesKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14891 | auto stream = mImpl->stream(); |
| 14892 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14893 | auto resources = mImpl->resources(); |
| 14894 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14895 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14896 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14897 | uint32_t local_heapIndex; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14898 | uint32_t local_localDeviceIndex; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14899 | uint32_t local_remoteDeviceIndex; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 14900 | local_device = device; |
| 14901 | local_heapIndex = heapIndex; |
| 14902 | local_localDeviceIndex = localDeviceIndex; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14903 | local_remoteDeviceIndex = remoteDeviceIndex; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14904 | countingStream->rewind(); |
| 14905 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14906 | uint64_t cgen_var_1003; |
| 14907 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1003, 1); |
| 14908 | countingStream->write((uint64_t*)&cgen_var_1003, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14909 | countingStream->write((uint32_t*)&local_heapIndex, sizeof(uint32_t)); |
| 14910 | countingStream->write((uint32_t*)&local_localDeviceIndex, sizeof(uint32_t)); |
| 14911 | countingStream->write((uint32_t*)&local_remoteDeviceIndex, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14912 | countingStream->write((VkPeerMemoryFeatureFlags*)pPeerMemoryFeatures, sizeof(VkPeerMemoryFeatureFlags)); |
| 14913 | } |
| 14914 | uint32_t packetSize_vkGetDeviceGroupPeerMemoryFeaturesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 14915 | countingStream->rewind(); |
| 14916 | uint32_t opcode_vkGetDeviceGroupPeerMemoryFeaturesKHR = OP_vkGetDeviceGroupPeerMemoryFeaturesKHR; |
| 14917 | stream->write(&opcode_vkGetDeviceGroupPeerMemoryFeaturesKHR, sizeof(uint32_t)); |
| 14918 | stream->write(&packetSize_vkGetDeviceGroupPeerMemoryFeaturesKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14919 | uint64_t cgen_var_1004; |
| 14920 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1004, 1); |
| 14921 | stream->write((uint64_t*)&cgen_var_1004, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14922 | stream->write((uint32_t*)&local_heapIndex, sizeof(uint32_t)); |
| 14923 | stream->write((uint32_t*)&local_localDeviceIndex, sizeof(uint32_t)); |
| 14924 | stream->write((uint32_t*)&local_remoteDeviceIndex, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14925 | stream->write((VkPeerMemoryFeatureFlags*)pPeerMemoryFeatures, sizeof(VkPeerMemoryFeatureFlags)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 14926 | AEMU_SCOPED_TRACE("vkGetDeviceGroupPeerMemoryFeaturesKHR readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14927 | stream->read((VkPeerMemoryFeatureFlags*)pPeerMemoryFeatures, sizeof(VkPeerMemoryFeatureFlags)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 14928 | AEMU_SCOPED_TRACE("vkGetDeviceGroupPeerMemoryFeaturesKHR returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14929 | mImpl->log("finish vkGetDeviceGroupPeerMemoryFeaturesKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14930 | } |
| 14931 | |
| 14932 | void VkEncoder::vkCmdSetDeviceMaskKHR( |
| 14933 | VkCommandBuffer commandBuffer, |
| 14934 | uint32_t deviceMask) |
| 14935 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 14936 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 14937 | AEMU_SCOPED_TRACE("vkCmdSetDeviceMaskKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14938 | mImpl->log("start vkCmdSetDeviceMaskKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14939 | auto stream = mImpl->stream(); |
| 14940 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14941 | auto resources = mImpl->resources(); |
| 14942 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14943 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14944 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14945 | uint32_t local_deviceMask; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 14946 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14947 | local_deviceMask = deviceMask; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14948 | countingStream->rewind(); |
| 14949 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14950 | uint64_t cgen_var_1005; |
| 14951 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1005, 1); |
| 14952 | countingStream->write((uint64_t*)&cgen_var_1005, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14953 | countingStream->write((uint32_t*)&local_deviceMask, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14954 | } |
| 14955 | uint32_t packetSize_vkCmdSetDeviceMaskKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 14956 | countingStream->rewind(); |
| 14957 | uint32_t opcode_vkCmdSetDeviceMaskKHR = OP_vkCmdSetDeviceMaskKHR; |
| 14958 | stream->write(&opcode_vkCmdSetDeviceMaskKHR, sizeof(uint32_t)); |
| 14959 | stream->write(&packetSize_vkCmdSetDeviceMaskKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14960 | uint64_t cgen_var_1006; |
| 14961 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1006, 1); |
| 14962 | stream->write((uint64_t*)&cgen_var_1006, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14963 | stream->write((uint32_t*)&local_deviceMask, sizeof(uint32_t)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 14964 | AEMU_SCOPED_TRACE("vkCmdSetDeviceMaskKHR readParams"); |
| 14965 | AEMU_SCOPED_TRACE("vkCmdSetDeviceMaskKHR returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14966 | mImpl->log("finish vkCmdSetDeviceMaskKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14967 | } |
| 14968 | |
| 14969 | void VkEncoder::vkCmdDispatchBaseKHR( |
| 14970 | VkCommandBuffer commandBuffer, |
| 14971 | uint32_t baseGroupX, |
| 14972 | uint32_t baseGroupY, |
| 14973 | uint32_t baseGroupZ, |
| 14974 | uint32_t groupCountX, |
| 14975 | uint32_t groupCountY, |
| 14976 | uint32_t groupCountZ) |
| 14977 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 14978 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 14979 | AEMU_SCOPED_TRACE("vkCmdDispatchBaseKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14980 | mImpl->log("start vkCmdDispatchBaseKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14981 | auto stream = mImpl->stream(); |
| 14982 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14983 | auto resources = mImpl->resources(); |
| 14984 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14985 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14986 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14987 | uint32_t local_baseGroupX; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14988 | uint32_t local_baseGroupY; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14989 | uint32_t local_baseGroupZ; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14990 | uint32_t local_groupCountX; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14991 | uint32_t local_groupCountY; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14992 | uint32_t local_groupCountZ; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 14993 | local_commandBuffer = commandBuffer; |
| 14994 | local_baseGroupX = baseGroupX; |
| 14995 | local_baseGroupY = baseGroupY; |
| 14996 | local_baseGroupZ = baseGroupZ; |
| 14997 | local_groupCountX = groupCountX; |
| 14998 | local_groupCountY = groupCountY; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14999 | local_groupCountZ = groupCountZ; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15000 | countingStream->rewind(); |
| 15001 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15002 | uint64_t cgen_var_1007; |
| 15003 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1007, 1); |
| 15004 | countingStream->write((uint64_t*)&cgen_var_1007, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15005 | countingStream->write((uint32_t*)&local_baseGroupX, sizeof(uint32_t)); |
| 15006 | countingStream->write((uint32_t*)&local_baseGroupY, sizeof(uint32_t)); |
| 15007 | countingStream->write((uint32_t*)&local_baseGroupZ, sizeof(uint32_t)); |
| 15008 | countingStream->write((uint32_t*)&local_groupCountX, sizeof(uint32_t)); |
| 15009 | countingStream->write((uint32_t*)&local_groupCountY, sizeof(uint32_t)); |
| 15010 | countingStream->write((uint32_t*)&local_groupCountZ, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15011 | } |
| 15012 | uint32_t packetSize_vkCmdDispatchBaseKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 15013 | countingStream->rewind(); |
| 15014 | uint32_t opcode_vkCmdDispatchBaseKHR = OP_vkCmdDispatchBaseKHR; |
| 15015 | stream->write(&opcode_vkCmdDispatchBaseKHR, sizeof(uint32_t)); |
| 15016 | stream->write(&packetSize_vkCmdDispatchBaseKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15017 | uint64_t cgen_var_1008; |
| 15018 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1008, 1); |
| 15019 | stream->write((uint64_t*)&cgen_var_1008, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15020 | stream->write((uint32_t*)&local_baseGroupX, sizeof(uint32_t)); |
| 15021 | stream->write((uint32_t*)&local_baseGroupY, sizeof(uint32_t)); |
| 15022 | stream->write((uint32_t*)&local_baseGroupZ, sizeof(uint32_t)); |
| 15023 | stream->write((uint32_t*)&local_groupCountX, sizeof(uint32_t)); |
| 15024 | stream->write((uint32_t*)&local_groupCountY, sizeof(uint32_t)); |
| 15025 | stream->write((uint32_t*)&local_groupCountZ, sizeof(uint32_t)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 15026 | AEMU_SCOPED_TRACE("vkCmdDispatchBaseKHR readParams"); |
| 15027 | AEMU_SCOPED_TRACE("vkCmdDispatchBaseKHR returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15028 | mImpl->log("finish vkCmdDispatchBaseKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15029 | } |
| 15030 | |
| 15031 | #endif |
| 15032 | #ifdef VK_KHR_shader_draw_parameters |
| 15033 | #endif |
| 15034 | #ifdef VK_KHR_maintenance1 |
| 15035 | void VkEncoder::vkTrimCommandPoolKHR( |
| 15036 | VkDevice device, |
| 15037 | VkCommandPool commandPool, |
| 15038 | VkCommandPoolTrimFlags flags) |
| 15039 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 15040 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 15041 | AEMU_SCOPED_TRACE("vkTrimCommandPoolKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15042 | mImpl->log("start vkTrimCommandPoolKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15043 | auto stream = mImpl->stream(); |
| 15044 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15045 | auto resources = mImpl->resources(); |
| 15046 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 15047 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15048 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15049 | VkCommandPool local_commandPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15050 | VkCommandPoolTrimFlags local_flags; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 15051 | local_device = device; |
| 15052 | local_commandPool = commandPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15053 | local_flags = flags; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15054 | countingStream->rewind(); |
| 15055 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15056 | uint64_t cgen_var_1009; |
| 15057 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1009, 1); |
| 15058 | countingStream->write((uint64_t*)&cgen_var_1009, 1 * 8); |
| 15059 | uint64_t cgen_var_1010; |
| 15060 | countingStream->handleMapping()->mapHandles_VkCommandPool_u64(&local_commandPool, &cgen_var_1010, 1); |
| 15061 | countingStream->write((uint64_t*)&cgen_var_1010, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15062 | countingStream->write((VkCommandPoolTrimFlags*)&local_flags, sizeof(VkCommandPoolTrimFlags)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15063 | } |
| 15064 | uint32_t packetSize_vkTrimCommandPoolKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 15065 | countingStream->rewind(); |
| 15066 | uint32_t opcode_vkTrimCommandPoolKHR = OP_vkTrimCommandPoolKHR; |
| 15067 | stream->write(&opcode_vkTrimCommandPoolKHR, sizeof(uint32_t)); |
| 15068 | stream->write(&packetSize_vkTrimCommandPoolKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15069 | uint64_t cgen_var_1011; |
| 15070 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1011, 1); |
| 15071 | stream->write((uint64_t*)&cgen_var_1011, 1 * 8); |
| 15072 | uint64_t cgen_var_1012; |
| 15073 | stream->handleMapping()->mapHandles_VkCommandPool_u64(&local_commandPool, &cgen_var_1012, 1); |
| 15074 | stream->write((uint64_t*)&cgen_var_1012, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15075 | stream->write((VkCommandPoolTrimFlags*)&local_flags, sizeof(VkCommandPoolTrimFlags)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 15076 | AEMU_SCOPED_TRACE("vkTrimCommandPoolKHR readParams"); |
| 15077 | AEMU_SCOPED_TRACE("vkTrimCommandPoolKHR returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15078 | mImpl->log("finish vkTrimCommandPoolKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15079 | } |
| 15080 | |
| 15081 | #endif |
| 15082 | #ifdef VK_KHR_device_group_creation |
| 15083 | VkResult VkEncoder::vkEnumeratePhysicalDeviceGroupsKHR( |
| 15084 | VkInstance instance, |
| 15085 | uint32_t* pPhysicalDeviceGroupCount, |
| 15086 | VkPhysicalDeviceGroupProperties* pPhysicalDeviceGroupProperties) |
| 15087 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 15088 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 15089 | AEMU_SCOPED_TRACE("vkEnumeratePhysicalDeviceGroupsKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15090 | mImpl->log("start vkEnumeratePhysicalDeviceGroupsKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15091 | auto stream = mImpl->stream(); |
| 15092 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15093 | auto resources = mImpl->resources(); |
| 15094 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 15095 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15096 | VkInstance local_instance; |
| 15097 | local_instance = instance; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15098 | countingStream->rewind(); |
| 15099 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15100 | uint64_t cgen_var_1013; |
| 15101 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1013, 1); |
| 15102 | countingStream->write((uint64_t*)&cgen_var_1013, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 15103 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15104 | uint64_t cgen_var_1014 = (uint64_t)(uintptr_t)pPhysicalDeviceGroupCount; |
| 15105 | countingStream->putBe64(cgen_var_1014); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15106 | if (pPhysicalDeviceGroupCount) |
| 15107 | { |
| 15108 | countingStream->write((uint32_t*)pPhysicalDeviceGroupCount, sizeof(uint32_t)); |
| 15109 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 15110 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15111 | uint64_t cgen_var_1015 = (uint64_t)(uintptr_t)pPhysicalDeviceGroupProperties; |
| 15112 | countingStream->putBe64(cgen_var_1015); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15113 | if (pPhysicalDeviceGroupProperties) |
| 15114 | { |
| 15115 | for (uint32_t i = 0; i < (uint32_t)(*(pPhysicalDeviceGroupCount)); ++i) |
| 15116 | { |
| 15117 | marshal_VkPhysicalDeviceGroupProperties(countingStream, (VkPhysicalDeviceGroupProperties*)(pPhysicalDeviceGroupProperties + i)); |
| 15118 | } |
| 15119 | } |
| 15120 | } |
| 15121 | uint32_t packetSize_vkEnumeratePhysicalDeviceGroupsKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 15122 | countingStream->rewind(); |
| 15123 | uint32_t opcode_vkEnumeratePhysicalDeviceGroupsKHR = OP_vkEnumeratePhysicalDeviceGroupsKHR; |
| 15124 | stream->write(&opcode_vkEnumeratePhysicalDeviceGroupsKHR, sizeof(uint32_t)); |
| 15125 | stream->write(&packetSize_vkEnumeratePhysicalDeviceGroupsKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15126 | uint64_t cgen_var_1016; |
| 15127 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1016, 1); |
| 15128 | stream->write((uint64_t*)&cgen_var_1016, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 15129 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15130 | uint64_t cgen_var_1017 = (uint64_t)(uintptr_t)pPhysicalDeviceGroupCount; |
| 15131 | stream->putBe64(cgen_var_1017); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15132 | if (pPhysicalDeviceGroupCount) |
| 15133 | { |
| 15134 | stream->write((uint32_t*)pPhysicalDeviceGroupCount, sizeof(uint32_t)); |
| 15135 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 15136 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15137 | uint64_t cgen_var_1018 = (uint64_t)(uintptr_t)pPhysicalDeviceGroupProperties; |
| 15138 | stream->putBe64(cgen_var_1018); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15139 | if (pPhysicalDeviceGroupProperties) |
| 15140 | { |
| 15141 | for (uint32_t i = 0; i < (uint32_t)(*(pPhysicalDeviceGroupCount)); ++i) |
| 15142 | { |
| 15143 | marshal_VkPhysicalDeviceGroupProperties(stream, (VkPhysicalDeviceGroupProperties*)(pPhysicalDeviceGroupProperties + i)); |
| 15144 | } |
| 15145 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 15146 | AEMU_SCOPED_TRACE("vkEnumeratePhysicalDeviceGroupsKHR readParams"); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 15147 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15148 | uint32_t* check_pPhysicalDeviceGroupCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 15149 | check_pPhysicalDeviceGroupCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15150 | if (pPhysicalDeviceGroupCount) |
| 15151 | { |
| 15152 | if (!(check_pPhysicalDeviceGroupCount)) |
| 15153 | { |
| 15154 | fprintf(stderr, "fatal: pPhysicalDeviceGroupCount inconsistent between guest and host\n"); |
| 15155 | } |
| 15156 | stream->read((uint32_t*)pPhysicalDeviceGroupCount, sizeof(uint32_t)); |
| 15157 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 15158 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15159 | VkPhysicalDeviceGroupProperties* check_pPhysicalDeviceGroupProperties; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 15160 | check_pPhysicalDeviceGroupProperties = (VkPhysicalDeviceGroupProperties*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15161 | if (pPhysicalDeviceGroupProperties) |
| 15162 | { |
| 15163 | if (!(check_pPhysicalDeviceGroupProperties)) |
| 15164 | { |
| 15165 | fprintf(stderr, "fatal: pPhysicalDeviceGroupProperties inconsistent between guest and host\n"); |
| 15166 | } |
| 15167 | for (uint32_t i = 0; i < (uint32_t)(*(pPhysicalDeviceGroupCount)); ++i) |
| 15168 | { |
| 15169 | unmarshal_VkPhysicalDeviceGroupProperties(stream, (VkPhysicalDeviceGroupProperties*)(pPhysicalDeviceGroupProperties + i)); |
| 15170 | } |
| 15171 | } |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 15172 | if (pPhysicalDeviceGroupProperties) |
| 15173 | { |
| 15174 | for (uint32_t i = 0; i < (uint32_t)(*(pPhysicalDeviceGroupCount)); ++i) |
| 15175 | { |
| 15176 | transform_fromhost_VkPhysicalDeviceGroupProperties(mImpl->resources(), (VkPhysicalDeviceGroupProperties*)(pPhysicalDeviceGroupProperties + i)); |
| 15177 | } |
| 15178 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 15179 | AEMU_SCOPED_TRACE("vkEnumeratePhysicalDeviceGroupsKHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15180 | VkResult vkEnumeratePhysicalDeviceGroupsKHR_VkResult_return = (VkResult)0; |
| 15181 | stream->read(&vkEnumeratePhysicalDeviceGroupsKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15182 | countingStream->clearPool(); |
| 15183 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 15184 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15185 | mImpl->log("finish vkEnumeratePhysicalDeviceGroupsKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15186 | return vkEnumeratePhysicalDeviceGroupsKHR_VkResult_return; |
| 15187 | } |
| 15188 | |
| 15189 | #endif |
| 15190 | #ifdef VK_KHR_external_memory_capabilities |
| 15191 | void VkEncoder::vkGetPhysicalDeviceExternalBufferPropertiesKHR( |
| 15192 | VkPhysicalDevice physicalDevice, |
| 15193 | const VkPhysicalDeviceExternalBufferInfo* pExternalBufferInfo, |
| 15194 | VkExternalBufferProperties* pExternalBufferProperties) |
| 15195 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 15196 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 15197 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceExternalBufferPropertiesKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15198 | mImpl->log("start vkGetPhysicalDeviceExternalBufferPropertiesKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15199 | auto stream = mImpl->stream(); |
| 15200 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15201 | auto resources = mImpl->resources(); |
| 15202 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 15203 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15204 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15205 | VkPhysicalDeviceExternalBufferInfo* local_pExternalBufferInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 15206 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15207 | local_pExternalBufferInfo = nullptr; |
| 15208 | if (pExternalBufferInfo) |
| 15209 | { |
| 15210 | local_pExternalBufferInfo = (VkPhysicalDeviceExternalBufferInfo*)pool->alloc(sizeof(const VkPhysicalDeviceExternalBufferInfo)); |
| 15211 | deepcopy_VkPhysicalDeviceExternalBufferInfo(pool, pExternalBufferInfo, (VkPhysicalDeviceExternalBufferInfo*)(local_pExternalBufferInfo)); |
| 15212 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 15213 | if (local_pExternalBufferInfo) |
| 15214 | { |
| Lingfeng Yang | 2b1b8cf | 2019-02-08 09:53:36 -0800 | [diff] [blame] | 15215 | mImpl->resources()->transformImpl_VkPhysicalDeviceExternalBufferInfo_tohost(local_pExternalBufferInfo, 1); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 15216 | transform_tohost_VkPhysicalDeviceExternalBufferInfo(mImpl->resources(), (VkPhysicalDeviceExternalBufferInfo*)(local_pExternalBufferInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 15217 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15218 | countingStream->rewind(); |
| 15219 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15220 | uint64_t cgen_var_1021; |
| 15221 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1021, 1); |
| 15222 | countingStream->write((uint64_t*)&cgen_var_1021, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15223 | marshal_VkPhysicalDeviceExternalBufferInfo(countingStream, (VkPhysicalDeviceExternalBufferInfo*)(local_pExternalBufferInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15224 | marshal_VkExternalBufferProperties(countingStream, (VkExternalBufferProperties*)(pExternalBufferProperties)); |
| 15225 | } |
| 15226 | uint32_t packetSize_vkGetPhysicalDeviceExternalBufferPropertiesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 15227 | countingStream->rewind(); |
| 15228 | uint32_t opcode_vkGetPhysicalDeviceExternalBufferPropertiesKHR = OP_vkGetPhysicalDeviceExternalBufferPropertiesKHR; |
| 15229 | stream->write(&opcode_vkGetPhysicalDeviceExternalBufferPropertiesKHR, sizeof(uint32_t)); |
| 15230 | stream->write(&packetSize_vkGetPhysicalDeviceExternalBufferPropertiesKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15231 | uint64_t cgen_var_1022; |
| 15232 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1022, 1); |
| 15233 | stream->write((uint64_t*)&cgen_var_1022, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15234 | marshal_VkPhysicalDeviceExternalBufferInfo(stream, (VkPhysicalDeviceExternalBufferInfo*)(local_pExternalBufferInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15235 | marshal_VkExternalBufferProperties(stream, (VkExternalBufferProperties*)(pExternalBufferProperties)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 15236 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceExternalBufferPropertiesKHR readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15237 | unmarshal_VkExternalBufferProperties(stream, (VkExternalBufferProperties*)(pExternalBufferProperties)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 15238 | if (pExternalBufferProperties) |
| 15239 | { |
| Lingfeng Yang | 2b1b8cf | 2019-02-08 09:53:36 -0800 | [diff] [blame] | 15240 | mImpl->resources()->transformImpl_VkExternalBufferProperties_fromhost(pExternalBufferProperties, 1); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 15241 | transform_fromhost_VkExternalBufferProperties(mImpl->resources(), (VkExternalBufferProperties*)(pExternalBufferProperties)); |
| 15242 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 15243 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceExternalBufferPropertiesKHR returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15244 | mImpl->log("finish vkGetPhysicalDeviceExternalBufferPropertiesKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15245 | } |
| 15246 | |
| 15247 | #endif |
| 15248 | #ifdef VK_KHR_external_memory |
| 15249 | #endif |
| 15250 | #ifdef VK_KHR_external_memory_win32 |
| 15251 | VkResult VkEncoder::vkGetMemoryWin32HandleKHR( |
| 15252 | VkDevice device, |
| 15253 | const VkMemoryGetWin32HandleInfoKHR* pGetWin32HandleInfo, |
| 15254 | HANDLE* pHandle) |
| 15255 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 15256 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 15257 | AEMU_SCOPED_TRACE("vkGetMemoryWin32HandleKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15258 | mImpl->log("start vkGetMemoryWin32HandleKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15259 | auto stream = mImpl->stream(); |
| 15260 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15261 | auto resources = mImpl->resources(); |
| 15262 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 15263 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15264 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15265 | VkMemoryGetWin32HandleInfoKHR* local_pGetWin32HandleInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 15266 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15267 | local_pGetWin32HandleInfo = nullptr; |
| 15268 | if (pGetWin32HandleInfo) |
| 15269 | { |
| 15270 | local_pGetWin32HandleInfo = (VkMemoryGetWin32HandleInfoKHR*)pool->alloc(sizeof(const VkMemoryGetWin32HandleInfoKHR)); |
| 15271 | deepcopy_VkMemoryGetWin32HandleInfoKHR(pool, pGetWin32HandleInfo, (VkMemoryGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo)); |
| 15272 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 15273 | if (local_pGetWin32HandleInfo) |
| 15274 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 15275 | transform_tohost_VkMemoryGetWin32HandleInfoKHR(mImpl->resources(), (VkMemoryGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 15276 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15277 | countingStream->rewind(); |
| 15278 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15279 | uint64_t cgen_var_1023; |
| 15280 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1023, 1); |
| 15281 | countingStream->write((uint64_t*)&cgen_var_1023, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15282 | marshal_VkMemoryGetWin32HandleInfoKHR(countingStream, (VkMemoryGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15283 | countingStream->write((HANDLE*)pHandle, sizeof(HANDLE)); |
| 15284 | } |
| 15285 | uint32_t packetSize_vkGetMemoryWin32HandleKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 15286 | countingStream->rewind(); |
| 15287 | uint32_t opcode_vkGetMemoryWin32HandleKHR = OP_vkGetMemoryWin32HandleKHR; |
| 15288 | stream->write(&opcode_vkGetMemoryWin32HandleKHR, sizeof(uint32_t)); |
| 15289 | stream->write(&packetSize_vkGetMemoryWin32HandleKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15290 | uint64_t cgen_var_1024; |
| 15291 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1024, 1); |
| 15292 | stream->write((uint64_t*)&cgen_var_1024, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15293 | marshal_VkMemoryGetWin32HandleInfoKHR(stream, (VkMemoryGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15294 | stream->write((HANDLE*)pHandle, sizeof(HANDLE)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 15295 | AEMU_SCOPED_TRACE("vkGetMemoryWin32HandleKHR readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15296 | stream->read((HANDLE*)pHandle, sizeof(HANDLE)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 15297 | AEMU_SCOPED_TRACE("vkGetMemoryWin32HandleKHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15298 | VkResult vkGetMemoryWin32HandleKHR_VkResult_return = (VkResult)0; |
| 15299 | stream->read(&vkGetMemoryWin32HandleKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15300 | countingStream->clearPool(); |
| 15301 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 15302 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15303 | mImpl->log("finish vkGetMemoryWin32HandleKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15304 | return vkGetMemoryWin32HandleKHR_VkResult_return; |
| 15305 | } |
| 15306 | |
| 15307 | VkResult VkEncoder::vkGetMemoryWin32HandlePropertiesKHR( |
| 15308 | VkDevice device, |
| 15309 | VkExternalMemoryHandleTypeFlagBits handleType, |
| 15310 | HANDLE handle, |
| 15311 | VkMemoryWin32HandlePropertiesKHR* pMemoryWin32HandleProperties) |
| 15312 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 15313 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 15314 | AEMU_SCOPED_TRACE("vkGetMemoryWin32HandlePropertiesKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15315 | mImpl->log("start vkGetMemoryWin32HandlePropertiesKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15316 | auto stream = mImpl->stream(); |
| 15317 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15318 | auto resources = mImpl->resources(); |
| 15319 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 15320 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15321 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15322 | VkExternalMemoryHandleTypeFlagBits local_handleType; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15323 | HANDLE local_handle; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 15324 | local_device = device; |
| 15325 | local_handleType = handleType; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15326 | local_handle = handle; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15327 | countingStream->rewind(); |
| 15328 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15329 | uint64_t cgen_var_1025; |
| 15330 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1025, 1); |
| 15331 | countingStream->write((uint64_t*)&cgen_var_1025, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15332 | countingStream->write((VkExternalMemoryHandleTypeFlagBits*)&local_handleType, sizeof(VkExternalMemoryHandleTypeFlagBits)); |
| 15333 | countingStream->write((HANDLE*)&local_handle, sizeof(HANDLE)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15334 | marshal_VkMemoryWin32HandlePropertiesKHR(countingStream, (VkMemoryWin32HandlePropertiesKHR*)(pMemoryWin32HandleProperties)); |
| 15335 | } |
| 15336 | uint32_t packetSize_vkGetMemoryWin32HandlePropertiesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 15337 | countingStream->rewind(); |
| 15338 | uint32_t opcode_vkGetMemoryWin32HandlePropertiesKHR = OP_vkGetMemoryWin32HandlePropertiesKHR; |
| 15339 | stream->write(&opcode_vkGetMemoryWin32HandlePropertiesKHR, sizeof(uint32_t)); |
| 15340 | stream->write(&packetSize_vkGetMemoryWin32HandlePropertiesKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15341 | uint64_t cgen_var_1026; |
| 15342 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1026, 1); |
| 15343 | stream->write((uint64_t*)&cgen_var_1026, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15344 | stream->write((VkExternalMemoryHandleTypeFlagBits*)&local_handleType, sizeof(VkExternalMemoryHandleTypeFlagBits)); |
| 15345 | stream->write((HANDLE*)&local_handle, sizeof(HANDLE)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15346 | marshal_VkMemoryWin32HandlePropertiesKHR(stream, (VkMemoryWin32HandlePropertiesKHR*)(pMemoryWin32HandleProperties)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 15347 | AEMU_SCOPED_TRACE("vkGetMemoryWin32HandlePropertiesKHR readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15348 | unmarshal_VkMemoryWin32HandlePropertiesKHR(stream, (VkMemoryWin32HandlePropertiesKHR*)(pMemoryWin32HandleProperties)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 15349 | if (pMemoryWin32HandleProperties) |
| 15350 | { |
| 15351 | transform_fromhost_VkMemoryWin32HandlePropertiesKHR(mImpl->resources(), (VkMemoryWin32HandlePropertiesKHR*)(pMemoryWin32HandleProperties)); |
| 15352 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 15353 | AEMU_SCOPED_TRACE("vkGetMemoryWin32HandlePropertiesKHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15354 | VkResult vkGetMemoryWin32HandlePropertiesKHR_VkResult_return = (VkResult)0; |
| 15355 | stream->read(&vkGetMemoryWin32HandlePropertiesKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15356 | countingStream->clearPool(); |
| 15357 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 15358 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15359 | mImpl->log("finish vkGetMemoryWin32HandlePropertiesKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15360 | return vkGetMemoryWin32HandlePropertiesKHR_VkResult_return; |
| 15361 | } |
| 15362 | |
| 15363 | #endif |
| 15364 | #ifdef VK_KHR_external_memory_fd |
| 15365 | VkResult VkEncoder::vkGetMemoryFdKHR( |
| 15366 | VkDevice device, |
| 15367 | const VkMemoryGetFdInfoKHR* pGetFdInfo, |
| 15368 | int* pFd) |
| 15369 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 15370 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 15371 | AEMU_SCOPED_TRACE("vkGetMemoryFdKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15372 | mImpl->log("start vkGetMemoryFdKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15373 | auto stream = mImpl->stream(); |
| 15374 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15375 | auto resources = mImpl->resources(); |
| 15376 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 15377 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15378 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15379 | VkMemoryGetFdInfoKHR* local_pGetFdInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 15380 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15381 | local_pGetFdInfo = nullptr; |
| 15382 | if (pGetFdInfo) |
| 15383 | { |
| 15384 | local_pGetFdInfo = (VkMemoryGetFdInfoKHR*)pool->alloc(sizeof(const VkMemoryGetFdInfoKHR)); |
| 15385 | deepcopy_VkMemoryGetFdInfoKHR(pool, pGetFdInfo, (VkMemoryGetFdInfoKHR*)(local_pGetFdInfo)); |
| 15386 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 15387 | if (local_pGetFdInfo) |
| 15388 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 15389 | transform_tohost_VkMemoryGetFdInfoKHR(mImpl->resources(), (VkMemoryGetFdInfoKHR*)(local_pGetFdInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 15390 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15391 | countingStream->rewind(); |
| 15392 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15393 | uint64_t cgen_var_1027; |
| 15394 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1027, 1); |
| 15395 | countingStream->write((uint64_t*)&cgen_var_1027, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15396 | marshal_VkMemoryGetFdInfoKHR(countingStream, (VkMemoryGetFdInfoKHR*)(local_pGetFdInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15397 | countingStream->write((int*)pFd, sizeof(int)); |
| 15398 | } |
| 15399 | uint32_t packetSize_vkGetMemoryFdKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 15400 | countingStream->rewind(); |
| 15401 | uint32_t opcode_vkGetMemoryFdKHR = OP_vkGetMemoryFdKHR; |
| 15402 | stream->write(&opcode_vkGetMemoryFdKHR, sizeof(uint32_t)); |
| 15403 | stream->write(&packetSize_vkGetMemoryFdKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15404 | uint64_t cgen_var_1028; |
| 15405 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1028, 1); |
| 15406 | stream->write((uint64_t*)&cgen_var_1028, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15407 | marshal_VkMemoryGetFdInfoKHR(stream, (VkMemoryGetFdInfoKHR*)(local_pGetFdInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15408 | stream->write((int*)pFd, sizeof(int)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 15409 | AEMU_SCOPED_TRACE("vkGetMemoryFdKHR readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15410 | stream->read((int*)pFd, sizeof(int)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 15411 | AEMU_SCOPED_TRACE("vkGetMemoryFdKHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15412 | VkResult vkGetMemoryFdKHR_VkResult_return = (VkResult)0; |
| 15413 | stream->read(&vkGetMemoryFdKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15414 | countingStream->clearPool(); |
| 15415 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 15416 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15417 | mImpl->log("finish vkGetMemoryFdKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15418 | return vkGetMemoryFdKHR_VkResult_return; |
| 15419 | } |
| 15420 | |
| 15421 | VkResult VkEncoder::vkGetMemoryFdPropertiesKHR( |
| 15422 | VkDevice device, |
| 15423 | VkExternalMemoryHandleTypeFlagBits handleType, |
| 15424 | int fd, |
| 15425 | VkMemoryFdPropertiesKHR* pMemoryFdProperties) |
| 15426 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 15427 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 15428 | AEMU_SCOPED_TRACE("vkGetMemoryFdPropertiesKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15429 | mImpl->log("start vkGetMemoryFdPropertiesKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15430 | auto stream = mImpl->stream(); |
| 15431 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15432 | auto resources = mImpl->resources(); |
| 15433 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 15434 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15435 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15436 | VkExternalMemoryHandleTypeFlagBits local_handleType; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15437 | int local_fd; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 15438 | local_device = device; |
| 15439 | local_handleType = handleType; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15440 | local_fd = fd; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15441 | countingStream->rewind(); |
| 15442 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15443 | uint64_t cgen_var_1029; |
| 15444 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1029, 1); |
| 15445 | countingStream->write((uint64_t*)&cgen_var_1029, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15446 | countingStream->write((VkExternalMemoryHandleTypeFlagBits*)&local_handleType, sizeof(VkExternalMemoryHandleTypeFlagBits)); |
| 15447 | countingStream->write((int*)&local_fd, sizeof(int)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15448 | marshal_VkMemoryFdPropertiesKHR(countingStream, (VkMemoryFdPropertiesKHR*)(pMemoryFdProperties)); |
| 15449 | } |
| 15450 | uint32_t packetSize_vkGetMemoryFdPropertiesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 15451 | countingStream->rewind(); |
| 15452 | uint32_t opcode_vkGetMemoryFdPropertiesKHR = OP_vkGetMemoryFdPropertiesKHR; |
| 15453 | stream->write(&opcode_vkGetMemoryFdPropertiesKHR, sizeof(uint32_t)); |
| 15454 | stream->write(&packetSize_vkGetMemoryFdPropertiesKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15455 | uint64_t cgen_var_1030; |
| 15456 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1030, 1); |
| 15457 | stream->write((uint64_t*)&cgen_var_1030, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15458 | stream->write((VkExternalMemoryHandleTypeFlagBits*)&local_handleType, sizeof(VkExternalMemoryHandleTypeFlagBits)); |
| 15459 | stream->write((int*)&local_fd, sizeof(int)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15460 | marshal_VkMemoryFdPropertiesKHR(stream, (VkMemoryFdPropertiesKHR*)(pMemoryFdProperties)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 15461 | AEMU_SCOPED_TRACE("vkGetMemoryFdPropertiesKHR readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15462 | unmarshal_VkMemoryFdPropertiesKHR(stream, (VkMemoryFdPropertiesKHR*)(pMemoryFdProperties)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 15463 | if (pMemoryFdProperties) |
| 15464 | { |
| 15465 | transform_fromhost_VkMemoryFdPropertiesKHR(mImpl->resources(), (VkMemoryFdPropertiesKHR*)(pMemoryFdProperties)); |
| 15466 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 15467 | AEMU_SCOPED_TRACE("vkGetMemoryFdPropertiesKHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15468 | VkResult vkGetMemoryFdPropertiesKHR_VkResult_return = (VkResult)0; |
| 15469 | stream->read(&vkGetMemoryFdPropertiesKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15470 | countingStream->clearPool(); |
| 15471 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 15472 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15473 | mImpl->log("finish vkGetMemoryFdPropertiesKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15474 | return vkGetMemoryFdPropertiesKHR_VkResult_return; |
| 15475 | } |
| 15476 | |
| 15477 | #endif |
| 15478 | #ifdef VK_KHR_win32_keyed_mutex |
| 15479 | #endif |
| 15480 | #ifdef VK_KHR_external_semaphore_capabilities |
| 15481 | void VkEncoder::vkGetPhysicalDeviceExternalSemaphorePropertiesKHR( |
| 15482 | VkPhysicalDevice physicalDevice, |
| 15483 | const VkPhysicalDeviceExternalSemaphoreInfo* pExternalSemaphoreInfo, |
| 15484 | VkExternalSemaphoreProperties* pExternalSemaphoreProperties) |
| 15485 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 15486 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 15487 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceExternalSemaphorePropertiesKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15488 | mImpl->log("start vkGetPhysicalDeviceExternalSemaphorePropertiesKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15489 | auto stream = mImpl->stream(); |
| 15490 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15491 | auto resources = mImpl->resources(); |
| 15492 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 15493 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15494 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15495 | VkPhysicalDeviceExternalSemaphoreInfo* local_pExternalSemaphoreInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 15496 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15497 | local_pExternalSemaphoreInfo = nullptr; |
| 15498 | if (pExternalSemaphoreInfo) |
| 15499 | { |
| 15500 | local_pExternalSemaphoreInfo = (VkPhysicalDeviceExternalSemaphoreInfo*)pool->alloc(sizeof(const VkPhysicalDeviceExternalSemaphoreInfo)); |
| 15501 | deepcopy_VkPhysicalDeviceExternalSemaphoreInfo(pool, pExternalSemaphoreInfo, (VkPhysicalDeviceExternalSemaphoreInfo*)(local_pExternalSemaphoreInfo)); |
| 15502 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 15503 | if (local_pExternalSemaphoreInfo) |
| 15504 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 15505 | transform_tohost_VkPhysicalDeviceExternalSemaphoreInfo(mImpl->resources(), (VkPhysicalDeviceExternalSemaphoreInfo*)(local_pExternalSemaphoreInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 15506 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15507 | countingStream->rewind(); |
| 15508 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15509 | uint64_t cgen_var_1031; |
| 15510 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1031, 1); |
| 15511 | countingStream->write((uint64_t*)&cgen_var_1031, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15512 | marshal_VkPhysicalDeviceExternalSemaphoreInfo(countingStream, (VkPhysicalDeviceExternalSemaphoreInfo*)(local_pExternalSemaphoreInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15513 | marshal_VkExternalSemaphoreProperties(countingStream, (VkExternalSemaphoreProperties*)(pExternalSemaphoreProperties)); |
| 15514 | } |
| 15515 | uint32_t packetSize_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 15516 | countingStream->rewind(); |
| 15517 | uint32_t opcode_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR = OP_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR; |
| 15518 | stream->write(&opcode_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR, sizeof(uint32_t)); |
| 15519 | stream->write(&packetSize_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15520 | uint64_t cgen_var_1032; |
| 15521 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1032, 1); |
| 15522 | stream->write((uint64_t*)&cgen_var_1032, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15523 | marshal_VkPhysicalDeviceExternalSemaphoreInfo(stream, (VkPhysicalDeviceExternalSemaphoreInfo*)(local_pExternalSemaphoreInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15524 | marshal_VkExternalSemaphoreProperties(stream, (VkExternalSemaphoreProperties*)(pExternalSemaphoreProperties)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 15525 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceExternalSemaphorePropertiesKHR readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15526 | unmarshal_VkExternalSemaphoreProperties(stream, (VkExternalSemaphoreProperties*)(pExternalSemaphoreProperties)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 15527 | if (pExternalSemaphoreProperties) |
| 15528 | { |
| 15529 | transform_fromhost_VkExternalSemaphoreProperties(mImpl->resources(), (VkExternalSemaphoreProperties*)(pExternalSemaphoreProperties)); |
| 15530 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 15531 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceExternalSemaphorePropertiesKHR returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15532 | mImpl->log("finish vkGetPhysicalDeviceExternalSemaphorePropertiesKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15533 | } |
| 15534 | |
| 15535 | #endif |
| 15536 | #ifdef VK_KHR_external_semaphore |
| 15537 | #endif |
| 15538 | #ifdef VK_KHR_external_semaphore_win32 |
| 15539 | VkResult VkEncoder::vkImportSemaphoreWin32HandleKHR( |
| 15540 | VkDevice device, |
| 15541 | const VkImportSemaphoreWin32HandleInfoKHR* pImportSemaphoreWin32HandleInfo) |
| 15542 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 15543 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 15544 | AEMU_SCOPED_TRACE("vkImportSemaphoreWin32HandleKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15545 | mImpl->log("start vkImportSemaphoreWin32HandleKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15546 | auto stream = mImpl->stream(); |
| 15547 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15548 | auto resources = mImpl->resources(); |
| 15549 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 15550 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15551 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15552 | VkImportSemaphoreWin32HandleInfoKHR* local_pImportSemaphoreWin32HandleInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 15553 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15554 | local_pImportSemaphoreWin32HandleInfo = nullptr; |
| 15555 | if (pImportSemaphoreWin32HandleInfo) |
| 15556 | { |
| 15557 | local_pImportSemaphoreWin32HandleInfo = (VkImportSemaphoreWin32HandleInfoKHR*)pool->alloc(sizeof(const VkImportSemaphoreWin32HandleInfoKHR)); |
| 15558 | deepcopy_VkImportSemaphoreWin32HandleInfoKHR(pool, pImportSemaphoreWin32HandleInfo, (VkImportSemaphoreWin32HandleInfoKHR*)(local_pImportSemaphoreWin32HandleInfo)); |
| 15559 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 15560 | if (local_pImportSemaphoreWin32HandleInfo) |
| 15561 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 15562 | transform_tohost_VkImportSemaphoreWin32HandleInfoKHR(mImpl->resources(), (VkImportSemaphoreWin32HandleInfoKHR*)(local_pImportSemaphoreWin32HandleInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 15563 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15564 | countingStream->rewind(); |
| 15565 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15566 | uint64_t cgen_var_1033; |
| 15567 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1033, 1); |
| 15568 | countingStream->write((uint64_t*)&cgen_var_1033, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15569 | marshal_VkImportSemaphoreWin32HandleInfoKHR(countingStream, (VkImportSemaphoreWin32HandleInfoKHR*)(local_pImportSemaphoreWin32HandleInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15570 | } |
| 15571 | uint32_t packetSize_vkImportSemaphoreWin32HandleKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 15572 | countingStream->rewind(); |
| 15573 | uint32_t opcode_vkImportSemaphoreWin32HandleKHR = OP_vkImportSemaphoreWin32HandleKHR; |
| 15574 | stream->write(&opcode_vkImportSemaphoreWin32HandleKHR, sizeof(uint32_t)); |
| 15575 | stream->write(&packetSize_vkImportSemaphoreWin32HandleKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15576 | uint64_t cgen_var_1034; |
| 15577 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1034, 1); |
| 15578 | stream->write((uint64_t*)&cgen_var_1034, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15579 | marshal_VkImportSemaphoreWin32HandleInfoKHR(stream, (VkImportSemaphoreWin32HandleInfoKHR*)(local_pImportSemaphoreWin32HandleInfo)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 15580 | AEMU_SCOPED_TRACE("vkImportSemaphoreWin32HandleKHR readParams"); |
| 15581 | AEMU_SCOPED_TRACE("vkImportSemaphoreWin32HandleKHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15582 | VkResult vkImportSemaphoreWin32HandleKHR_VkResult_return = (VkResult)0; |
| 15583 | stream->read(&vkImportSemaphoreWin32HandleKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15584 | countingStream->clearPool(); |
| 15585 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 15586 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15587 | mImpl->log("finish vkImportSemaphoreWin32HandleKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15588 | return vkImportSemaphoreWin32HandleKHR_VkResult_return; |
| 15589 | } |
| 15590 | |
| 15591 | VkResult VkEncoder::vkGetSemaphoreWin32HandleKHR( |
| 15592 | VkDevice device, |
| 15593 | const VkSemaphoreGetWin32HandleInfoKHR* pGetWin32HandleInfo, |
| 15594 | HANDLE* pHandle) |
| 15595 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 15596 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 15597 | AEMU_SCOPED_TRACE("vkGetSemaphoreWin32HandleKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15598 | mImpl->log("start vkGetSemaphoreWin32HandleKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15599 | auto stream = mImpl->stream(); |
| 15600 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15601 | auto resources = mImpl->resources(); |
| 15602 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 15603 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15604 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15605 | VkSemaphoreGetWin32HandleInfoKHR* local_pGetWin32HandleInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 15606 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15607 | local_pGetWin32HandleInfo = nullptr; |
| 15608 | if (pGetWin32HandleInfo) |
| 15609 | { |
| 15610 | local_pGetWin32HandleInfo = (VkSemaphoreGetWin32HandleInfoKHR*)pool->alloc(sizeof(const VkSemaphoreGetWin32HandleInfoKHR)); |
| 15611 | deepcopy_VkSemaphoreGetWin32HandleInfoKHR(pool, pGetWin32HandleInfo, (VkSemaphoreGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo)); |
| 15612 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 15613 | if (local_pGetWin32HandleInfo) |
| 15614 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 15615 | transform_tohost_VkSemaphoreGetWin32HandleInfoKHR(mImpl->resources(), (VkSemaphoreGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 15616 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15617 | countingStream->rewind(); |
| 15618 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15619 | uint64_t cgen_var_1035; |
| 15620 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1035, 1); |
| 15621 | countingStream->write((uint64_t*)&cgen_var_1035, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15622 | marshal_VkSemaphoreGetWin32HandleInfoKHR(countingStream, (VkSemaphoreGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15623 | countingStream->write((HANDLE*)pHandle, sizeof(HANDLE)); |
| 15624 | } |
| 15625 | uint32_t packetSize_vkGetSemaphoreWin32HandleKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 15626 | countingStream->rewind(); |
| 15627 | uint32_t opcode_vkGetSemaphoreWin32HandleKHR = OP_vkGetSemaphoreWin32HandleKHR; |
| 15628 | stream->write(&opcode_vkGetSemaphoreWin32HandleKHR, sizeof(uint32_t)); |
| 15629 | stream->write(&packetSize_vkGetSemaphoreWin32HandleKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15630 | uint64_t cgen_var_1036; |
| 15631 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1036, 1); |
| 15632 | stream->write((uint64_t*)&cgen_var_1036, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15633 | marshal_VkSemaphoreGetWin32HandleInfoKHR(stream, (VkSemaphoreGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15634 | stream->write((HANDLE*)pHandle, sizeof(HANDLE)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 15635 | AEMU_SCOPED_TRACE("vkGetSemaphoreWin32HandleKHR readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15636 | stream->read((HANDLE*)pHandle, sizeof(HANDLE)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 15637 | AEMU_SCOPED_TRACE("vkGetSemaphoreWin32HandleKHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15638 | VkResult vkGetSemaphoreWin32HandleKHR_VkResult_return = (VkResult)0; |
| 15639 | stream->read(&vkGetSemaphoreWin32HandleKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15640 | countingStream->clearPool(); |
| 15641 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 15642 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15643 | mImpl->log("finish vkGetSemaphoreWin32HandleKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15644 | return vkGetSemaphoreWin32HandleKHR_VkResult_return; |
| 15645 | } |
| 15646 | |
| 15647 | #endif |
| 15648 | #ifdef VK_KHR_external_semaphore_fd |
| 15649 | VkResult VkEncoder::vkImportSemaphoreFdKHR( |
| 15650 | VkDevice device, |
| 15651 | const VkImportSemaphoreFdInfoKHR* pImportSemaphoreFdInfo) |
| 15652 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 15653 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 15654 | AEMU_SCOPED_TRACE("vkImportSemaphoreFdKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15655 | mImpl->log("start vkImportSemaphoreFdKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15656 | auto stream = mImpl->stream(); |
| 15657 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15658 | auto resources = mImpl->resources(); |
| 15659 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 15660 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15661 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15662 | VkImportSemaphoreFdInfoKHR* local_pImportSemaphoreFdInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 15663 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15664 | local_pImportSemaphoreFdInfo = nullptr; |
| 15665 | if (pImportSemaphoreFdInfo) |
| 15666 | { |
| 15667 | local_pImportSemaphoreFdInfo = (VkImportSemaphoreFdInfoKHR*)pool->alloc(sizeof(const VkImportSemaphoreFdInfoKHR)); |
| 15668 | deepcopy_VkImportSemaphoreFdInfoKHR(pool, pImportSemaphoreFdInfo, (VkImportSemaphoreFdInfoKHR*)(local_pImportSemaphoreFdInfo)); |
| 15669 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 15670 | if (local_pImportSemaphoreFdInfo) |
| 15671 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 15672 | transform_tohost_VkImportSemaphoreFdInfoKHR(mImpl->resources(), (VkImportSemaphoreFdInfoKHR*)(local_pImportSemaphoreFdInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 15673 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15674 | countingStream->rewind(); |
| 15675 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15676 | uint64_t cgen_var_1037; |
| 15677 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1037, 1); |
| 15678 | countingStream->write((uint64_t*)&cgen_var_1037, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15679 | marshal_VkImportSemaphoreFdInfoKHR(countingStream, (VkImportSemaphoreFdInfoKHR*)(local_pImportSemaphoreFdInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15680 | } |
| 15681 | uint32_t packetSize_vkImportSemaphoreFdKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 15682 | countingStream->rewind(); |
| 15683 | uint32_t opcode_vkImportSemaphoreFdKHR = OP_vkImportSemaphoreFdKHR; |
| 15684 | stream->write(&opcode_vkImportSemaphoreFdKHR, sizeof(uint32_t)); |
| 15685 | stream->write(&packetSize_vkImportSemaphoreFdKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15686 | uint64_t cgen_var_1038; |
| 15687 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1038, 1); |
| 15688 | stream->write((uint64_t*)&cgen_var_1038, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15689 | marshal_VkImportSemaphoreFdInfoKHR(stream, (VkImportSemaphoreFdInfoKHR*)(local_pImportSemaphoreFdInfo)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 15690 | AEMU_SCOPED_TRACE("vkImportSemaphoreFdKHR readParams"); |
| 15691 | AEMU_SCOPED_TRACE("vkImportSemaphoreFdKHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15692 | VkResult vkImportSemaphoreFdKHR_VkResult_return = (VkResult)0; |
| 15693 | stream->read(&vkImportSemaphoreFdKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15694 | countingStream->clearPool(); |
| 15695 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 15696 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15697 | mImpl->log("finish vkImportSemaphoreFdKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15698 | return vkImportSemaphoreFdKHR_VkResult_return; |
| 15699 | } |
| 15700 | |
| 15701 | VkResult VkEncoder::vkGetSemaphoreFdKHR( |
| 15702 | VkDevice device, |
| 15703 | const VkSemaphoreGetFdInfoKHR* pGetFdInfo, |
| 15704 | int* pFd) |
| 15705 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 15706 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 15707 | AEMU_SCOPED_TRACE("vkGetSemaphoreFdKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15708 | mImpl->log("start vkGetSemaphoreFdKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15709 | auto stream = mImpl->stream(); |
| 15710 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15711 | auto resources = mImpl->resources(); |
| 15712 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 15713 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15714 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15715 | VkSemaphoreGetFdInfoKHR* local_pGetFdInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 15716 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15717 | local_pGetFdInfo = nullptr; |
| 15718 | if (pGetFdInfo) |
| 15719 | { |
| 15720 | local_pGetFdInfo = (VkSemaphoreGetFdInfoKHR*)pool->alloc(sizeof(const VkSemaphoreGetFdInfoKHR)); |
| 15721 | deepcopy_VkSemaphoreGetFdInfoKHR(pool, pGetFdInfo, (VkSemaphoreGetFdInfoKHR*)(local_pGetFdInfo)); |
| 15722 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 15723 | if (local_pGetFdInfo) |
| 15724 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 15725 | transform_tohost_VkSemaphoreGetFdInfoKHR(mImpl->resources(), (VkSemaphoreGetFdInfoKHR*)(local_pGetFdInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 15726 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15727 | countingStream->rewind(); |
| 15728 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15729 | uint64_t cgen_var_1039; |
| 15730 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1039, 1); |
| 15731 | countingStream->write((uint64_t*)&cgen_var_1039, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15732 | marshal_VkSemaphoreGetFdInfoKHR(countingStream, (VkSemaphoreGetFdInfoKHR*)(local_pGetFdInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15733 | countingStream->write((int*)pFd, sizeof(int)); |
| 15734 | } |
| 15735 | uint32_t packetSize_vkGetSemaphoreFdKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 15736 | countingStream->rewind(); |
| 15737 | uint32_t opcode_vkGetSemaphoreFdKHR = OP_vkGetSemaphoreFdKHR; |
| 15738 | stream->write(&opcode_vkGetSemaphoreFdKHR, sizeof(uint32_t)); |
| 15739 | stream->write(&packetSize_vkGetSemaphoreFdKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15740 | uint64_t cgen_var_1040; |
| 15741 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1040, 1); |
| 15742 | stream->write((uint64_t*)&cgen_var_1040, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15743 | marshal_VkSemaphoreGetFdInfoKHR(stream, (VkSemaphoreGetFdInfoKHR*)(local_pGetFdInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15744 | stream->write((int*)pFd, sizeof(int)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 15745 | AEMU_SCOPED_TRACE("vkGetSemaphoreFdKHR readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15746 | stream->read((int*)pFd, sizeof(int)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 15747 | AEMU_SCOPED_TRACE("vkGetSemaphoreFdKHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15748 | VkResult vkGetSemaphoreFdKHR_VkResult_return = (VkResult)0; |
| 15749 | stream->read(&vkGetSemaphoreFdKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15750 | countingStream->clearPool(); |
| 15751 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 15752 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15753 | mImpl->log("finish vkGetSemaphoreFdKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15754 | return vkGetSemaphoreFdKHR_VkResult_return; |
| 15755 | } |
| 15756 | |
| 15757 | #endif |
| 15758 | #ifdef VK_KHR_push_descriptor |
| 15759 | void VkEncoder::vkCmdPushDescriptorSetKHR( |
| 15760 | VkCommandBuffer commandBuffer, |
| 15761 | VkPipelineBindPoint pipelineBindPoint, |
| 15762 | VkPipelineLayout layout, |
| 15763 | uint32_t set, |
| 15764 | uint32_t descriptorWriteCount, |
| 15765 | const VkWriteDescriptorSet* pDescriptorWrites) |
| 15766 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 15767 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 15768 | AEMU_SCOPED_TRACE("vkCmdPushDescriptorSetKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15769 | mImpl->log("start vkCmdPushDescriptorSetKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15770 | auto stream = mImpl->stream(); |
| 15771 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15772 | auto resources = mImpl->resources(); |
| 15773 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 15774 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15775 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15776 | VkPipelineBindPoint local_pipelineBindPoint; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15777 | VkPipelineLayout local_layout; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15778 | uint32_t local_set; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15779 | uint32_t local_descriptorWriteCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15780 | VkWriteDescriptorSet* local_pDescriptorWrites; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 15781 | local_commandBuffer = commandBuffer; |
| 15782 | local_pipelineBindPoint = pipelineBindPoint; |
| 15783 | local_layout = layout; |
| 15784 | local_set = set; |
| 15785 | local_descriptorWriteCount = descriptorWriteCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15786 | local_pDescriptorWrites = nullptr; |
| 15787 | if (pDescriptorWrites) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15788 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15789 | local_pDescriptorWrites = (VkWriteDescriptorSet*)pool->alloc(((descriptorWriteCount)) * sizeof(const VkWriteDescriptorSet)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15790 | for (uint32_t i = 0; i < (uint32_t)((descriptorWriteCount)); ++i) |
| 15791 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15792 | deepcopy_VkWriteDescriptorSet(pool, pDescriptorWrites + i, (VkWriteDescriptorSet*)(local_pDescriptorWrites + i)); |
| 15793 | } |
| 15794 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 15795 | if (local_pDescriptorWrites) |
| 15796 | { |
| 15797 | for (uint32_t i = 0; i < (uint32_t)((descriptorWriteCount)); ++i) |
| 15798 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 15799 | transform_tohost_VkWriteDescriptorSet(mImpl->resources(), (VkWriteDescriptorSet*)(local_pDescriptorWrites + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 15800 | } |
| 15801 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15802 | countingStream->rewind(); |
| 15803 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15804 | uint64_t cgen_var_1041; |
| 15805 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1041, 1); |
| 15806 | countingStream->write((uint64_t*)&cgen_var_1041, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15807 | countingStream->write((VkPipelineBindPoint*)&local_pipelineBindPoint, sizeof(VkPipelineBindPoint)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15808 | uint64_t cgen_var_1042; |
| 15809 | countingStream->handleMapping()->mapHandles_VkPipelineLayout_u64(&local_layout, &cgen_var_1042, 1); |
| 15810 | countingStream->write((uint64_t*)&cgen_var_1042, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15811 | countingStream->write((uint32_t*)&local_set, sizeof(uint32_t)); |
| 15812 | countingStream->write((uint32_t*)&local_descriptorWriteCount, sizeof(uint32_t)); |
| 15813 | for (uint32_t i = 0; i < (uint32_t)((descriptorWriteCount)); ++i) |
| 15814 | { |
| 15815 | marshal_VkWriteDescriptorSet(countingStream, (VkWriteDescriptorSet*)(local_pDescriptorWrites + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15816 | } |
| 15817 | } |
| 15818 | uint32_t packetSize_vkCmdPushDescriptorSetKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 15819 | countingStream->rewind(); |
| 15820 | uint32_t opcode_vkCmdPushDescriptorSetKHR = OP_vkCmdPushDescriptorSetKHR; |
| 15821 | stream->write(&opcode_vkCmdPushDescriptorSetKHR, sizeof(uint32_t)); |
| 15822 | stream->write(&packetSize_vkCmdPushDescriptorSetKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15823 | uint64_t cgen_var_1043; |
| 15824 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1043, 1); |
| 15825 | stream->write((uint64_t*)&cgen_var_1043, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15826 | stream->write((VkPipelineBindPoint*)&local_pipelineBindPoint, sizeof(VkPipelineBindPoint)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15827 | uint64_t cgen_var_1044; |
| 15828 | stream->handleMapping()->mapHandles_VkPipelineLayout_u64(&local_layout, &cgen_var_1044, 1); |
| 15829 | stream->write((uint64_t*)&cgen_var_1044, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15830 | stream->write((uint32_t*)&local_set, sizeof(uint32_t)); |
| 15831 | stream->write((uint32_t*)&local_descriptorWriteCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15832 | for (uint32_t i = 0; i < (uint32_t)((descriptorWriteCount)); ++i) |
| 15833 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15834 | marshal_VkWriteDescriptorSet(stream, (VkWriteDescriptorSet*)(local_pDescriptorWrites + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15835 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 15836 | AEMU_SCOPED_TRACE("vkCmdPushDescriptorSetKHR readParams"); |
| 15837 | AEMU_SCOPED_TRACE("vkCmdPushDescriptorSetKHR returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15838 | mImpl->log("finish vkCmdPushDescriptorSetKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15839 | } |
| 15840 | |
| 15841 | void VkEncoder::vkCmdPushDescriptorSetWithTemplateKHR( |
| 15842 | VkCommandBuffer commandBuffer, |
| 15843 | VkDescriptorUpdateTemplate descriptorUpdateTemplate, |
| 15844 | VkPipelineLayout layout, |
| 15845 | uint32_t set, |
| 15846 | const void* pData) |
| 15847 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 15848 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 15849 | AEMU_SCOPED_TRACE("vkCmdPushDescriptorSetWithTemplateKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15850 | mImpl->log("start vkCmdPushDescriptorSetWithTemplateKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15851 | auto stream = mImpl->stream(); |
| 15852 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15853 | auto resources = mImpl->resources(); |
| 15854 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 15855 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15856 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15857 | VkDescriptorUpdateTemplate local_descriptorUpdateTemplate; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15858 | VkPipelineLayout local_layout; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15859 | uint32_t local_set; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15860 | void* local_pData; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 15861 | local_commandBuffer = commandBuffer; |
| 15862 | local_descriptorUpdateTemplate = descriptorUpdateTemplate; |
| 15863 | local_layout = layout; |
| 15864 | local_set = set; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15865 | local_pData = nullptr; |
| 15866 | if (pData) |
| 15867 | { |
| 15868 | local_pData = (void*)pool->dupArray(pData, sizeof(const uint8_t)); |
| 15869 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15870 | countingStream->rewind(); |
| 15871 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15872 | uint64_t cgen_var_1045; |
| 15873 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1045, 1); |
| 15874 | countingStream->write((uint64_t*)&cgen_var_1045, 1 * 8); |
| 15875 | uint64_t cgen_var_1046; |
| 15876 | countingStream->handleMapping()->mapHandles_VkDescriptorUpdateTemplate_u64(&local_descriptorUpdateTemplate, &cgen_var_1046, 1); |
| 15877 | countingStream->write((uint64_t*)&cgen_var_1046, 1 * 8); |
| 15878 | uint64_t cgen_var_1047; |
| 15879 | countingStream->handleMapping()->mapHandles_VkPipelineLayout_u64(&local_layout, &cgen_var_1047, 1); |
| 15880 | countingStream->write((uint64_t*)&cgen_var_1047, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15881 | countingStream->write((uint32_t*)&local_set, sizeof(uint32_t)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 15882 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15883 | uint64_t cgen_var_1048 = (uint64_t)(uintptr_t)local_pData; |
| 15884 | countingStream->putBe64(cgen_var_1048); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15885 | if (local_pData) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15886 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15887 | countingStream->write((void*)local_pData, sizeof(uint8_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15888 | } |
| 15889 | } |
| 15890 | uint32_t packetSize_vkCmdPushDescriptorSetWithTemplateKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 15891 | countingStream->rewind(); |
| 15892 | uint32_t opcode_vkCmdPushDescriptorSetWithTemplateKHR = OP_vkCmdPushDescriptorSetWithTemplateKHR; |
| 15893 | stream->write(&opcode_vkCmdPushDescriptorSetWithTemplateKHR, sizeof(uint32_t)); |
| 15894 | stream->write(&packetSize_vkCmdPushDescriptorSetWithTemplateKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15895 | uint64_t cgen_var_1049; |
| 15896 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1049, 1); |
| 15897 | stream->write((uint64_t*)&cgen_var_1049, 1 * 8); |
| 15898 | uint64_t cgen_var_1050; |
| 15899 | stream->handleMapping()->mapHandles_VkDescriptorUpdateTemplate_u64(&local_descriptorUpdateTemplate, &cgen_var_1050, 1); |
| 15900 | stream->write((uint64_t*)&cgen_var_1050, 1 * 8); |
| 15901 | uint64_t cgen_var_1051; |
| 15902 | stream->handleMapping()->mapHandles_VkPipelineLayout_u64(&local_layout, &cgen_var_1051, 1); |
| 15903 | stream->write((uint64_t*)&cgen_var_1051, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15904 | stream->write((uint32_t*)&local_set, sizeof(uint32_t)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 15905 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15906 | uint64_t cgen_var_1052 = (uint64_t)(uintptr_t)local_pData; |
| 15907 | stream->putBe64(cgen_var_1052); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15908 | if (local_pData) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15909 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15910 | stream->write((void*)local_pData, sizeof(uint8_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15911 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 15912 | AEMU_SCOPED_TRACE("vkCmdPushDescriptorSetWithTemplateKHR readParams"); |
| 15913 | AEMU_SCOPED_TRACE("vkCmdPushDescriptorSetWithTemplateKHR returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15914 | mImpl->log("finish vkCmdPushDescriptorSetWithTemplateKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15915 | } |
| 15916 | |
| 15917 | #endif |
| 15918 | #ifdef VK_KHR_16bit_storage |
| 15919 | #endif |
| 15920 | #ifdef VK_KHR_incremental_present |
| 15921 | #endif |
| 15922 | #ifdef VK_KHR_descriptor_update_template |
| 15923 | VkResult VkEncoder::vkCreateDescriptorUpdateTemplateKHR( |
| 15924 | VkDevice device, |
| 15925 | const VkDescriptorUpdateTemplateCreateInfo* pCreateInfo, |
| 15926 | const VkAllocationCallbacks* pAllocator, |
| 15927 | VkDescriptorUpdateTemplate* pDescriptorUpdateTemplate) |
| 15928 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 15929 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 15930 | AEMU_SCOPED_TRACE("vkCreateDescriptorUpdateTemplateKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15931 | mImpl->log("start vkCreateDescriptorUpdateTemplateKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15932 | auto stream = mImpl->stream(); |
| 15933 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15934 | auto resources = mImpl->resources(); |
| 15935 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 15936 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15937 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15938 | VkDescriptorUpdateTemplateCreateInfo* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 15939 | VkAllocationCallbacks* local_pAllocator; |
| 15940 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15941 | local_pCreateInfo = nullptr; |
| 15942 | if (pCreateInfo) |
| 15943 | { |
| 15944 | local_pCreateInfo = (VkDescriptorUpdateTemplateCreateInfo*)pool->alloc(sizeof(const VkDescriptorUpdateTemplateCreateInfo)); |
| 15945 | deepcopy_VkDescriptorUpdateTemplateCreateInfo(pool, pCreateInfo, (VkDescriptorUpdateTemplateCreateInfo*)(local_pCreateInfo)); |
| 15946 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15947 | local_pAllocator = nullptr; |
| 15948 | if (pAllocator) |
| 15949 | { |
| 15950 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 15951 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 15952 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 15953 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 15954 | if (local_pCreateInfo) |
| 15955 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 15956 | transform_tohost_VkDescriptorUpdateTemplateCreateInfo(mImpl->resources(), (VkDescriptorUpdateTemplateCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 15957 | } |
| 15958 | if (local_pAllocator) |
| 15959 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 15960 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 15961 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15962 | countingStream->rewind(); |
| 15963 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15964 | uint64_t cgen_var_1053; |
| 15965 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1053, 1); |
| 15966 | countingStream->write((uint64_t*)&cgen_var_1053, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15967 | marshal_VkDescriptorUpdateTemplateCreateInfo(countingStream, (VkDescriptorUpdateTemplateCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 15968 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15969 | uint64_t cgen_var_1054 = (uint64_t)(uintptr_t)local_pAllocator; |
| 15970 | countingStream->putBe64(cgen_var_1054); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15971 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15972 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15973 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15974 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15975 | uint64_t cgen_var_1055; |
| 15976 | countingStream->handleMapping()->mapHandles_VkDescriptorUpdateTemplate_u64(pDescriptorUpdateTemplate, &cgen_var_1055, 1); |
| 15977 | countingStream->write((uint64_t*)&cgen_var_1055, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15978 | } |
| 15979 | uint32_t packetSize_vkCreateDescriptorUpdateTemplateKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 15980 | countingStream->rewind(); |
| 15981 | uint32_t opcode_vkCreateDescriptorUpdateTemplateKHR = OP_vkCreateDescriptorUpdateTemplateKHR; |
| 15982 | stream->write(&opcode_vkCreateDescriptorUpdateTemplateKHR, sizeof(uint32_t)); |
| 15983 | stream->write(&packetSize_vkCreateDescriptorUpdateTemplateKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15984 | uint64_t cgen_var_1056; |
| 15985 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1056, 1); |
| 15986 | stream->write((uint64_t*)&cgen_var_1056, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15987 | marshal_VkDescriptorUpdateTemplateCreateInfo(stream, (VkDescriptorUpdateTemplateCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 15988 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15989 | uint64_t cgen_var_1057 = (uint64_t)(uintptr_t)local_pAllocator; |
| 15990 | stream->putBe64(cgen_var_1057); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15991 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15992 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15993 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15994 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 15995 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15996 | uint64_t cgen_var_1058; |
| 15997 | stream->handleMapping()->mapHandles_VkDescriptorUpdateTemplate_u64(pDescriptorUpdateTemplate, &cgen_var_1058, 1); |
| 15998 | stream->write((uint64_t*)&cgen_var_1058, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 15999 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 16000 | AEMU_SCOPED_TRACE("vkCreateDescriptorUpdateTemplateKHR readParams"); |
| Lingfeng Yang | 1dafbc3 | 2019-02-23 10:52:04 -0800 | [diff] [blame] | 16001 | stream->setHandleMapping(resources->createMapping()); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16002 | uint64_t cgen_var_1059; |
| 16003 | stream->read((uint64_t*)&cgen_var_1059, 8); |
| 16004 | stream->handleMapping()->mapHandles_u64_VkDescriptorUpdateTemplate(&cgen_var_1059, (VkDescriptorUpdateTemplate*)pDescriptorUpdateTemplate, 1); |
| Lingfeng Yang | 1dafbc3 | 2019-02-23 10:52:04 -0800 | [diff] [blame] | 16005 | stream->unsetHandleMapping(); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 16006 | AEMU_SCOPED_TRACE("vkCreateDescriptorUpdateTemplateKHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16007 | VkResult vkCreateDescriptorUpdateTemplateKHR_VkResult_return = (VkResult)0; |
| 16008 | stream->read(&vkCreateDescriptorUpdateTemplateKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16009 | countingStream->clearPool(); |
| 16010 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 16011 | pool->freeAll(); |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 16012 | encoderLock.unlock(); |
| Lingfeng Yang | 05d5ea3 | 2019-03-23 00:12:39 -0700 | [diff] [blame] | 16013 | mImpl->resources()->on_vkCreateDescriptorUpdateTemplateKHR(this, vkCreateDescriptorUpdateTemplateKHR_VkResult_return, device, pCreateInfo, pAllocator, pDescriptorUpdateTemplate); |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 16014 | encoderLock.lock(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16015 | mImpl->log("finish vkCreateDescriptorUpdateTemplateKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16016 | return vkCreateDescriptorUpdateTemplateKHR_VkResult_return; |
| 16017 | } |
| 16018 | |
| 16019 | void VkEncoder::vkDestroyDescriptorUpdateTemplateKHR( |
| 16020 | VkDevice device, |
| 16021 | VkDescriptorUpdateTemplate descriptorUpdateTemplate, |
| 16022 | const VkAllocationCallbacks* pAllocator) |
| 16023 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 16024 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 16025 | AEMU_SCOPED_TRACE("vkDestroyDescriptorUpdateTemplateKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16026 | mImpl->log("start vkDestroyDescriptorUpdateTemplateKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16027 | auto stream = mImpl->stream(); |
| 16028 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16029 | auto resources = mImpl->resources(); |
| 16030 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 16031 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16032 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16033 | VkDescriptorUpdateTemplate local_descriptorUpdateTemplate; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16034 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 16035 | local_device = device; |
| 16036 | local_descriptorUpdateTemplate = descriptorUpdateTemplate; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16037 | local_pAllocator = nullptr; |
| 16038 | if (pAllocator) |
| 16039 | { |
| 16040 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 16041 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 16042 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 16043 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 16044 | if (local_pAllocator) |
| 16045 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 16046 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 16047 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16048 | countingStream->rewind(); |
| 16049 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16050 | uint64_t cgen_var_1060; |
| 16051 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1060, 1); |
| 16052 | countingStream->write((uint64_t*)&cgen_var_1060, 1 * 8); |
| 16053 | uint64_t cgen_var_1061; |
| 16054 | countingStream->handleMapping()->mapHandles_VkDescriptorUpdateTemplate_u64(&local_descriptorUpdateTemplate, &cgen_var_1061, 1); |
| 16055 | countingStream->write((uint64_t*)&cgen_var_1061, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 16056 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16057 | uint64_t cgen_var_1062 = (uint64_t)(uintptr_t)local_pAllocator; |
| 16058 | countingStream->putBe64(cgen_var_1062); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16059 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16060 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16061 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16062 | } |
| 16063 | } |
| 16064 | uint32_t packetSize_vkDestroyDescriptorUpdateTemplateKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 16065 | countingStream->rewind(); |
| 16066 | uint32_t opcode_vkDestroyDescriptorUpdateTemplateKHR = OP_vkDestroyDescriptorUpdateTemplateKHR; |
| 16067 | stream->write(&opcode_vkDestroyDescriptorUpdateTemplateKHR, sizeof(uint32_t)); |
| 16068 | stream->write(&packetSize_vkDestroyDescriptorUpdateTemplateKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16069 | uint64_t cgen_var_1063; |
| 16070 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1063, 1); |
| 16071 | stream->write((uint64_t*)&cgen_var_1063, 1 * 8); |
| 16072 | uint64_t cgen_var_1064; |
| 16073 | stream->handleMapping()->mapHandles_VkDescriptorUpdateTemplate_u64(&local_descriptorUpdateTemplate, &cgen_var_1064, 1); |
| 16074 | stream->write((uint64_t*)&cgen_var_1064, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 16075 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16076 | uint64_t cgen_var_1065 = (uint64_t)(uintptr_t)local_pAllocator; |
| 16077 | stream->putBe64(cgen_var_1065); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16078 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16079 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16080 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16081 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 16082 | AEMU_SCOPED_TRACE("vkDestroyDescriptorUpdateTemplateKHR readParams"); |
| 16083 | AEMU_SCOPED_TRACE("vkDestroyDescriptorUpdateTemplateKHR returnUnmarshal"); |
| Lingfeng Yang | 1dafbc3 | 2019-02-23 10:52:04 -0800 | [diff] [blame] | 16084 | resources->destroyMapping()->mapHandles_VkDescriptorUpdateTemplate((VkDescriptorUpdateTemplate*)&descriptorUpdateTemplate); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16085 | mImpl->log("finish vkDestroyDescriptorUpdateTemplateKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16086 | } |
| 16087 | |
| 16088 | void VkEncoder::vkUpdateDescriptorSetWithTemplateKHR( |
| 16089 | VkDevice device, |
| 16090 | VkDescriptorSet descriptorSet, |
| 16091 | VkDescriptorUpdateTemplate descriptorUpdateTemplate, |
| 16092 | const void* pData) |
| 16093 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 16094 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 16095 | AEMU_SCOPED_TRACE("vkUpdateDescriptorSetWithTemplateKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16096 | mImpl->log("start vkUpdateDescriptorSetWithTemplateKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16097 | auto stream = mImpl->stream(); |
| 16098 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16099 | auto resources = mImpl->resources(); |
| 16100 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 16101 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16102 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16103 | VkDescriptorSet local_descriptorSet; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16104 | VkDescriptorUpdateTemplate local_descriptorUpdateTemplate; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16105 | void* local_pData; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 16106 | local_device = device; |
| 16107 | local_descriptorSet = descriptorSet; |
| 16108 | local_descriptorUpdateTemplate = descriptorUpdateTemplate; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16109 | local_pData = nullptr; |
| 16110 | if (pData) |
| 16111 | { |
| 16112 | local_pData = (void*)pool->dupArray(pData, sizeof(const uint8_t)); |
| 16113 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16114 | countingStream->rewind(); |
| 16115 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16116 | uint64_t cgen_var_1066; |
| 16117 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1066, 1); |
| 16118 | countingStream->write((uint64_t*)&cgen_var_1066, 1 * 8); |
| 16119 | uint64_t cgen_var_1067; |
| 16120 | countingStream->handleMapping()->mapHandles_VkDescriptorSet_u64(&local_descriptorSet, &cgen_var_1067, 1); |
| 16121 | countingStream->write((uint64_t*)&cgen_var_1067, 1 * 8); |
| 16122 | uint64_t cgen_var_1068; |
| 16123 | countingStream->handleMapping()->mapHandles_VkDescriptorUpdateTemplate_u64(&local_descriptorUpdateTemplate, &cgen_var_1068, 1); |
| 16124 | countingStream->write((uint64_t*)&cgen_var_1068, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 16125 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16126 | uint64_t cgen_var_1069 = (uint64_t)(uintptr_t)local_pData; |
| 16127 | countingStream->putBe64(cgen_var_1069); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16128 | if (local_pData) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16129 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16130 | countingStream->write((void*)local_pData, sizeof(uint8_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16131 | } |
| 16132 | } |
| 16133 | uint32_t packetSize_vkUpdateDescriptorSetWithTemplateKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 16134 | countingStream->rewind(); |
| 16135 | uint32_t opcode_vkUpdateDescriptorSetWithTemplateKHR = OP_vkUpdateDescriptorSetWithTemplateKHR; |
| 16136 | stream->write(&opcode_vkUpdateDescriptorSetWithTemplateKHR, sizeof(uint32_t)); |
| 16137 | stream->write(&packetSize_vkUpdateDescriptorSetWithTemplateKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16138 | uint64_t cgen_var_1070; |
| 16139 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1070, 1); |
| 16140 | stream->write((uint64_t*)&cgen_var_1070, 1 * 8); |
| 16141 | uint64_t cgen_var_1071; |
| 16142 | stream->handleMapping()->mapHandles_VkDescriptorSet_u64(&local_descriptorSet, &cgen_var_1071, 1); |
| 16143 | stream->write((uint64_t*)&cgen_var_1071, 1 * 8); |
| 16144 | uint64_t cgen_var_1072; |
| 16145 | stream->handleMapping()->mapHandles_VkDescriptorUpdateTemplate_u64(&local_descriptorUpdateTemplate, &cgen_var_1072, 1); |
| 16146 | stream->write((uint64_t*)&cgen_var_1072, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 16147 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16148 | uint64_t cgen_var_1073 = (uint64_t)(uintptr_t)local_pData; |
| 16149 | stream->putBe64(cgen_var_1073); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16150 | if (local_pData) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16151 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16152 | stream->write((void*)local_pData, sizeof(uint8_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16153 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 16154 | AEMU_SCOPED_TRACE("vkUpdateDescriptorSetWithTemplateKHR readParams"); |
| 16155 | AEMU_SCOPED_TRACE("vkUpdateDescriptorSetWithTemplateKHR returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16156 | mImpl->log("finish vkUpdateDescriptorSetWithTemplateKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16157 | } |
| 16158 | |
| 16159 | #endif |
| 16160 | #ifdef VK_KHR_create_renderpass2 |
| 16161 | VkResult VkEncoder::vkCreateRenderPass2KHR( |
| 16162 | VkDevice device, |
| 16163 | const VkRenderPassCreateInfo2KHR* pCreateInfo, |
| 16164 | const VkAllocationCallbacks* pAllocator, |
| 16165 | VkRenderPass* pRenderPass) |
| 16166 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 16167 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 16168 | AEMU_SCOPED_TRACE("vkCreateRenderPass2KHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16169 | mImpl->log("start vkCreateRenderPass2KHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16170 | auto stream = mImpl->stream(); |
| 16171 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16172 | auto resources = mImpl->resources(); |
| 16173 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 16174 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16175 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16176 | VkRenderPassCreateInfo2KHR* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 16177 | VkAllocationCallbacks* local_pAllocator; |
| 16178 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16179 | local_pCreateInfo = nullptr; |
| 16180 | if (pCreateInfo) |
| 16181 | { |
| 16182 | local_pCreateInfo = (VkRenderPassCreateInfo2KHR*)pool->alloc(sizeof(const VkRenderPassCreateInfo2KHR)); |
| 16183 | deepcopy_VkRenderPassCreateInfo2KHR(pool, pCreateInfo, (VkRenderPassCreateInfo2KHR*)(local_pCreateInfo)); |
| 16184 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16185 | local_pAllocator = nullptr; |
| 16186 | if (pAllocator) |
| 16187 | { |
| 16188 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 16189 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 16190 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 16191 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 16192 | if (local_pCreateInfo) |
| 16193 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 16194 | transform_tohost_VkRenderPassCreateInfo2KHR(mImpl->resources(), (VkRenderPassCreateInfo2KHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 16195 | } |
| 16196 | if (local_pAllocator) |
| 16197 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 16198 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 16199 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16200 | countingStream->rewind(); |
| 16201 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16202 | uint64_t cgen_var_1074; |
| 16203 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1074, 1); |
| 16204 | countingStream->write((uint64_t*)&cgen_var_1074, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16205 | marshal_VkRenderPassCreateInfo2KHR(countingStream, (VkRenderPassCreateInfo2KHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 16206 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16207 | uint64_t cgen_var_1075 = (uint64_t)(uintptr_t)local_pAllocator; |
| 16208 | countingStream->putBe64(cgen_var_1075); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16209 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16210 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16211 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16212 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16213 | uint64_t cgen_var_1076; |
| 16214 | countingStream->handleMapping()->mapHandles_VkRenderPass_u64(pRenderPass, &cgen_var_1076, 1); |
| 16215 | countingStream->write((uint64_t*)&cgen_var_1076, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16216 | } |
| 16217 | uint32_t packetSize_vkCreateRenderPass2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 16218 | countingStream->rewind(); |
| 16219 | uint32_t opcode_vkCreateRenderPass2KHR = OP_vkCreateRenderPass2KHR; |
| 16220 | stream->write(&opcode_vkCreateRenderPass2KHR, sizeof(uint32_t)); |
| 16221 | stream->write(&packetSize_vkCreateRenderPass2KHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16222 | uint64_t cgen_var_1077; |
| 16223 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1077, 1); |
| 16224 | stream->write((uint64_t*)&cgen_var_1077, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16225 | marshal_VkRenderPassCreateInfo2KHR(stream, (VkRenderPassCreateInfo2KHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 16226 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16227 | uint64_t cgen_var_1078 = (uint64_t)(uintptr_t)local_pAllocator; |
| 16228 | stream->putBe64(cgen_var_1078); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16229 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16230 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16231 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16232 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 16233 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16234 | uint64_t cgen_var_1079; |
| 16235 | stream->handleMapping()->mapHandles_VkRenderPass_u64(pRenderPass, &cgen_var_1079, 1); |
| 16236 | stream->write((uint64_t*)&cgen_var_1079, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 16237 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 16238 | AEMU_SCOPED_TRACE("vkCreateRenderPass2KHR readParams"); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16239 | uint64_t cgen_var_1080; |
| 16240 | stream->read((uint64_t*)&cgen_var_1080, 8); |
| 16241 | stream->handleMapping()->mapHandles_u64_VkRenderPass(&cgen_var_1080, (VkRenderPass*)pRenderPass, 1); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 16242 | AEMU_SCOPED_TRACE("vkCreateRenderPass2KHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16243 | VkResult vkCreateRenderPass2KHR_VkResult_return = (VkResult)0; |
| 16244 | stream->read(&vkCreateRenderPass2KHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16245 | countingStream->clearPool(); |
| 16246 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 16247 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16248 | mImpl->log("finish vkCreateRenderPass2KHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16249 | return vkCreateRenderPass2KHR_VkResult_return; |
| 16250 | } |
| 16251 | |
| 16252 | void VkEncoder::vkCmdBeginRenderPass2KHR( |
| 16253 | VkCommandBuffer commandBuffer, |
| 16254 | const VkRenderPassBeginInfo* pRenderPassBegin, |
| 16255 | const VkSubpassBeginInfoKHR* pSubpassBeginInfo) |
| 16256 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 16257 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 16258 | AEMU_SCOPED_TRACE("vkCmdBeginRenderPass2KHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16259 | mImpl->log("start vkCmdBeginRenderPass2KHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16260 | auto stream = mImpl->stream(); |
| 16261 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16262 | auto resources = mImpl->resources(); |
| 16263 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 16264 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16265 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16266 | VkRenderPassBeginInfo* local_pRenderPassBegin; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 16267 | VkSubpassBeginInfoKHR* local_pSubpassBeginInfo; |
| 16268 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16269 | local_pRenderPassBegin = nullptr; |
| 16270 | if (pRenderPassBegin) |
| 16271 | { |
| 16272 | local_pRenderPassBegin = (VkRenderPassBeginInfo*)pool->alloc(sizeof(const VkRenderPassBeginInfo)); |
| 16273 | deepcopy_VkRenderPassBeginInfo(pool, pRenderPassBegin, (VkRenderPassBeginInfo*)(local_pRenderPassBegin)); |
| 16274 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16275 | local_pSubpassBeginInfo = nullptr; |
| 16276 | if (pSubpassBeginInfo) |
| 16277 | { |
| 16278 | local_pSubpassBeginInfo = (VkSubpassBeginInfoKHR*)pool->alloc(sizeof(const VkSubpassBeginInfoKHR)); |
| 16279 | deepcopy_VkSubpassBeginInfoKHR(pool, pSubpassBeginInfo, (VkSubpassBeginInfoKHR*)(local_pSubpassBeginInfo)); |
| 16280 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 16281 | if (local_pRenderPassBegin) |
| 16282 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 16283 | transform_tohost_VkRenderPassBeginInfo(mImpl->resources(), (VkRenderPassBeginInfo*)(local_pRenderPassBegin)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 16284 | } |
| 16285 | if (local_pSubpassBeginInfo) |
| 16286 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 16287 | transform_tohost_VkSubpassBeginInfoKHR(mImpl->resources(), (VkSubpassBeginInfoKHR*)(local_pSubpassBeginInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 16288 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16289 | countingStream->rewind(); |
| 16290 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16291 | uint64_t cgen_var_1081; |
| 16292 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1081, 1); |
| 16293 | countingStream->write((uint64_t*)&cgen_var_1081, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16294 | marshal_VkRenderPassBeginInfo(countingStream, (VkRenderPassBeginInfo*)(local_pRenderPassBegin)); |
| 16295 | marshal_VkSubpassBeginInfoKHR(countingStream, (VkSubpassBeginInfoKHR*)(local_pSubpassBeginInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16296 | } |
| 16297 | uint32_t packetSize_vkCmdBeginRenderPass2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 16298 | countingStream->rewind(); |
| 16299 | uint32_t opcode_vkCmdBeginRenderPass2KHR = OP_vkCmdBeginRenderPass2KHR; |
| 16300 | stream->write(&opcode_vkCmdBeginRenderPass2KHR, sizeof(uint32_t)); |
| 16301 | stream->write(&packetSize_vkCmdBeginRenderPass2KHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16302 | uint64_t cgen_var_1082; |
| 16303 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1082, 1); |
| 16304 | stream->write((uint64_t*)&cgen_var_1082, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16305 | marshal_VkRenderPassBeginInfo(stream, (VkRenderPassBeginInfo*)(local_pRenderPassBegin)); |
| 16306 | marshal_VkSubpassBeginInfoKHR(stream, (VkSubpassBeginInfoKHR*)(local_pSubpassBeginInfo)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 16307 | AEMU_SCOPED_TRACE("vkCmdBeginRenderPass2KHR readParams"); |
| 16308 | AEMU_SCOPED_TRACE("vkCmdBeginRenderPass2KHR returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16309 | mImpl->log("finish vkCmdBeginRenderPass2KHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16310 | } |
| 16311 | |
| 16312 | void VkEncoder::vkCmdNextSubpass2KHR( |
| 16313 | VkCommandBuffer commandBuffer, |
| 16314 | const VkSubpassBeginInfoKHR* pSubpassBeginInfo, |
| 16315 | const VkSubpassEndInfoKHR* pSubpassEndInfo) |
| 16316 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 16317 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 16318 | AEMU_SCOPED_TRACE("vkCmdNextSubpass2KHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16319 | mImpl->log("start vkCmdNextSubpass2KHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16320 | auto stream = mImpl->stream(); |
| 16321 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16322 | auto resources = mImpl->resources(); |
| 16323 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 16324 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16325 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16326 | VkSubpassBeginInfoKHR* local_pSubpassBeginInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 16327 | VkSubpassEndInfoKHR* local_pSubpassEndInfo; |
| 16328 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16329 | local_pSubpassBeginInfo = nullptr; |
| 16330 | if (pSubpassBeginInfo) |
| 16331 | { |
| 16332 | local_pSubpassBeginInfo = (VkSubpassBeginInfoKHR*)pool->alloc(sizeof(const VkSubpassBeginInfoKHR)); |
| 16333 | deepcopy_VkSubpassBeginInfoKHR(pool, pSubpassBeginInfo, (VkSubpassBeginInfoKHR*)(local_pSubpassBeginInfo)); |
| 16334 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16335 | local_pSubpassEndInfo = nullptr; |
| 16336 | if (pSubpassEndInfo) |
| 16337 | { |
| 16338 | local_pSubpassEndInfo = (VkSubpassEndInfoKHR*)pool->alloc(sizeof(const VkSubpassEndInfoKHR)); |
| 16339 | deepcopy_VkSubpassEndInfoKHR(pool, pSubpassEndInfo, (VkSubpassEndInfoKHR*)(local_pSubpassEndInfo)); |
| 16340 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 16341 | if (local_pSubpassBeginInfo) |
| 16342 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 16343 | transform_tohost_VkSubpassBeginInfoKHR(mImpl->resources(), (VkSubpassBeginInfoKHR*)(local_pSubpassBeginInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 16344 | } |
| 16345 | if (local_pSubpassEndInfo) |
| 16346 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 16347 | transform_tohost_VkSubpassEndInfoKHR(mImpl->resources(), (VkSubpassEndInfoKHR*)(local_pSubpassEndInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 16348 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16349 | countingStream->rewind(); |
| 16350 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16351 | uint64_t cgen_var_1083; |
| 16352 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1083, 1); |
| 16353 | countingStream->write((uint64_t*)&cgen_var_1083, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16354 | marshal_VkSubpassBeginInfoKHR(countingStream, (VkSubpassBeginInfoKHR*)(local_pSubpassBeginInfo)); |
| 16355 | marshal_VkSubpassEndInfoKHR(countingStream, (VkSubpassEndInfoKHR*)(local_pSubpassEndInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16356 | } |
| 16357 | uint32_t packetSize_vkCmdNextSubpass2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 16358 | countingStream->rewind(); |
| 16359 | uint32_t opcode_vkCmdNextSubpass2KHR = OP_vkCmdNextSubpass2KHR; |
| 16360 | stream->write(&opcode_vkCmdNextSubpass2KHR, sizeof(uint32_t)); |
| 16361 | stream->write(&packetSize_vkCmdNextSubpass2KHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16362 | uint64_t cgen_var_1084; |
| 16363 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1084, 1); |
| 16364 | stream->write((uint64_t*)&cgen_var_1084, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16365 | marshal_VkSubpassBeginInfoKHR(stream, (VkSubpassBeginInfoKHR*)(local_pSubpassBeginInfo)); |
| 16366 | marshal_VkSubpassEndInfoKHR(stream, (VkSubpassEndInfoKHR*)(local_pSubpassEndInfo)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 16367 | AEMU_SCOPED_TRACE("vkCmdNextSubpass2KHR readParams"); |
| 16368 | AEMU_SCOPED_TRACE("vkCmdNextSubpass2KHR returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16369 | mImpl->log("finish vkCmdNextSubpass2KHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16370 | } |
| 16371 | |
| 16372 | void VkEncoder::vkCmdEndRenderPass2KHR( |
| 16373 | VkCommandBuffer commandBuffer, |
| 16374 | const VkSubpassEndInfoKHR* pSubpassEndInfo) |
| 16375 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 16376 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 16377 | AEMU_SCOPED_TRACE("vkCmdEndRenderPass2KHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16378 | mImpl->log("start vkCmdEndRenderPass2KHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16379 | auto stream = mImpl->stream(); |
| 16380 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16381 | auto resources = mImpl->resources(); |
| 16382 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 16383 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16384 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16385 | VkSubpassEndInfoKHR* local_pSubpassEndInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 16386 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16387 | local_pSubpassEndInfo = nullptr; |
| 16388 | if (pSubpassEndInfo) |
| 16389 | { |
| 16390 | local_pSubpassEndInfo = (VkSubpassEndInfoKHR*)pool->alloc(sizeof(const VkSubpassEndInfoKHR)); |
| 16391 | deepcopy_VkSubpassEndInfoKHR(pool, pSubpassEndInfo, (VkSubpassEndInfoKHR*)(local_pSubpassEndInfo)); |
| 16392 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 16393 | if (local_pSubpassEndInfo) |
| 16394 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 16395 | transform_tohost_VkSubpassEndInfoKHR(mImpl->resources(), (VkSubpassEndInfoKHR*)(local_pSubpassEndInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 16396 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16397 | countingStream->rewind(); |
| 16398 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16399 | uint64_t cgen_var_1085; |
| 16400 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1085, 1); |
| 16401 | countingStream->write((uint64_t*)&cgen_var_1085, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16402 | marshal_VkSubpassEndInfoKHR(countingStream, (VkSubpassEndInfoKHR*)(local_pSubpassEndInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16403 | } |
| 16404 | uint32_t packetSize_vkCmdEndRenderPass2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 16405 | countingStream->rewind(); |
| 16406 | uint32_t opcode_vkCmdEndRenderPass2KHR = OP_vkCmdEndRenderPass2KHR; |
| 16407 | stream->write(&opcode_vkCmdEndRenderPass2KHR, sizeof(uint32_t)); |
| 16408 | stream->write(&packetSize_vkCmdEndRenderPass2KHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16409 | uint64_t cgen_var_1086; |
| 16410 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1086, 1); |
| 16411 | stream->write((uint64_t*)&cgen_var_1086, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16412 | marshal_VkSubpassEndInfoKHR(stream, (VkSubpassEndInfoKHR*)(local_pSubpassEndInfo)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 16413 | AEMU_SCOPED_TRACE("vkCmdEndRenderPass2KHR readParams"); |
| 16414 | AEMU_SCOPED_TRACE("vkCmdEndRenderPass2KHR returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16415 | mImpl->log("finish vkCmdEndRenderPass2KHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16416 | } |
| 16417 | |
| 16418 | #endif |
| 16419 | #ifdef VK_KHR_shared_presentable_image |
| 16420 | VkResult VkEncoder::vkGetSwapchainStatusKHR( |
| 16421 | VkDevice device, |
| 16422 | VkSwapchainKHR swapchain) |
| 16423 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 16424 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 16425 | AEMU_SCOPED_TRACE("vkGetSwapchainStatusKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16426 | mImpl->log("start vkGetSwapchainStatusKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16427 | auto stream = mImpl->stream(); |
| 16428 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16429 | auto resources = mImpl->resources(); |
| 16430 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 16431 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16432 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16433 | VkSwapchainKHR local_swapchain; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 16434 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16435 | local_swapchain = swapchain; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16436 | countingStream->rewind(); |
| 16437 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16438 | uint64_t cgen_var_1087; |
| 16439 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1087, 1); |
| 16440 | countingStream->write((uint64_t*)&cgen_var_1087, 1 * 8); |
| 16441 | uint64_t cgen_var_1088; |
| 16442 | countingStream->handleMapping()->mapHandles_VkSwapchainKHR_u64(&local_swapchain, &cgen_var_1088, 1); |
| 16443 | countingStream->write((uint64_t*)&cgen_var_1088, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16444 | } |
| 16445 | uint32_t packetSize_vkGetSwapchainStatusKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 16446 | countingStream->rewind(); |
| 16447 | uint32_t opcode_vkGetSwapchainStatusKHR = OP_vkGetSwapchainStatusKHR; |
| 16448 | stream->write(&opcode_vkGetSwapchainStatusKHR, sizeof(uint32_t)); |
| 16449 | stream->write(&packetSize_vkGetSwapchainStatusKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16450 | uint64_t cgen_var_1089; |
| 16451 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1089, 1); |
| 16452 | stream->write((uint64_t*)&cgen_var_1089, 1 * 8); |
| 16453 | uint64_t cgen_var_1090; |
| 16454 | stream->handleMapping()->mapHandles_VkSwapchainKHR_u64(&local_swapchain, &cgen_var_1090, 1); |
| 16455 | stream->write((uint64_t*)&cgen_var_1090, 1 * 8); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 16456 | AEMU_SCOPED_TRACE("vkGetSwapchainStatusKHR readParams"); |
| 16457 | AEMU_SCOPED_TRACE("vkGetSwapchainStatusKHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16458 | VkResult vkGetSwapchainStatusKHR_VkResult_return = (VkResult)0; |
| 16459 | stream->read(&vkGetSwapchainStatusKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16460 | countingStream->clearPool(); |
| 16461 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 16462 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16463 | mImpl->log("finish vkGetSwapchainStatusKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16464 | return vkGetSwapchainStatusKHR_VkResult_return; |
| 16465 | } |
| 16466 | |
| 16467 | #endif |
| 16468 | #ifdef VK_KHR_external_fence_capabilities |
| 16469 | void VkEncoder::vkGetPhysicalDeviceExternalFencePropertiesKHR( |
| 16470 | VkPhysicalDevice physicalDevice, |
| 16471 | const VkPhysicalDeviceExternalFenceInfo* pExternalFenceInfo, |
| 16472 | VkExternalFenceProperties* pExternalFenceProperties) |
| 16473 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 16474 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 16475 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceExternalFencePropertiesKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16476 | mImpl->log("start vkGetPhysicalDeviceExternalFencePropertiesKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16477 | auto stream = mImpl->stream(); |
| 16478 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16479 | auto resources = mImpl->resources(); |
| 16480 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 16481 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16482 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16483 | VkPhysicalDeviceExternalFenceInfo* local_pExternalFenceInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 16484 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16485 | local_pExternalFenceInfo = nullptr; |
| 16486 | if (pExternalFenceInfo) |
| 16487 | { |
| 16488 | local_pExternalFenceInfo = (VkPhysicalDeviceExternalFenceInfo*)pool->alloc(sizeof(const VkPhysicalDeviceExternalFenceInfo)); |
| 16489 | deepcopy_VkPhysicalDeviceExternalFenceInfo(pool, pExternalFenceInfo, (VkPhysicalDeviceExternalFenceInfo*)(local_pExternalFenceInfo)); |
| 16490 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 16491 | if (local_pExternalFenceInfo) |
| 16492 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 16493 | transform_tohost_VkPhysicalDeviceExternalFenceInfo(mImpl->resources(), (VkPhysicalDeviceExternalFenceInfo*)(local_pExternalFenceInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 16494 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16495 | countingStream->rewind(); |
| 16496 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16497 | uint64_t cgen_var_1091; |
| 16498 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1091, 1); |
| 16499 | countingStream->write((uint64_t*)&cgen_var_1091, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16500 | marshal_VkPhysicalDeviceExternalFenceInfo(countingStream, (VkPhysicalDeviceExternalFenceInfo*)(local_pExternalFenceInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16501 | marshal_VkExternalFenceProperties(countingStream, (VkExternalFenceProperties*)(pExternalFenceProperties)); |
| 16502 | } |
| 16503 | uint32_t packetSize_vkGetPhysicalDeviceExternalFencePropertiesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 16504 | countingStream->rewind(); |
| 16505 | uint32_t opcode_vkGetPhysicalDeviceExternalFencePropertiesKHR = OP_vkGetPhysicalDeviceExternalFencePropertiesKHR; |
| 16506 | stream->write(&opcode_vkGetPhysicalDeviceExternalFencePropertiesKHR, sizeof(uint32_t)); |
| 16507 | stream->write(&packetSize_vkGetPhysicalDeviceExternalFencePropertiesKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16508 | uint64_t cgen_var_1092; |
| 16509 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1092, 1); |
| 16510 | stream->write((uint64_t*)&cgen_var_1092, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16511 | marshal_VkPhysicalDeviceExternalFenceInfo(stream, (VkPhysicalDeviceExternalFenceInfo*)(local_pExternalFenceInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16512 | marshal_VkExternalFenceProperties(stream, (VkExternalFenceProperties*)(pExternalFenceProperties)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 16513 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceExternalFencePropertiesKHR readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16514 | unmarshal_VkExternalFenceProperties(stream, (VkExternalFenceProperties*)(pExternalFenceProperties)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 16515 | if (pExternalFenceProperties) |
| 16516 | { |
| 16517 | transform_fromhost_VkExternalFenceProperties(mImpl->resources(), (VkExternalFenceProperties*)(pExternalFenceProperties)); |
| 16518 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 16519 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceExternalFencePropertiesKHR returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16520 | mImpl->log("finish vkGetPhysicalDeviceExternalFencePropertiesKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16521 | } |
| 16522 | |
| 16523 | #endif |
| 16524 | #ifdef VK_KHR_external_fence |
| 16525 | #endif |
| 16526 | #ifdef VK_KHR_external_fence_win32 |
| 16527 | VkResult VkEncoder::vkImportFenceWin32HandleKHR( |
| 16528 | VkDevice device, |
| 16529 | const VkImportFenceWin32HandleInfoKHR* pImportFenceWin32HandleInfo) |
| 16530 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 16531 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 16532 | AEMU_SCOPED_TRACE("vkImportFenceWin32HandleKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16533 | mImpl->log("start vkImportFenceWin32HandleKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16534 | auto stream = mImpl->stream(); |
| 16535 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16536 | auto resources = mImpl->resources(); |
| 16537 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 16538 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16539 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16540 | VkImportFenceWin32HandleInfoKHR* local_pImportFenceWin32HandleInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 16541 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16542 | local_pImportFenceWin32HandleInfo = nullptr; |
| 16543 | if (pImportFenceWin32HandleInfo) |
| 16544 | { |
| 16545 | local_pImportFenceWin32HandleInfo = (VkImportFenceWin32HandleInfoKHR*)pool->alloc(sizeof(const VkImportFenceWin32HandleInfoKHR)); |
| 16546 | deepcopy_VkImportFenceWin32HandleInfoKHR(pool, pImportFenceWin32HandleInfo, (VkImportFenceWin32HandleInfoKHR*)(local_pImportFenceWin32HandleInfo)); |
| 16547 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 16548 | if (local_pImportFenceWin32HandleInfo) |
| 16549 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 16550 | transform_tohost_VkImportFenceWin32HandleInfoKHR(mImpl->resources(), (VkImportFenceWin32HandleInfoKHR*)(local_pImportFenceWin32HandleInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 16551 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16552 | countingStream->rewind(); |
| 16553 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16554 | uint64_t cgen_var_1093; |
| 16555 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1093, 1); |
| 16556 | countingStream->write((uint64_t*)&cgen_var_1093, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16557 | marshal_VkImportFenceWin32HandleInfoKHR(countingStream, (VkImportFenceWin32HandleInfoKHR*)(local_pImportFenceWin32HandleInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16558 | } |
| 16559 | uint32_t packetSize_vkImportFenceWin32HandleKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 16560 | countingStream->rewind(); |
| 16561 | uint32_t opcode_vkImportFenceWin32HandleKHR = OP_vkImportFenceWin32HandleKHR; |
| 16562 | stream->write(&opcode_vkImportFenceWin32HandleKHR, sizeof(uint32_t)); |
| 16563 | stream->write(&packetSize_vkImportFenceWin32HandleKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16564 | uint64_t cgen_var_1094; |
| 16565 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1094, 1); |
| 16566 | stream->write((uint64_t*)&cgen_var_1094, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16567 | marshal_VkImportFenceWin32HandleInfoKHR(stream, (VkImportFenceWin32HandleInfoKHR*)(local_pImportFenceWin32HandleInfo)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 16568 | AEMU_SCOPED_TRACE("vkImportFenceWin32HandleKHR readParams"); |
| 16569 | AEMU_SCOPED_TRACE("vkImportFenceWin32HandleKHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16570 | VkResult vkImportFenceWin32HandleKHR_VkResult_return = (VkResult)0; |
| 16571 | stream->read(&vkImportFenceWin32HandleKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16572 | countingStream->clearPool(); |
| 16573 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 16574 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16575 | mImpl->log("finish vkImportFenceWin32HandleKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16576 | return vkImportFenceWin32HandleKHR_VkResult_return; |
| 16577 | } |
| 16578 | |
| 16579 | VkResult VkEncoder::vkGetFenceWin32HandleKHR( |
| 16580 | VkDevice device, |
| 16581 | const VkFenceGetWin32HandleInfoKHR* pGetWin32HandleInfo, |
| 16582 | HANDLE* pHandle) |
| 16583 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 16584 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 16585 | AEMU_SCOPED_TRACE("vkGetFenceWin32HandleKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16586 | mImpl->log("start vkGetFenceWin32HandleKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16587 | auto stream = mImpl->stream(); |
| 16588 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16589 | auto resources = mImpl->resources(); |
| 16590 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 16591 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16592 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16593 | VkFenceGetWin32HandleInfoKHR* local_pGetWin32HandleInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 16594 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16595 | local_pGetWin32HandleInfo = nullptr; |
| 16596 | if (pGetWin32HandleInfo) |
| 16597 | { |
| 16598 | local_pGetWin32HandleInfo = (VkFenceGetWin32HandleInfoKHR*)pool->alloc(sizeof(const VkFenceGetWin32HandleInfoKHR)); |
| 16599 | deepcopy_VkFenceGetWin32HandleInfoKHR(pool, pGetWin32HandleInfo, (VkFenceGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo)); |
| 16600 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 16601 | if (local_pGetWin32HandleInfo) |
| 16602 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 16603 | transform_tohost_VkFenceGetWin32HandleInfoKHR(mImpl->resources(), (VkFenceGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 16604 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16605 | countingStream->rewind(); |
| 16606 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16607 | uint64_t cgen_var_1095; |
| 16608 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1095, 1); |
| 16609 | countingStream->write((uint64_t*)&cgen_var_1095, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16610 | marshal_VkFenceGetWin32HandleInfoKHR(countingStream, (VkFenceGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16611 | countingStream->write((HANDLE*)pHandle, sizeof(HANDLE)); |
| 16612 | } |
| 16613 | uint32_t packetSize_vkGetFenceWin32HandleKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 16614 | countingStream->rewind(); |
| 16615 | uint32_t opcode_vkGetFenceWin32HandleKHR = OP_vkGetFenceWin32HandleKHR; |
| 16616 | stream->write(&opcode_vkGetFenceWin32HandleKHR, sizeof(uint32_t)); |
| 16617 | stream->write(&packetSize_vkGetFenceWin32HandleKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16618 | uint64_t cgen_var_1096; |
| 16619 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1096, 1); |
| 16620 | stream->write((uint64_t*)&cgen_var_1096, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16621 | marshal_VkFenceGetWin32HandleInfoKHR(stream, (VkFenceGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16622 | stream->write((HANDLE*)pHandle, sizeof(HANDLE)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 16623 | AEMU_SCOPED_TRACE("vkGetFenceWin32HandleKHR readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16624 | stream->read((HANDLE*)pHandle, sizeof(HANDLE)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 16625 | AEMU_SCOPED_TRACE("vkGetFenceWin32HandleKHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16626 | VkResult vkGetFenceWin32HandleKHR_VkResult_return = (VkResult)0; |
| 16627 | stream->read(&vkGetFenceWin32HandleKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16628 | countingStream->clearPool(); |
| 16629 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 16630 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16631 | mImpl->log("finish vkGetFenceWin32HandleKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16632 | return vkGetFenceWin32HandleKHR_VkResult_return; |
| 16633 | } |
| 16634 | |
| 16635 | #endif |
| 16636 | #ifdef VK_KHR_external_fence_fd |
| 16637 | VkResult VkEncoder::vkImportFenceFdKHR( |
| 16638 | VkDevice device, |
| 16639 | const VkImportFenceFdInfoKHR* pImportFenceFdInfo) |
| 16640 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 16641 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 16642 | AEMU_SCOPED_TRACE("vkImportFenceFdKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16643 | mImpl->log("start vkImportFenceFdKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16644 | auto stream = mImpl->stream(); |
| 16645 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16646 | auto resources = mImpl->resources(); |
| 16647 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 16648 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16649 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16650 | VkImportFenceFdInfoKHR* local_pImportFenceFdInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 16651 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16652 | local_pImportFenceFdInfo = nullptr; |
| 16653 | if (pImportFenceFdInfo) |
| 16654 | { |
| 16655 | local_pImportFenceFdInfo = (VkImportFenceFdInfoKHR*)pool->alloc(sizeof(const VkImportFenceFdInfoKHR)); |
| 16656 | deepcopy_VkImportFenceFdInfoKHR(pool, pImportFenceFdInfo, (VkImportFenceFdInfoKHR*)(local_pImportFenceFdInfo)); |
| 16657 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 16658 | if (local_pImportFenceFdInfo) |
| 16659 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 16660 | transform_tohost_VkImportFenceFdInfoKHR(mImpl->resources(), (VkImportFenceFdInfoKHR*)(local_pImportFenceFdInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 16661 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16662 | countingStream->rewind(); |
| 16663 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16664 | uint64_t cgen_var_1097; |
| 16665 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1097, 1); |
| 16666 | countingStream->write((uint64_t*)&cgen_var_1097, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16667 | marshal_VkImportFenceFdInfoKHR(countingStream, (VkImportFenceFdInfoKHR*)(local_pImportFenceFdInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16668 | } |
| 16669 | uint32_t packetSize_vkImportFenceFdKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 16670 | countingStream->rewind(); |
| 16671 | uint32_t opcode_vkImportFenceFdKHR = OP_vkImportFenceFdKHR; |
| 16672 | stream->write(&opcode_vkImportFenceFdKHR, sizeof(uint32_t)); |
| 16673 | stream->write(&packetSize_vkImportFenceFdKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16674 | uint64_t cgen_var_1098; |
| 16675 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1098, 1); |
| 16676 | stream->write((uint64_t*)&cgen_var_1098, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16677 | marshal_VkImportFenceFdInfoKHR(stream, (VkImportFenceFdInfoKHR*)(local_pImportFenceFdInfo)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 16678 | AEMU_SCOPED_TRACE("vkImportFenceFdKHR readParams"); |
| 16679 | AEMU_SCOPED_TRACE("vkImportFenceFdKHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16680 | VkResult vkImportFenceFdKHR_VkResult_return = (VkResult)0; |
| 16681 | stream->read(&vkImportFenceFdKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16682 | countingStream->clearPool(); |
| 16683 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 16684 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16685 | mImpl->log("finish vkImportFenceFdKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16686 | return vkImportFenceFdKHR_VkResult_return; |
| 16687 | } |
| 16688 | |
| 16689 | VkResult VkEncoder::vkGetFenceFdKHR( |
| 16690 | VkDevice device, |
| 16691 | const VkFenceGetFdInfoKHR* pGetFdInfo, |
| 16692 | int* pFd) |
| 16693 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 16694 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 16695 | AEMU_SCOPED_TRACE("vkGetFenceFdKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16696 | mImpl->log("start vkGetFenceFdKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16697 | auto stream = mImpl->stream(); |
| 16698 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16699 | auto resources = mImpl->resources(); |
| 16700 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 16701 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16702 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16703 | VkFenceGetFdInfoKHR* local_pGetFdInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 16704 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16705 | local_pGetFdInfo = nullptr; |
| 16706 | if (pGetFdInfo) |
| 16707 | { |
| 16708 | local_pGetFdInfo = (VkFenceGetFdInfoKHR*)pool->alloc(sizeof(const VkFenceGetFdInfoKHR)); |
| 16709 | deepcopy_VkFenceGetFdInfoKHR(pool, pGetFdInfo, (VkFenceGetFdInfoKHR*)(local_pGetFdInfo)); |
| 16710 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 16711 | if (local_pGetFdInfo) |
| 16712 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 16713 | transform_tohost_VkFenceGetFdInfoKHR(mImpl->resources(), (VkFenceGetFdInfoKHR*)(local_pGetFdInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 16714 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16715 | countingStream->rewind(); |
| 16716 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16717 | uint64_t cgen_var_1099; |
| 16718 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1099, 1); |
| 16719 | countingStream->write((uint64_t*)&cgen_var_1099, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16720 | marshal_VkFenceGetFdInfoKHR(countingStream, (VkFenceGetFdInfoKHR*)(local_pGetFdInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16721 | countingStream->write((int*)pFd, sizeof(int)); |
| 16722 | } |
| 16723 | uint32_t packetSize_vkGetFenceFdKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 16724 | countingStream->rewind(); |
| 16725 | uint32_t opcode_vkGetFenceFdKHR = OP_vkGetFenceFdKHR; |
| 16726 | stream->write(&opcode_vkGetFenceFdKHR, sizeof(uint32_t)); |
| 16727 | stream->write(&packetSize_vkGetFenceFdKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16728 | uint64_t cgen_var_1100; |
| 16729 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1100, 1); |
| 16730 | stream->write((uint64_t*)&cgen_var_1100, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16731 | marshal_VkFenceGetFdInfoKHR(stream, (VkFenceGetFdInfoKHR*)(local_pGetFdInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16732 | stream->write((int*)pFd, sizeof(int)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 16733 | AEMU_SCOPED_TRACE("vkGetFenceFdKHR readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16734 | stream->read((int*)pFd, sizeof(int)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 16735 | AEMU_SCOPED_TRACE("vkGetFenceFdKHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16736 | VkResult vkGetFenceFdKHR_VkResult_return = (VkResult)0; |
| 16737 | stream->read(&vkGetFenceFdKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16738 | countingStream->clearPool(); |
| 16739 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 16740 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16741 | mImpl->log("finish vkGetFenceFdKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16742 | return vkGetFenceFdKHR_VkResult_return; |
| 16743 | } |
| 16744 | |
| 16745 | #endif |
| 16746 | #ifdef VK_KHR_maintenance2 |
| 16747 | #endif |
| 16748 | #ifdef VK_KHR_get_surface_capabilities2 |
| 16749 | VkResult VkEncoder::vkGetPhysicalDeviceSurfaceCapabilities2KHR( |
| 16750 | VkPhysicalDevice physicalDevice, |
| 16751 | const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, |
| 16752 | VkSurfaceCapabilities2KHR* pSurfaceCapabilities) |
| 16753 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 16754 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 16755 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceSurfaceCapabilities2KHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16756 | mImpl->log("start vkGetPhysicalDeviceSurfaceCapabilities2KHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16757 | auto stream = mImpl->stream(); |
| 16758 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16759 | auto resources = mImpl->resources(); |
| 16760 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 16761 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16762 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16763 | VkPhysicalDeviceSurfaceInfo2KHR* local_pSurfaceInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 16764 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16765 | local_pSurfaceInfo = nullptr; |
| 16766 | if (pSurfaceInfo) |
| 16767 | { |
| 16768 | local_pSurfaceInfo = (VkPhysicalDeviceSurfaceInfo2KHR*)pool->alloc(sizeof(const VkPhysicalDeviceSurfaceInfo2KHR)); |
| 16769 | deepcopy_VkPhysicalDeviceSurfaceInfo2KHR(pool, pSurfaceInfo, (VkPhysicalDeviceSurfaceInfo2KHR*)(local_pSurfaceInfo)); |
| 16770 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 16771 | if (local_pSurfaceInfo) |
| 16772 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 16773 | transform_tohost_VkPhysicalDeviceSurfaceInfo2KHR(mImpl->resources(), (VkPhysicalDeviceSurfaceInfo2KHR*)(local_pSurfaceInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 16774 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16775 | countingStream->rewind(); |
| 16776 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16777 | uint64_t cgen_var_1101; |
| 16778 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1101, 1); |
| 16779 | countingStream->write((uint64_t*)&cgen_var_1101, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16780 | marshal_VkPhysicalDeviceSurfaceInfo2KHR(countingStream, (VkPhysicalDeviceSurfaceInfo2KHR*)(local_pSurfaceInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16781 | marshal_VkSurfaceCapabilities2KHR(countingStream, (VkSurfaceCapabilities2KHR*)(pSurfaceCapabilities)); |
| 16782 | } |
| 16783 | uint32_t packetSize_vkGetPhysicalDeviceSurfaceCapabilities2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 16784 | countingStream->rewind(); |
| 16785 | uint32_t opcode_vkGetPhysicalDeviceSurfaceCapabilities2KHR = OP_vkGetPhysicalDeviceSurfaceCapabilities2KHR; |
| 16786 | stream->write(&opcode_vkGetPhysicalDeviceSurfaceCapabilities2KHR, sizeof(uint32_t)); |
| 16787 | stream->write(&packetSize_vkGetPhysicalDeviceSurfaceCapabilities2KHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16788 | uint64_t cgen_var_1102; |
| 16789 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1102, 1); |
| 16790 | stream->write((uint64_t*)&cgen_var_1102, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16791 | marshal_VkPhysicalDeviceSurfaceInfo2KHR(stream, (VkPhysicalDeviceSurfaceInfo2KHR*)(local_pSurfaceInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16792 | marshal_VkSurfaceCapabilities2KHR(stream, (VkSurfaceCapabilities2KHR*)(pSurfaceCapabilities)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 16793 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceSurfaceCapabilities2KHR readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16794 | unmarshal_VkSurfaceCapabilities2KHR(stream, (VkSurfaceCapabilities2KHR*)(pSurfaceCapabilities)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 16795 | if (pSurfaceCapabilities) |
| 16796 | { |
| 16797 | transform_fromhost_VkSurfaceCapabilities2KHR(mImpl->resources(), (VkSurfaceCapabilities2KHR*)(pSurfaceCapabilities)); |
| 16798 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 16799 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceSurfaceCapabilities2KHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16800 | VkResult vkGetPhysicalDeviceSurfaceCapabilities2KHR_VkResult_return = (VkResult)0; |
| 16801 | stream->read(&vkGetPhysicalDeviceSurfaceCapabilities2KHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16802 | countingStream->clearPool(); |
| 16803 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 16804 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16805 | mImpl->log("finish vkGetPhysicalDeviceSurfaceCapabilities2KHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16806 | return vkGetPhysicalDeviceSurfaceCapabilities2KHR_VkResult_return; |
| 16807 | } |
| 16808 | |
| 16809 | VkResult VkEncoder::vkGetPhysicalDeviceSurfaceFormats2KHR( |
| 16810 | VkPhysicalDevice physicalDevice, |
| 16811 | const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, |
| 16812 | uint32_t* pSurfaceFormatCount, |
| 16813 | VkSurfaceFormat2KHR* pSurfaceFormats) |
| 16814 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 16815 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 16816 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceSurfaceFormats2KHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16817 | mImpl->log("start vkGetPhysicalDeviceSurfaceFormats2KHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16818 | auto stream = mImpl->stream(); |
| 16819 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16820 | auto resources = mImpl->resources(); |
| 16821 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 16822 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16823 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16824 | VkPhysicalDeviceSurfaceInfo2KHR* local_pSurfaceInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 16825 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16826 | local_pSurfaceInfo = nullptr; |
| 16827 | if (pSurfaceInfo) |
| 16828 | { |
| 16829 | local_pSurfaceInfo = (VkPhysicalDeviceSurfaceInfo2KHR*)pool->alloc(sizeof(const VkPhysicalDeviceSurfaceInfo2KHR)); |
| 16830 | deepcopy_VkPhysicalDeviceSurfaceInfo2KHR(pool, pSurfaceInfo, (VkPhysicalDeviceSurfaceInfo2KHR*)(local_pSurfaceInfo)); |
| 16831 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 16832 | if (local_pSurfaceInfo) |
| 16833 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 16834 | transform_tohost_VkPhysicalDeviceSurfaceInfo2KHR(mImpl->resources(), (VkPhysicalDeviceSurfaceInfo2KHR*)(local_pSurfaceInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 16835 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16836 | countingStream->rewind(); |
| 16837 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16838 | uint64_t cgen_var_1103; |
| 16839 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1103, 1); |
| 16840 | countingStream->write((uint64_t*)&cgen_var_1103, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16841 | marshal_VkPhysicalDeviceSurfaceInfo2KHR(countingStream, (VkPhysicalDeviceSurfaceInfo2KHR*)(local_pSurfaceInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 16842 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16843 | uint64_t cgen_var_1104 = (uint64_t)(uintptr_t)pSurfaceFormatCount; |
| 16844 | countingStream->putBe64(cgen_var_1104); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16845 | if (pSurfaceFormatCount) |
| 16846 | { |
| 16847 | countingStream->write((uint32_t*)pSurfaceFormatCount, sizeof(uint32_t)); |
| 16848 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 16849 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16850 | uint64_t cgen_var_1105 = (uint64_t)(uintptr_t)pSurfaceFormats; |
| 16851 | countingStream->putBe64(cgen_var_1105); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16852 | if (pSurfaceFormats) |
| 16853 | { |
| 16854 | for (uint32_t i = 0; i < (uint32_t)(*(pSurfaceFormatCount)); ++i) |
| 16855 | { |
| 16856 | marshal_VkSurfaceFormat2KHR(countingStream, (VkSurfaceFormat2KHR*)(pSurfaceFormats + i)); |
| 16857 | } |
| 16858 | } |
| 16859 | } |
| 16860 | uint32_t packetSize_vkGetPhysicalDeviceSurfaceFormats2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 16861 | countingStream->rewind(); |
| 16862 | uint32_t opcode_vkGetPhysicalDeviceSurfaceFormats2KHR = OP_vkGetPhysicalDeviceSurfaceFormats2KHR; |
| 16863 | stream->write(&opcode_vkGetPhysicalDeviceSurfaceFormats2KHR, sizeof(uint32_t)); |
| 16864 | stream->write(&packetSize_vkGetPhysicalDeviceSurfaceFormats2KHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16865 | uint64_t cgen_var_1106; |
| 16866 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1106, 1); |
| 16867 | stream->write((uint64_t*)&cgen_var_1106, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16868 | marshal_VkPhysicalDeviceSurfaceInfo2KHR(stream, (VkPhysicalDeviceSurfaceInfo2KHR*)(local_pSurfaceInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 16869 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16870 | uint64_t cgen_var_1107 = (uint64_t)(uintptr_t)pSurfaceFormatCount; |
| 16871 | stream->putBe64(cgen_var_1107); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16872 | if (pSurfaceFormatCount) |
| 16873 | { |
| 16874 | stream->write((uint32_t*)pSurfaceFormatCount, sizeof(uint32_t)); |
| 16875 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 16876 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16877 | uint64_t cgen_var_1108 = (uint64_t)(uintptr_t)pSurfaceFormats; |
| 16878 | stream->putBe64(cgen_var_1108); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16879 | if (pSurfaceFormats) |
| 16880 | { |
| 16881 | for (uint32_t i = 0; i < (uint32_t)(*(pSurfaceFormatCount)); ++i) |
| 16882 | { |
| 16883 | marshal_VkSurfaceFormat2KHR(stream, (VkSurfaceFormat2KHR*)(pSurfaceFormats + i)); |
| 16884 | } |
| 16885 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 16886 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceSurfaceFormats2KHR readParams"); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 16887 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16888 | uint32_t* check_pSurfaceFormatCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 16889 | check_pSurfaceFormatCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16890 | if (pSurfaceFormatCount) |
| 16891 | { |
| 16892 | if (!(check_pSurfaceFormatCount)) |
| 16893 | { |
| 16894 | fprintf(stderr, "fatal: pSurfaceFormatCount inconsistent between guest and host\n"); |
| 16895 | } |
| 16896 | stream->read((uint32_t*)pSurfaceFormatCount, sizeof(uint32_t)); |
| 16897 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 16898 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16899 | VkSurfaceFormat2KHR* check_pSurfaceFormats; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 16900 | check_pSurfaceFormats = (VkSurfaceFormat2KHR*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16901 | if (pSurfaceFormats) |
| 16902 | { |
| 16903 | if (!(check_pSurfaceFormats)) |
| 16904 | { |
| 16905 | fprintf(stderr, "fatal: pSurfaceFormats inconsistent between guest and host\n"); |
| 16906 | } |
| 16907 | for (uint32_t i = 0; i < (uint32_t)(*(pSurfaceFormatCount)); ++i) |
| 16908 | { |
| 16909 | unmarshal_VkSurfaceFormat2KHR(stream, (VkSurfaceFormat2KHR*)(pSurfaceFormats + i)); |
| 16910 | } |
| 16911 | } |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 16912 | if (pSurfaceFormats) |
| 16913 | { |
| 16914 | for (uint32_t i = 0; i < (uint32_t)(*(pSurfaceFormatCount)); ++i) |
| 16915 | { |
| 16916 | transform_fromhost_VkSurfaceFormat2KHR(mImpl->resources(), (VkSurfaceFormat2KHR*)(pSurfaceFormats + i)); |
| 16917 | } |
| 16918 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 16919 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceSurfaceFormats2KHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16920 | VkResult vkGetPhysicalDeviceSurfaceFormats2KHR_VkResult_return = (VkResult)0; |
| 16921 | stream->read(&vkGetPhysicalDeviceSurfaceFormats2KHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16922 | countingStream->clearPool(); |
| 16923 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 16924 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16925 | mImpl->log("finish vkGetPhysicalDeviceSurfaceFormats2KHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16926 | return vkGetPhysicalDeviceSurfaceFormats2KHR_VkResult_return; |
| 16927 | } |
| 16928 | |
| 16929 | #endif |
| 16930 | #ifdef VK_KHR_variable_pointers |
| 16931 | #endif |
| 16932 | #ifdef VK_KHR_get_display_properties2 |
| 16933 | VkResult VkEncoder::vkGetPhysicalDeviceDisplayProperties2KHR( |
| 16934 | VkPhysicalDevice physicalDevice, |
| 16935 | uint32_t* pPropertyCount, |
| 16936 | VkDisplayProperties2KHR* pProperties) |
| 16937 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 16938 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 16939 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceDisplayProperties2KHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16940 | mImpl->log("start vkGetPhysicalDeviceDisplayProperties2KHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16941 | auto stream = mImpl->stream(); |
| 16942 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16943 | auto resources = mImpl->resources(); |
| 16944 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 16945 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16946 | VkPhysicalDevice local_physicalDevice; |
| 16947 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16948 | countingStream->rewind(); |
| 16949 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16950 | uint64_t cgen_var_1111; |
| 16951 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1111, 1); |
| 16952 | countingStream->write((uint64_t*)&cgen_var_1111, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 16953 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16954 | uint64_t cgen_var_1112 = (uint64_t)(uintptr_t)pPropertyCount; |
| 16955 | countingStream->putBe64(cgen_var_1112); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16956 | if (pPropertyCount) |
| 16957 | { |
| 16958 | countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 16959 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 16960 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16961 | uint64_t cgen_var_1113 = (uint64_t)(uintptr_t)pProperties; |
| 16962 | countingStream->putBe64(cgen_var_1113); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16963 | if (pProperties) |
| 16964 | { |
| 16965 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 16966 | { |
| 16967 | marshal_VkDisplayProperties2KHR(countingStream, (VkDisplayProperties2KHR*)(pProperties + i)); |
| 16968 | } |
| 16969 | } |
| 16970 | } |
| 16971 | uint32_t packetSize_vkGetPhysicalDeviceDisplayProperties2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 16972 | countingStream->rewind(); |
| 16973 | uint32_t opcode_vkGetPhysicalDeviceDisplayProperties2KHR = OP_vkGetPhysicalDeviceDisplayProperties2KHR; |
| 16974 | stream->write(&opcode_vkGetPhysicalDeviceDisplayProperties2KHR, sizeof(uint32_t)); |
| 16975 | stream->write(&packetSize_vkGetPhysicalDeviceDisplayProperties2KHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16976 | uint64_t cgen_var_1114; |
| 16977 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1114, 1); |
| 16978 | stream->write((uint64_t*)&cgen_var_1114, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 16979 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16980 | uint64_t cgen_var_1115 = (uint64_t)(uintptr_t)pPropertyCount; |
| 16981 | stream->putBe64(cgen_var_1115); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16982 | if (pPropertyCount) |
| 16983 | { |
| 16984 | stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 16985 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 16986 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16987 | uint64_t cgen_var_1116 = (uint64_t)(uintptr_t)pProperties; |
| 16988 | stream->putBe64(cgen_var_1116); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16989 | if (pProperties) |
| 16990 | { |
| 16991 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 16992 | { |
| 16993 | marshal_VkDisplayProperties2KHR(stream, (VkDisplayProperties2KHR*)(pProperties + i)); |
| 16994 | } |
| 16995 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 16996 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceDisplayProperties2KHR readParams"); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 16997 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16998 | uint32_t* check_pPropertyCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 16999 | check_pPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17000 | if (pPropertyCount) |
| 17001 | { |
| 17002 | if (!(check_pPropertyCount)) |
| 17003 | { |
| 17004 | fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n"); |
| 17005 | } |
| 17006 | stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 17007 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17008 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17009 | VkDisplayProperties2KHR* check_pProperties; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17010 | check_pProperties = (VkDisplayProperties2KHR*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17011 | if (pProperties) |
| 17012 | { |
| 17013 | if (!(check_pProperties)) |
| 17014 | { |
| 17015 | fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n"); |
| 17016 | } |
| 17017 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 17018 | { |
| 17019 | unmarshal_VkDisplayProperties2KHR(stream, (VkDisplayProperties2KHR*)(pProperties + i)); |
| 17020 | } |
| 17021 | } |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 17022 | if (pProperties) |
| 17023 | { |
| 17024 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 17025 | { |
| 17026 | transform_fromhost_VkDisplayProperties2KHR(mImpl->resources(), (VkDisplayProperties2KHR*)(pProperties + i)); |
| 17027 | } |
| 17028 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 17029 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceDisplayProperties2KHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17030 | VkResult vkGetPhysicalDeviceDisplayProperties2KHR_VkResult_return = (VkResult)0; |
| 17031 | stream->read(&vkGetPhysicalDeviceDisplayProperties2KHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17032 | countingStream->clearPool(); |
| 17033 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 17034 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17035 | mImpl->log("finish vkGetPhysicalDeviceDisplayProperties2KHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17036 | return vkGetPhysicalDeviceDisplayProperties2KHR_VkResult_return; |
| 17037 | } |
| 17038 | |
| 17039 | VkResult VkEncoder::vkGetPhysicalDeviceDisplayPlaneProperties2KHR( |
| 17040 | VkPhysicalDevice physicalDevice, |
| 17041 | uint32_t* pPropertyCount, |
| 17042 | VkDisplayPlaneProperties2KHR* pProperties) |
| 17043 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 17044 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 17045 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceDisplayPlaneProperties2KHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17046 | mImpl->log("start vkGetPhysicalDeviceDisplayPlaneProperties2KHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17047 | auto stream = mImpl->stream(); |
| 17048 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17049 | auto resources = mImpl->resources(); |
| 17050 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 17051 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17052 | VkPhysicalDevice local_physicalDevice; |
| 17053 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17054 | countingStream->rewind(); |
| 17055 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17056 | uint64_t cgen_var_1119; |
| 17057 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1119, 1); |
| 17058 | countingStream->write((uint64_t*)&cgen_var_1119, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17059 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17060 | uint64_t cgen_var_1120 = (uint64_t)(uintptr_t)pPropertyCount; |
| 17061 | countingStream->putBe64(cgen_var_1120); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17062 | if (pPropertyCount) |
| 17063 | { |
| 17064 | countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 17065 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17066 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17067 | uint64_t cgen_var_1121 = (uint64_t)(uintptr_t)pProperties; |
| 17068 | countingStream->putBe64(cgen_var_1121); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17069 | if (pProperties) |
| 17070 | { |
| 17071 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 17072 | { |
| 17073 | marshal_VkDisplayPlaneProperties2KHR(countingStream, (VkDisplayPlaneProperties2KHR*)(pProperties + i)); |
| 17074 | } |
| 17075 | } |
| 17076 | } |
| 17077 | uint32_t packetSize_vkGetPhysicalDeviceDisplayPlaneProperties2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 17078 | countingStream->rewind(); |
| 17079 | uint32_t opcode_vkGetPhysicalDeviceDisplayPlaneProperties2KHR = OP_vkGetPhysicalDeviceDisplayPlaneProperties2KHR; |
| 17080 | stream->write(&opcode_vkGetPhysicalDeviceDisplayPlaneProperties2KHR, sizeof(uint32_t)); |
| 17081 | stream->write(&packetSize_vkGetPhysicalDeviceDisplayPlaneProperties2KHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17082 | uint64_t cgen_var_1122; |
| 17083 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1122, 1); |
| 17084 | stream->write((uint64_t*)&cgen_var_1122, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17085 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17086 | uint64_t cgen_var_1123 = (uint64_t)(uintptr_t)pPropertyCount; |
| 17087 | stream->putBe64(cgen_var_1123); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17088 | if (pPropertyCount) |
| 17089 | { |
| 17090 | stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 17091 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17092 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17093 | uint64_t cgen_var_1124 = (uint64_t)(uintptr_t)pProperties; |
| 17094 | stream->putBe64(cgen_var_1124); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17095 | if (pProperties) |
| 17096 | { |
| 17097 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 17098 | { |
| 17099 | marshal_VkDisplayPlaneProperties2KHR(stream, (VkDisplayPlaneProperties2KHR*)(pProperties + i)); |
| 17100 | } |
| 17101 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 17102 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceDisplayPlaneProperties2KHR readParams"); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17103 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17104 | uint32_t* check_pPropertyCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17105 | check_pPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17106 | if (pPropertyCount) |
| 17107 | { |
| 17108 | if (!(check_pPropertyCount)) |
| 17109 | { |
| 17110 | fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n"); |
| 17111 | } |
| 17112 | stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 17113 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17114 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17115 | VkDisplayPlaneProperties2KHR* check_pProperties; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17116 | check_pProperties = (VkDisplayPlaneProperties2KHR*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17117 | if (pProperties) |
| 17118 | { |
| 17119 | if (!(check_pProperties)) |
| 17120 | { |
| 17121 | fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n"); |
| 17122 | } |
| 17123 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 17124 | { |
| 17125 | unmarshal_VkDisplayPlaneProperties2KHR(stream, (VkDisplayPlaneProperties2KHR*)(pProperties + i)); |
| 17126 | } |
| 17127 | } |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 17128 | if (pProperties) |
| 17129 | { |
| 17130 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 17131 | { |
| 17132 | transform_fromhost_VkDisplayPlaneProperties2KHR(mImpl->resources(), (VkDisplayPlaneProperties2KHR*)(pProperties + i)); |
| 17133 | } |
| 17134 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 17135 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceDisplayPlaneProperties2KHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17136 | VkResult vkGetPhysicalDeviceDisplayPlaneProperties2KHR_VkResult_return = (VkResult)0; |
| 17137 | stream->read(&vkGetPhysicalDeviceDisplayPlaneProperties2KHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17138 | countingStream->clearPool(); |
| 17139 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 17140 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17141 | mImpl->log("finish vkGetPhysicalDeviceDisplayPlaneProperties2KHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17142 | return vkGetPhysicalDeviceDisplayPlaneProperties2KHR_VkResult_return; |
| 17143 | } |
| 17144 | |
| 17145 | VkResult VkEncoder::vkGetDisplayModeProperties2KHR( |
| 17146 | VkPhysicalDevice physicalDevice, |
| 17147 | VkDisplayKHR display, |
| 17148 | uint32_t* pPropertyCount, |
| 17149 | VkDisplayModeProperties2KHR* pProperties) |
| 17150 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 17151 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 17152 | AEMU_SCOPED_TRACE("vkGetDisplayModeProperties2KHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17153 | mImpl->log("start vkGetDisplayModeProperties2KHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17154 | auto stream = mImpl->stream(); |
| 17155 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17156 | auto resources = mImpl->resources(); |
| 17157 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 17158 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17159 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17160 | VkDisplayKHR local_display; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 17161 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17162 | local_display = display; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17163 | countingStream->rewind(); |
| 17164 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17165 | uint64_t cgen_var_1127; |
| 17166 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1127, 1); |
| 17167 | countingStream->write((uint64_t*)&cgen_var_1127, 1 * 8); |
| 17168 | uint64_t cgen_var_1128; |
| 17169 | countingStream->handleMapping()->mapHandles_VkDisplayKHR_u64(&local_display, &cgen_var_1128, 1); |
| 17170 | countingStream->write((uint64_t*)&cgen_var_1128, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17171 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17172 | uint64_t cgen_var_1129 = (uint64_t)(uintptr_t)pPropertyCount; |
| 17173 | countingStream->putBe64(cgen_var_1129); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17174 | if (pPropertyCount) |
| 17175 | { |
| 17176 | countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 17177 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17178 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17179 | uint64_t cgen_var_1130 = (uint64_t)(uintptr_t)pProperties; |
| 17180 | countingStream->putBe64(cgen_var_1130); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17181 | if (pProperties) |
| 17182 | { |
| 17183 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 17184 | { |
| 17185 | marshal_VkDisplayModeProperties2KHR(countingStream, (VkDisplayModeProperties2KHR*)(pProperties + i)); |
| 17186 | } |
| 17187 | } |
| 17188 | } |
| 17189 | uint32_t packetSize_vkGetDisplayModeProperties2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 17190 | countingStream->rewind(); |
| 17191 | uint32_t opcode_vkGetDisplayModeProperties2KHR = OP_vkGetDisplayModeProperties2KHR; |
| 17192 | stream->write(&opcode_vkGetDisplayModeProperties2KHR, sizeof(uint32_t)); |
| 17193 | stream->write(&packetSize_vkGetDisplayModeProperties2KHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17194 | uint64_t cgen_var_1131; |
| 17195 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1131, 1); |
| 17196 | stream->write((uint64_t*)&cgen_var_1131, 1 * 8); |
| 17197 | uint64_t cgen_var_1132; |
| 17198 | stream->handleMapping()->mapHandles_VkDisplayKHR_u64(&local_display, &cgen_var_1132, 1); |
| 17199 | stream->write((uint64_t*)&cgen_var_1132, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17200 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17201 | uint64_t cgen_var_1133 = (uint64_t)(uintptr_t)pPropertyCount; |
| 17202 | stream->putBe64(cgen_var_1133); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17203 | if (pPropertyCount) |
| 17204 | { |
| 17205 | stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 17206 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17207 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17208 | uint64_t cgen_var_1134 = (uint64_t)(uintptr_t)pProperties; |
| 17209 | stream->putBe64(cgen_var_1134); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17210 | if (pProperties) |
| 17211 | { |
| 17212 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 17213 | { |
| 17214 | marshal_VkDisplayModeProperties2KHR(stream, (VkDisplayModeProperties2KHR*)(pProperties + i)); |
| 17215 | } |
| 17216 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 17217 | AEMU_SCOPED_TRACE("vkGetDisplayModeProperties2KHR readParams"); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17218 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17219 | uint32_t* check_pPropertyCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17220 | check_pPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17221 | if (pPropertyCount) |
| 17222 | { |
| 17223 | if (!(check_pPropertyCount)) |
| 17224 | { |
| 17225 | fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n"); |
| 17226 | } |
| 17227 | stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 17228 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17229 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17230 | VkDisplayModeProperties2KHR* check_pProperties; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17231 | check_pProperties = (VkDisplayModeProperties2KHR*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17232 | if (pProperties) |
| 17233 | { |
| 17234 | if (!(check_pProperties)) |
| 17235 | { |
| 17236 | fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n"); |
| 17237 | } |
| 17238 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 17239 | { |
| 17240 | unmarshal_VkDisplayModeProperties2KHR(stream, (VkDisplayModeProperties2KHR*)(pProperties + i)); |
| 17241 | } |
| 17242 | } |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 17243 | if (pProperties) |
| 17244 | { |
| 17245 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 17246 | { |
| 17247 | transform_fromhost_VkDisplayModeProperties2KHR(mImpl->resources(), (VkDisplayModeProperties2KHR*)(pProperties + i)); |
| 17248 | } |
| 17249 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 17250 | AEMU_SCOPED_TRACE("vkGetDisplayModeProperties2KHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17251 | VkResult vkGetDisplayModeProperties2KHR_VkResult_return = (VkResult)0; |
| 17252 | stream->read(&vkGetDisplayModeProperties2KHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17253 | countingStream->clearPool(); |
| 17254 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 17255 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17256 | mImpl->log("finish vkGetDisplayModeProperties2KHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17257 | return vkGetDisplayModeProperties2KHR_VkResult_return; |
| 17258 | } |
| 17259 | |
| 17260 | VkResult VkEncoder::vkGetDisplayPlaneCapabilities2KHR( |
| 17261 | VkPhysicalDevice physicalDevice, |
| 17262 | const VkDisplayPlaneInfo2KHR* pDisplayPlaneInfo, |
| 17263 | VkDisplayPlaneCapabilities2KHR* pCapabilities) |
| 17264 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 17265 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 17266 | AEMU_SCOPED_TRACE("vkGetDisplayPlaneCapabilities2KHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17267 | mImpl->log("start vkGetDisplayPlaneCapabilities2KHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17268 | auto stream = mImpl->stream(); |
| 17269 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17270 | auto resources = mImpl->resources(); |
| 17271 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 17272 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17273 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17274 | VkDisplayPlaneInfo2KHR* local_pDisplayPlaneInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 17275 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17276 | local_pDisplayPlaneInfo = nullptr; |
| 17277 | if (pDisplayPlaneInfo) |
| 17278 | { |
| 17279 | local_pDisplayPlaneInfo = (VkDisplayPlaneInfo2KHR*)pool->alloc(sizeof(const VkDisplayPlaneInfo2KHR)); |
| 17280 | deepcopy_VkDisplayPlaneInfo2KHR(pool, pDisplayPlaneInfo, (VkDisplayPlaneInfo2KHR*)(local_pDisplayPlaneInfo)); |
| 17281 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 17282 | if (local_pDisplayPlaneInfo) |
| 17283 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 17284 | transform_tohost_VkDisplayPlaneInfo2KHR(mImpl->resources(), (VkDisplayPlaneInfo2KHR*)(local_pDisplayPlaneInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 17285 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17286 | countingStream->rewind(); |
| 17287 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17288 | uint64_t cgen_var_1137; |
| 17289 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1137, 1); |
| 17290 | countingStream->write((uint64_t*)&cgen_var_1137, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17291 | marshal_VkDisplayPlaneInfo2KHR(countingStream, (VkDisplayPlaneInfo2KHR*)(local_pDisplayPlaneInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17292 | marshal_VkDisplayPlaneCapabilities2KHR(countingStream, (VkDisplayPlaneCapabilities2KHR*)(pCapabilities)); |
| 17293 | } |
| 17294 | uint32_t packetSize_vkGetDisplayPlaneCapabilities2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 17295 | countingStream->rewind(); |
| 17296 | uint32_t opcode_vkGetDisplayPlaneCapabilities2KHR = OP_vkGetDisplayPlaneCapabilities2KHR; |
| 17297 | stream->write(&opcode_vkGetDisplayPlaneCapabilities2KHR, sizeof(uint32_t)); |
| 17298 | stream->write(&packetSize_vkGetDisplayPlaneCapabilities2KHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17299 | uint64_t cgen_var_1138; |
| 17300 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1138, 1); |
| 17301 | stream->write((uint64_t*)&cgen_var_1138, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17302 | marshal_VkDisplayPlaneInfo2KHR(stream, (VkDisplayPlaneInfo2KHR*)(local_pDisplayPlaneInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17303 | marshal_VkDisplayPlaneCapabilities2KHR(stream, (VkDisplayPlaneCapabilities2KHR*)(pCapabilities)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 17304 | AEMU_SCOPED_TRACE("vkGetDisplayPlaneCapabilities2KHR readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17305 | unmarshal_VkDisplayPlaneCapabilities2KHR(stream, (VkDisplayPlaneCapabilities2KHR*)(pCapabilities)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 17306 | if (pCapabilities) |
| 17307 | { |
| 17308 | transform_fromhost_VkDisplayPlaneCapabilities2KHR(mImpl->resources(), (VkDisplayPlaneCapabilities2KHR*)(pCapabilities)); |
| 17309 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 17310 | AEMU_SCOPED_TRACE("vkGetDisplayPlaneCapabilities2KHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17311 | VkResult vkGetDisplayPlaneCapabilities2KHR_VkResult_return = (VkResult)0; |
| 17312 | stream->read(&vkGetDisplayPlaneCapabilities2KHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17313 | countingStream->clearPool(); |
| 17314 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 17315 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17316 | mImpl->log("finish vkGetDisplayPlaneCapabilities2KHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17317 | return vkGetDisplayPlaneCapabilities2KHR_VkResult_return; |
| 17318 | } |
| 17319 | |
| 17320 | #endif |
| 17321 | #ifdef VK_KHR_dedicated_allocation |
| 17322 | #endif |
| 17323 | #ifdef VK_KHR_storage_buffer_storage_class |
| 17324 | #endif |
| 17325 | #ifdef VK_KHR_relaxed_block_layout |
| 17326 | #endif |
| 17327 | #ifdef VK_KHR_get_memory_requirements2 |
| 17328 | void VkEncoder::vkGetImageMemoryRequirements2KHR( |
| 17329 | VkDevice device, |
| 17330 | const VkImageMemoryRequirementsInfo2* pInfo, |
| 17331 | VkMemoryRequirements2* pMemoryRequirements) |
| 17332 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 17333 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 17334 | AEMU_SCOPED_TRACE("vkGetImageMemoryRequirements2KHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17335 | mImpl->log("start vkGetImageMemoryRequirements2KHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17336 | auto stream = mImpl->stream(); |
| 17337 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17338 | auto resources = mImpl->resources(); |
| 17339 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 17340 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17341 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17342 | VkImageMemoryRequirementsInfo2* local_pInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 17343 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17344 | local_pInfo = nullptr; |
| 17345 | if (pInfo) |
| 17346 | { |
| 17347 | local_pInfo = (VkImageMemoryRequirementsInfo2*)pool->alloc(sizeof(const VkImageMemoryRequirementsInfo2)); |
| 17348 | deepcopy_VkImageMemoryRequirementsInfo2(pool, pInfo, (VkImageMemoryRequirementsInfo2*)(local_pInfo)); |
| 17349 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 17350 | if (local_pInfo) |
| 17351 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 17352 | transform_tohost_VkImageMemoryRequirementsInfo2(mImpl->resources(), (VkImageMemoryRequirementsInfo2*)(local_pInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 17353 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17354 | countingStream->rewind(); |
| 17355 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17356 | uint64_t cgen_var_1139; |
| 17357 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1139, 1); |
| 17358 | countingStream->write((uint64_t*)&cgen_var_1139, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17359 | marshal_VkImageMemoryRequirementsInfo2(countingStream, (VkImageMemoryRequirementsInfo2*)(local_pInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17360 | marshal_VkMemoryRequirements2(countingStream, (VkMemoryRequirements2*)(pMemoryRequirements)); |
| 17361 | } |
| 17362 | uint32_t packetSize_vkGetImageMemoryRequirements2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 17363 | countingStream->rewind(); |
| 17364 | uint32_t opcode_vkGetImageMemoryRequirements2KHR = OP_vkGetImageMemoryRequirements2KHR; |
| 17365 | stream->write(&opcode_vkGetImageMemoryRequirements2KHR, sizeof(uint32_t)); |
| 17366 | stream->write(&packetSize_vkGetImageMemoryRequirements2KHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17367 | uint64_t cgen_var_1140; |
| 17368 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1140, 1); |
| 17369 | stream->write((uint64_t*)&cgen_var_1140, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17370 | marshal_VkImageMemoryRequirementsInfo2(stream, (VkImageMemoryRequirementsInfo2*)(local_pInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17371 | marshal_VkMemoryRequirements2(stream, (VkMemoryRequirements2*)(pMemoryRequirements)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 17372 | AEMU_SCOPED_TRACE("vkGetImageMemoryRequirements2KHR readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17373 | unmarshal_VkMemoryRequirements2(stream, (VkMemoryRequirements2*)(pMemoryRequirements)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 17374 | if (pMemoryRequirements) |
| 17375 | { |
| 17376 | transform_fromhost_VkMemoryRequirements2(mImpl->resources(), (VkMemoryRequirements2*)(pMemoryRequirements)); |
| 17377 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 17378 | AEMU_SCOPED_TRACE("vkGetImageMemoryRequirements2KHR returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17379 | mImpl->log("finish vkGetImageMemoryRequirements2KHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17380 | } |
| 17381 | |
| 17382 | void VkEncoder::vkGetBufferMemoryRequirements2KHR( |
| 17383 | VkDevice device, |
| 17384 | const VkBufferMemoryRequirementsInfo2* pInfo, |
| 17385 | VkMemoryRequirements2* pMemoryRequirements) |
| 17386 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 17387 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 17388 | AEMU_SCOPED_TRACE("vkGetBufferMemoryRequirements2KHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17389 | mImpl->log("start vkGetBufferMemoryRequirements2KHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17390 | auto stream = mImpl->stream(); |
| 17391 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17392 | auto resources = mImpl->resources(); |
| 17393 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 17394 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17395 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17396 | VkBufferMemoryRequirementsInfo2* local_pInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 17397 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17398 | local_pInfo = nullptr; |
| 17399 | if (pInfo) |
| 17400 | { |
| 17401 | local_pInfo = (VkBufferMemoryRequirementsInfo2*)pool->alloc(sizeof(const VkBufferMemoryRequirementsInfo2)); |
| 17402 | deepcopy_VkBufferMemoryRequirementsInfo2(pool, pInfo, (VkBufferMemoryRequirementsInfo2*)(local_pInfo)); |
| 17403 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 17404 | if (local_pInfo) |
| 17405 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 17406 | transform_tohost_VkBufferMemoryRequirementsInfo2(mImpl->resources(), (VkBufferMemoryRequirementsInfo2*)(local_pInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 17407 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17408 | countingStream->rewind(); |
| 17409 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17410 | uint64_t cgen_var_1141; |
| 17411 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1141, 1); |
| 17412 | countingStream->write((uint64_t*)&cgen_var_1141, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17413 | marshal_VkBufferMemoryRequirementsInfo2(countingStream, (VkBufferMemoryRequirementsInfo2*)(local_pInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17414 | marshal_VkMemoryRequirements2(countingStream, (VkMemoryRequirements2*)(pMemoryRequirements)); |
| 17415 | } |
| 17416 | uint32_t packetSize_vkGetBufferMemoryRequirements2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 17417 | countingStream->rewind(); |
| 17418 | uint32_t opcode_vkGetBufferMemoryRequirements2KHR = OP_vkGetBufferMemoryRequirements2KHR; |
| 17419 | stream->write(&opcode_vkGetBufferMemoryRequirements2KHR, sizeof(uint32_t)); |
| 17420 | stream->write(&packetSize_vkGetBufferMemoryRequirements2KHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17421 | uint64_t cgen_var_1142; |
| 17422 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1142, 1); |
| 17423 | stream->write((uint64_t*)&cgen_var_1142, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17424 | marshal_VkBufferMemoryRequirementsInfo2(stream, (VkBufferMemoryRequirementsInfo2*)(local_pInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17425 | marshal_VkMemoryRequirements2(stream, (VkMemoryRequirements2*)(pMemoryRequirements)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 17426 | AEMU_SCOPED_TRACE("vkGetBufferMemoryRequirements2KHR readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17427 | unmarshal_VkMemoryRequirements2(stream, (VkMemoryRequirements2*)(pMemoryRequirements)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 17428 | if (pMemoryRequirements) |
| 17429 | { |
| 17430 | transform_fromhost_VkMemoryRequirements2(mImpl->resources(), (VkMemoryRequirements2*)(pMemoryRequirements)); |
| 17431 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 17432 | AEMU_SCOPED_TRACE("vkGetBufferMemoryRequirements2KHR returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17433 | mImpl->log("finish vkGetBufferMemoryRequirements2KHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17434 | } |
| 17435 | |
| 17436 | void VkEncoder::vkGetImageSparseMemoryRequirements2KHR( |
| 17437 | VkDevice device, |
| 17438 | const VkImageSparseMemoryRequirementsInfo2* pInfo, |
| 17439 | uint32_t* pSparseMemoryRequirementCount, |
| 17440 | VkSparseImageMemoryRequirements2* pSparseMemoryRequirements) |
| 17441 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 17442 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 17443 | AEMU_SCOPED_TRACE("vkGetImageSparseMemoryRequirements2KHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17444 | mImpl->log("start vkGetImageSparseMemoryRequirements2KHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17445 | auto stream = mImpl->stream(); |
| 17446 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17447 | auto resources = mImpl->resources(); |
| 17448 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 17449 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17450 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17451 | VkImageSparseMemoryRequirementsInfo2* local_pInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 17452 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17453 | local_pInfo = nullptr; |
| 17454 | if (pInfo) |
| 17455 | { |
| 17456 | local_pInfo = (VkImageSparseMemoryRequirementsInfo2*)pool->alloc(sizeof(const VkImageSparseMemoryRequirementsInfo2)); |
| 17457 | deepcopy_VkImageSparseMemoryRequirementsInfo2(pool, pInfo, (VkImageSparseMemoryRequirementsInfo2*)(local_pInfo)); |
| 17458 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 17459 | if (local_pInfo) |
| 17460 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 17461 | transform_tohost_VkImageSparseMemoryRequirementsInfo2(mImpl->resources(), (VkImageSparseMemoryRequirementsInfo2*)(local_pInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 17462 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17463 | countingStream->rewind(); |
| 17464 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17465 | uint64_t cgen_var_1143; |
| 17466 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1143, 1); |
| 17467 | countingStream->write((uint64_t*)&cgen_var_1143, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17468 | marshal_VkImageSparseMemoryRequirementsInfo2(countingStream, (VkImageSparseMemoryRequirementsInfo2*)(local_pInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17469 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17470 | uint64_t cgen_var_1144 = (uint64_t)(uintptr_t)pSparseMemoryRequirementCount; |
| 17471 | countingStream->putBe64(cgen_var_1144); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17472 | if (pSparseMemoryRequirementCount) |
| 17473 | { |
| 17474 | countingStream->write((uint32_t*)pSparseMemoryRequirementCount, sizeof(uint32_t)); |
| 17475 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17476 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17477 | uint64_t cgen_var_1145 = (uint64_t)(uintptr_t)pSparseMemoryRequirements; |
| 17478 | countingStream->putBe64(cgen_var_1145); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17479 | if (pSparseMemoryRequirements) |
| 17480 | { |
| 17481 | for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i) |
| 17482 | { |
| 17483 | marshal_VkSparseImageMemoryRequirements2(countingStream, (VkSparseImageMemoryRequirements2*)(pSparseMemoryRequirements + i)); |
| 17484 | } |
| 17485 | } |
| 17486 | } |
| 17487 | uint32_t packetSize_vkGetImageSparseMemoryRequirements2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 17488 | countingStream->rewind(); |
| 17489 | uint32_t opcode_vkGetImageSparseMemoryRequirements2KHR = OP_vkGetImageSparseMemoryRequirements2KHR; |
| 17490 | stream->write(&opcode_vkGetImageSparseMemoryRequirements2KHR, sizeof(uint32_t)); |
| 17491 | stream->write(&packetSize_vkGetImageSparseMemoryRequirements2KHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17492 | uint64_t cgen_var_1146; |
| 17493 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1146, 1); |
| 17494 | stream->write((uint64_t*)&cgen_var_1146, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17495 | marshal_VkImageSparseMemoryRequirementsInfo2(stream, (VkImageSparseMemoryRequirementsInfo2*)(local_pInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17496 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17497 | uint64_t cgen_var_1147 = (uint64_t)(uintptr_t)pSparseMemoryRequirementCount; |
| 17498 | stream->putBe64(cgen_var_1147); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17499 | if (pSparseMemoryRequirementCount) |
| 17500 | { |
| 17501 | stream->write((uint32_t*)pSparseMemoryRequirementCount, sizeof(uint32_t)); |
| 17502 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17503 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17504 | uint64_t cgen_var_1148 = (uint64_t)(uintptr_t)pSparseMemoryRequirements; |
| 17505 | stream->putBe64(cgen_var_1148); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17506 | if (pSparseMemoryRequirements) |
| 17507 | { |
| 17508 | for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i) |
| 17509 | { |
| 17510 | marshal_VkSparseImageMemoryRequirements2(stream, (VkSparseImageMemoryRequirements2*)(pSparseMemoryRequirements + i)); |
| 17511 | } |
| 17512 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 17513 | AEMU_SCOPED_TRACE("vkGetImageSparseMemoryRequirements2KHR readParams"); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17514 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17515 | uint32_t* check_pSparseMemoryRequirementCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17516 | check_pSparseMemoryRequirementCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17517 | if (pSparseMemoryRequirementCount) |
| 17518 | { |
| 17519 | if (!(check_pSparseMemoryRequirementCount)) |
| 17520 | { |
| 17521 | fprintf(stderr, "fatal: pSparseMemoryRequirementCount inconsistent between guest and host\n"); |
| 17522 | } |
| 17523 | stream->read((uint32_t*)pSparseMemoryRequirementCount, sizeof(uint32_t)); |
| 17524 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17525 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17526 | VkSparseImageMemoryRequirements2* check_pSparseMemoryRequirements; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17527 | check_pSparseMemoryRequirements = (VkSparseImageMemoryRequirements2*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17528 | if (pSparseMemoryRequirements) |
| 17529 | { |
| 17530 | if (!(check_pSparseMemoryRequirements)) |
| 17531 | { |
| 17532 | fprintf(stderr, "fatal: pSparseMemoryRequirements inconsistent between guest and host\n"); |
| 17533 | } |
| 17534 | for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i) |
| 17535 | { |
| 17536 | unmarshal_VkSparseImageMemoryRequirements2(stream, (VkSparseImageMemoryRequirements2*)(pSparseMemoryRequirements + i)); |
| 17537 | } |
| 17538 | } |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 17539 | if (pSparseMemoryRequirements) |
| 17540 | { |
| 17541 | for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i) |
| 17542 | { |
| 17543 | transform_fromhost_VkSparseImageMemoryRequirements2(mImpl->resources(), (VkSparseImageMemoryRequirements2*)(pSparseMemoryRequirements + i)); |
| 17544 | } |
| 17545 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 17546 | AEMU_SCOPED_TRACE("vkGetImageSparseMemoryRequirements2KHR returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17547 | mImpl->log("finish vkGetImageSparseMemoryRequirements2KHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17548 | } |
| 17549 | |
| 17550 | #endif |
| 17551 | #ifdef VK_KHR_image_format_list |
| 17552 | #endif |
| 17553 | #ifdef VK_KHR_sampler_ycbcr_conversion |
| 17554 | VkResult VkEncoder::vkCreateSamplerYcbcrConversionKHR( |
| 17555 | VkDevice device, |
| 17556 | const VkSamplerYcbcrConversionCreateInfo* pCreateInfo, |
| 17557 | const VkAllocationCallbacks* pAllocator, |
| 17558 | VkSamplerYcbcrConversion* pYcbcrConversion) |
| 17559 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 17560 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 17561 | AEMU_SCOPED_TRACE("vkCreateSamplerYcbcrConversionKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17562 | mImpl->log("start vkCreateSamplerYcbcrConversionKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17563 | auto stream = mImpl->stream(); |
| 17564 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17565 | auto resources = mImpl->resources(); |
| 17566 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 17567 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17568 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17569 | VkSamplerYcbcrConversionCreateInfo* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 17570 | VkAllocationCallbacks* local_pAllocator; |
| 17571 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17572 | local_pCreateInfo = nullptr; |
| 17573 | if (pCreateInfo) |
| 17574 | { |
| 17575 | local_pCreateInfo = (VkSamplerYcbcrConversionCreateInfo*)pool->alloc(sizeof(const VkSamplerYcbcrConversionCreateInfo)); |
| 17576 | deepcopy_VkSamplerYcbcrConversionCreateInfo(pool, pCreateInfo, (VkSamplerYcbcrConversionCreateInfo*)(local_pCreateInfo)); |
| 17577 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17578 | local_pAllocator = nullptr; |
| 17579 | if (pAllocator) |
| 17580 | { |
| 17581 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 17582 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 17583 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 17584 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 17585 | if (local_pCreateInfo) |
| 17586 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 17587 | transform_tohost_VkSamplerYcbcrConversionCreateInfo(mImpl->resources(), (VkSamplerYcbcrConversionCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 17588 | } |
| 17589 | if (local_pAllocator) |
| 17590 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 17591 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 17592 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17593 | countingStream->rewind(); |
| 17594 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17595 | uint64_t cgen_var_1151; |
| 17596 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1151, 1); |
| 17597 | countingStream->write((uint64_t*)&cgen_var_1151, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17598 | marshal_VkSamplerYcbcrConversionCreateInfo(countingStream, (VkSamplerYcbcrConversionCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17599 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17600 | uint64_t cgen_var_1152 = (uint64_t)(uintptr_t)local_pAllocator; |
| 17601 | countingStream->putBe64(cgen_var_1152); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17602 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17603 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17604 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17605 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17606 | uint64_t cgen_var_1153; |
| 17607 | countingStream->handleMapping()->mapHandles_VkSamplerYcbcrConversion_u64(pYcbcrConversion, &cgen_var_1153, 1); |
| 17608 | countingStream->write((uint64_t*)&cgen_var_1153, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17609 | } |
| 17610 | uint32_t packetSize_vkCreateSamplerYcbcrConversionKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 17611 | countingStream->rewind(); |
| 17612 | uint32_t opcode_vkCreateSamplerYcbcrConversionKHR = OP_vkCreateSamplerYcbcrConversionKHR; |
| 17613 | stream->write(&opcode_vkCreateSamplerYcbcrConversionKHR, sizeof(uint32_t)); |
| 17614 | stream->write(&packetSize_vkCreateSamplerYcbcrConversionKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17615 | uint64_t cgen_var_1154; |
| 17616 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1154, 1); |
| 17617 | stream->write((uint64_t*)&cgen_var_1154, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17618 | marshal_VkSamplerYcbcrConversionCreateInfo(stream, (VkSamplerYcbcrConversionCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17619 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17620 | uint64_t cgen_var_1155 = (uint64_t)(uintptr_t)local_pAllocator; |
| 17621 | stream->putBe64(cgen_var_1155); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17622 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17623 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17624 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17625 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 17626 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17627 | uint64_t cgen_var_1156; |
| 17628 | stream->handleMapping()->mapHandles_VkSamplerYcbcrConversion_u64(pYcbcrConversion, &cgen_var_1156, 1); |
| 17629 | stream->write((uint64_t*)&cgen_var_1156, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 17630 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 17631 | AEMU_SCOPED_TRACE("vkCreateSamplerYcbcrConversionKHR readParams"); |
| Lingfeng Yang | 1dafbc3 | 2019-02-23 10:52:04 -0800 | [diff] [blame] | 17632 | stream->setHandleMapping(resources->createMapping()); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17633 | uint64_t cgen_var_1157; |
| 17634 | stream->read((uint64_t*)&cgen_var_1157, 8); |
| 17635 | stream->handleMapping()->mapHandles_u64_VkSamplerYcbcrConversion(&cgen_var_1157, (VkSamplerYcbcrConversion*)pYcbcrConversion, 1); |
| Lingfeng Yang | 1dafbc3 | 2019-02-23 10:52:04 -0800 | [diff] [blame] | 17636 | stream->unsetHandleMapping(); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 17637 | AEMU_SCOPED_TRACE("vkCreateSamplerYcbcrConversionKHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17638 | VkResult vkCreateSamplerYcbcrConversionKHR_VkResult_return = (VkResult)0; |
| 17639 | stream->read(&vkCreateSamplerYcbcrConversionKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17640 | countingStream->clearPool(); |
| 17641 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 17642 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17643 | mImpl->log("finish vkCreateSamplerYcbcrConversionKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17644 | return vkCreateSamplerYcbcrConversionKHR_VkResult_return; |
| 17645 | } |
| 17646 | |
| 17647 | void VkEncoder::vkDestroySamplerYcbcrConversionKHR( |
| 17648 | VkDevice device, |
| 17649 | VkSamplerYcbcrConversion ycbcrConversion, |
| 17650 | const VkAllocationCallbacks* pAllocator) |
| 17651 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 17652 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 17653 | AEMU_SCOPED_TRACE("vkDestroySamplerYcbcrConversionKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17654 | mImpl->log("start vkDestroySamplerYcbcrConversionKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17655 | auto stream = mImpl->stream(); |
| 17656 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17657 | auto resources = mImpl->resources(); |
| 17658 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 17659 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17660 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17661 | VkSamplerYcbcrConversion local_ycbcrConversion; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17662 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 17663 | local_device = device; |
| 17664 | local_ycbcrConversion = ycbcrConversion; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17665 | local_pAllocator = nullptr; |
| 17666 | if (pAllocator) |
| 17667 | { |
| 17668 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 17669 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 17670 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 17671 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 17672 | if (local_pAllocator) |
| 17673 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 17674 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 17675 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17676 | countingStream->rewind(); |
| 17677 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17678 | uint64_t cgen_var_1158; |
| 17679 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1158, 1); |
| 17680 | countingStream->write((uint64_t*)&cgen_var_1158, 1 * 8); |
| 17681 | uint64_t cgen_var_1159; |
| 17682 | countingStream->handleMapping()->mapHandles_VkSamplerYcbcrConversion_u64(&local_ycbcrConversion, &cgen_var_1159, 1); |
| 17683 | countingStream->write((uint64_t*)&cgen_var_1159, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17684 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17685 | uint64_t cgen_var_1160 = (uint64_t)(uintptr_t)local_pAllocator; |
| 17686 | countingStream->putBe64(cgen_var_1160); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17687 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17688 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17689 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17690 | } |
| 17691 | } |
| 17692 | uint32_t packetSize_vkDestroySamplerYcbcrConversionKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 17693 | countingStream->rewind(); |
| 17694 | uint32_t opcode_vkDestroySamplerYcbcrConversionKHR = OP_vkDestroySamplerYcbcrConversionKHR; |
| 17695 | stream->write(&opcode_vkDestroySamplerYcbcrConversionKHR, sizeof(uint32_t)); |
| 17696 | stream->write(&packetSize_vkDestroySamplerYcbcrConversionKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17697 | uint64_t cgen_var_1161; |
| 17698 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1161, 1); |
| 17699 | stream->write((uint64_t*)&cgen_var_1161, 1 * 8); |
| 17700 | uint64_t cgen_var_1162; |
| 17701 | stream->handleMapping()->mapHandles_VkSamplerYcbcrConversion_u64(&local_ycbcrConversion, &cgen_var_1162, 1); |
| 17702 | stream->write((uint64_t*)&cgen_var_1162, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17703 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17704 | uint64_t cgen_var_1163 = (uint64_t)(uintptr_t)local_pAllocator; |
| 17705 | stream->putBe64(cgen_var_1163); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17706 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17707 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17708 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17709 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 17710 | AEMU_SCOPED_TRACE("vkDestroySamplerYcbcrConversionKHR readParams"); |
| 17711 | AEMU_SCOPED_TRACE("vkDestroySamplerYcbcrConversionKHR returnUnmarshal"); |
| Lingfeng Yang | 1dafbc3 | 2019-02-23 10:52:04 -0800 | [diff] [blame] | 17712 | resources->destroyMapping()->mapHandles_VkSamplerYcbcrConversion((VkSamplerYcbcrConversion*)&ycbcrConversion); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17713 | mImpl->log("finish vkDestroySamplerYcbcrConversionKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17714 | } |
| 17715 | |
| 17716 | #endif |
| 17717 | #ifdef VK_KHR_bind_memory2 |
| 17718 | VkResult VkEncoder::vkBindBufferMemory2KHR( |
| 17719 | VkDevice device, |
| 17720 | uint32_t bindInfoCount, |
| 17721 | const VkBindBufferMemoryInfo* pBindInfos) |
| 17722 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 17723 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 17724 | AEMU_SCOPED_TRACE("vkBindBufferMemory2KHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17725 | mImpl->log("start vkBindBufferMemory2KHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17726 | auto stream = mImpl->stream(); |
| 17727 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17728 | auto resources = mImpl->resources(); |
| 17729 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 17730 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17731 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17732 | uint32_t local_bindInfoCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17733 | VkBindBufferMemoryInfo* local_pBindInfos; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 17734 | local_device = device; |
| 17735 | local_bindInfoCount = bindInfoCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17736 | local_pBindInfos = nullptr; |
| 17737 | if (pBindInfos) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17738 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17739 | local_pBindInfos = (VkBindBufferMemoryInfo*)pool->alloc(((bindInfoCount)) * sizeof(const VkBindBufferMemoryInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17740 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 17741 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17742 | deepcopy_VkBindBufferMemoryInfo(pool, pBindInfos + i, (VkBindBufferMemoryInfo*)(local_pBindInfos + i)); |
| 17743 | } |
| 17744 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 17745 | if (local_pBindInfos) |
| 17746 | { |
| 17747 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 17748 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 17749 | transform_tohost_VkBindBufferMemoryInfo(mImpl->resources(), (VkBindBufferMemoryInfo*)(local_pBindInfos + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 17750 | } |
| 17751 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17752 | countingStream->rewind(); |
| 17753 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17754 | uint64_t cgen_var_1164; |
| 17755 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1164, 1); |
| 17756 | countingStream->write((uint64_t*)&cgen_var_1164, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17757 | countingStream->write((uint32_t*)&local_bindInfoCount, sizeof(uint32_t)); |
| 17758 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 17759 | { |
| 17760 | marshal_VkBindBufferMemoryInfo(countingStream, (VkBindBufferMemoryInfo*)(local_pBindInfos + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17761 | } |
| 17762 | } |
| 17763 | uint32_t packetSize_vkBindBufferMemory2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 17764 | countingStream->rewind(); |
| 17765 | uint32_t opcode_vkBindBufferMemory2KHR = OP_vkBindBufferMemory2KHR; |
| 17766 | stream->write(&opcode_vkBindBufferMemory2KHR, sizeof(uint32_t)); |
| 17767 | stream->write(&packetSize_vkBindBufferMemory2KHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17768 | uint64_t cgen_var_1165; |
| 17769 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1165, 1); |
| 17770 | stream->write((uint64_t*)&cgen_var_1165, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17771 | stream->write((uint32_t*)&local_bindInfoCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17772 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 17773 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17774 | marshal_VkBindBufferMemoryInfo(stream, (VkBindBufferMemoryInfo*)(local_pBindInfos + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17775 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 17776 | AEMU_SCOPED_TRACE("vkBindBufferMemory2KHR readParams"); |
| 17777 | AEMU_SCOPED_TRACE("vkBindBufferMemory2KHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17778 | VkResult vkBindBufferMemory2KHR_VkResult_return = (VkResult)0; |
| 17779 | stream->read(&vkBindBufferMemory2KHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17780 | countingStream->clearPool(); |
| 17781 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 17782 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17783 | mImpl->log("finish vkBindBufferMemory2KHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17784 | return vkBindBufferMemory2KHR_VkResult_return; |
| 17785 | } |
| 17786 | |
| 17787 | VkResult VkEncoder::vkBindImageMemory2KHR( |
| 17788 | VkDevice device, |
| 17789 | uint32_t bindInfoCount, |
| 17790 | const VkBindImageMemoryInfo* pBindInfos) |
| 17791 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 17792 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 17793 | AEMU_SCOPED_TRACE("vkBindImageMemory2KHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17794 | mImpl->log("start vkBindImageMemory2KHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17795 | auto stream = mImpl->stream(); |
| 17796 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17797 | auto resources = mImpl->resources(); |
| 17798 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 17799 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17800 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17801 | uint32_t local_bindInfoCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17802 | VkBindImageMemoryInfo* local_pBindInfos; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 17803 | local_device = device; |
| 17804 | local_bindInfoCount = bindInfoCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17805 | local_pBindInfos = nullptr; |
| 17806 | if (pBindInfos) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17807 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17808 | local_pBindInfos = (VkBindImageMemoryInfo*)pool->alloc(((bindInfoCount)) * sizeof(const VkBindImageMemoryInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17809 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 17810 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17811 | deepcopy_VkBindImageMemoryInfo(pool, pBindInfos + i, (VkBindImageMemoryInfo*)(local_pBindInfos + i)); |
| 17812 | } |
| 17813 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 17814 | if (local_pBindInfos) |
| 17815 | { |
| 17816 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 17817 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 17818 | transform_tohost_VkBindImageMemoryInfo(mImpl->resources(), (VkBindImageMemoryInfo*)(local_pBindInfos + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 17819 | } |
| 17820 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17821 | countingStream->rewind(); |
| 17822 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17823 | uint64_t cgen_var_1166; |
| 17824 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1166, 1); |
| 17825 | countingStream->write((uint64_t*)&cgen_var_1166, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17826 | countingStream->write((uint32_t*)&local_bindInfoCount, sizeof(uint32_t)); |
| 17827 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 17828 | { |
| 17829 | marshal_VkBindImageMemoryInfo(countingStream, (VkBindImageMemoryInfo*)(local_pBindInfos + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17830 | } |
| 17831 | } |
| 17832 | uint32_t packetSize_vkBindImageMemory2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 17833 | countingStream->rewind(); |
| 17834 | uint32_t opcode_vkBindImageMemory2KHR = OP_vkBindImageMemory2KHR; |
| 17835 | stream->write(&opcode_vkBindImageMemory2KHR, sizeof(uint32_t)); |
| 17836 | stream->write(&packetSize_vkBindImageMemory2KHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17837 | uint64_t cgen_var_1167; |
| 17838 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1167, 1); |
| 17839 | stream->write((uint64_t*)&cgen_var_1167, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17840 | stream->write((uint32_t*)&local_bindInfoCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17841 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 17842 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17843 | marshal_VkBindImageMemoryInfo(stream, (VkBindImageMemoryInfo*)(local_pBindInfos + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17844 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 17845 | AEMU_SCOPED_TRACE("vkBindImageMemory2KHR readParams"); |
| 17846 | AEMU_SCOPED_TRACE("vkBindImageMemory2KHR returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17847 | VkResult vkBindImageMemory2KHR_VkResult_return = (VkResult)0; |
| 17848 | stream->read(&vkBindImageMemory2KHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17849 | countingStream->clearPool(); |
| 17850 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 17851 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17852 | mImpl->log("finish vkBindImageMemory2KHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17853 | return vkBindImageMemory2KHR_VkResult_return; |
| 17854 | } |
| 17855 | |
| 17856 | #endif |
| 17857 | #ifdef VK_KHR_maintenance3 |
| 17858 | void VkEncoder::vkGetDescriptorSetLayoutSupportKHR( |
| 17859 | VkDevice device, |
| 17860 | const VkDescriptorSetLayoutCreateInfo* pCreateInfo, |
| 17861 | VkDescriptorSetLayoutSupport* pSupport) |
| 17862 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 17863 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 17864 | AEMU_SCOPED_TRACE("vkGetDescriptorSetLayoutSupportKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17865 | mImpl->log("start vkGetDescriptorSetLayoutSupportKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17866 | auto stream = mImpl->stream(); |
| 17867 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17868 | auto resources = mImpl->resources(); |
| 17869 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 17870 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17871 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17872 | VkDescriptorSetLayoutCreateInfo* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 17873 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17874 | local_pCreateInfo = nullptr; |
| 17875 | if (pCreateInfo) |
| 17876 | { |
| 17877 | local_pCreateInfo = (VkDescriptorSetLayoutCreateInfo*)pool->alloc(sizeof(const VkDescriptorSetLayoutCreateInfo)); |
| 17878 | deepcopy_VkDescriptorSetLayoutCreateInfo(pool, pCreateInfo, (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo)); |
| 17879 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 17880 | if (local_pCreateInfo) |
| 17881 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 17882 | transform_tohost_VkDescriptorSetLayoutCreateInfo(mImpl->resources(), (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 17883 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17884 | countingStream->rewind(); |
| 17885 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17886 | uint64_t cgen_var_1168; |
| 17887 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1168, 1); |
| 17888 | countingStream->write((uint64_t*)&cgen_var_1168, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17889 | marshal_VkDescriptorSetLayoutCreateInfo(countingStream, (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17890 | marshal_VkDescriptorSetLayoutSupport(countingStream, (VkDescriptorSetLayoutSupport*)(pSupport)); |
| 17891 | } |
| 17892 | uint32_t packetSize_vkGetDescriptorSetLayoutSupportKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 17893 | countingStream->rewind(); |
| 17894 | uint32_t opcode_vkGetDescriptorSetLayoutSupportKHR = OP_vkGetDescriptorSetLayoutSupportKHR; |
| 17895 | stream->write(&opcode_vkGetDescriptorSetLayoutSupportKHR, sizeof(uint32_t)); |
| 17896 | stream->write(&packetSize_vkGetDescriptorSetLayoutSupportKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17897 | uint64_t cgen_var_1169; |
| 17898 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1169, 1); |
| 17899 | stream->write((uint64_t*)&cgen_var_1169, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17900 | marshal_VkDescriptorSetLayoutCreateInfo(stream, (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17901 | marshal_VkDescriptorSetLayoutSupport(stream, (VkDescriptorSetLayoutSupport*)(pSupport)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 17902 | AEMU_SCOPED_TRACE("vkGetDescriptorSetLayoutSupportKHR readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17903 | unmarshal_VkDescriptorSetLayoutSupport(stream, (VkDescriptorSetLayoutSupport*)(pSupport)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 17904 | if (pSupport) |
| 17905 | { |
| 17906 | transform_fromhost_VkDescriptorSetLayoutSupport(mImpl->resources(), (VkDescriptorSetLayoutSupport*)(pSupport)); |
| 17907 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 17908 | AEMU_SCOPED_TRACE("vkGetDescriptorSetLayoutSupportKHR returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17909 | mImpl->log("finish vkGetDescriptorSetLayoutSupportKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17910 | } |
| 17911 | |
| 17912 | #endif |
| 17913 | #ifdef VK_KHR_draw_indirect_count |
| 17914 | void VkEncoder::vkCmdDrawIndirectCountKHR( |
| 17915 | VkCommandBuffer commandBuffer, |
| 17916 | VkBuffer buffer, |
| 17917 | VkDeviceSize offset, |
| 17918 | VkBuffer countBuffer, |
| 17919 | VkDeviceSize countBufferOffset, |
| 17920 | uint32_t maxDrawCount, |
| 17921 | uint32_t stride) |
| 17922 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 17923 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 17924 | AEMU_SCOPED_TRACE("vkCmdDrawIndirectCountKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17925 | mImpl->log("start vkCmdDrawIndirectCountKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17926 | auto stream = mImpl->stream(); |
| 17927 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17928 | auto resources = mImpl->resources(); |
| 17929 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 17930 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17931 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17932 | VkBuffer local_buffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17933 | VkDeviceSize local_offset; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17934 | VkBuffer local_countBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17935 | VkDeviceSize local_countBufferOffset; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17936 | uint32_t local_maxDrawCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17937 | uint32_t local_stride; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 17938 | local_commandBuffer = commandBuffer; |
| 17939 | local_buffer = buffer; |
| 17940 | local_offset = offset; |
| 17941 | local_countBuffer = countBuffer; |
| 17942 | local_countBufferOffset = countBufferOffset; |
| 17943 | local_maxDrawCount = maxDrawCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17944 | local_stride = stride; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17945 | countingStream->rewind(); |
| 17946 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17947 | uint64_t cgen_var_1170; |
| 17948 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1170, 1); |
| 17949 | countingStream->write((uint64_t*)&cgen_var_1170, 1 * 8); |
| 17950 | uint64_t cgen_var_1171; |
| 17951 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_1171, 1); |
| 17952 | countingStream->write((uint64_t*)&cgen_var_1171, 1 * 8); |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 17953 | countingStream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17954 | uint64_t cgen_var_1172; |
| 17955 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_countBuffer, &cgen_var_1172, 1); |
| 17956 | countingStream->write((uint64_t*)&cgen_var_1172, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17957 | countingStream->write((VkDeviceSize*)&local_countBufferOffset, sizeof(VkDeviceSize)); |
| 17958 | countingStream->write((uint32_t*)&local_maxDrawCount, sizeof(uint32_t)); |
| 17959 | countingStream->write((uint32_t*)&local_stride, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17960 | } |
| 17961 | uint32_t packetSize_vkCmdDrawIndirectCountKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 17962 | countingStream->rewind(); |
| 17963 | uint32_t opcode_vkCmdDrawIndirectCountKHR = OP_vkCmdDrawIndirectCountKHR; |
| 17964 | stream->write(&opcode_vkCmdDrawIndirectCountKHR, sizeof(uint32_t)); |
| 17965 | stream->write(&packetSize_vkCmdDrawIndirectCountKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17966 | uint64_t cgen_var_1173; |
| 17967 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1173, 1); |
| 17968 | stream->write((uint64_t*)&cgen_var_1173, 1 * 8); |
| 17969 | uint64_t cgen_var_1174; |
| 17970 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_1174, 1); |
| 17971 | stream->write((uint64_t*)&cgen_var_1174, 1 * 8); |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 17972 | stream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17973 | uint64_t cgen_var_1175; |
| 17974 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_countBuffer, &cgen_var_1175, 1); |
| 17975 | stream->write((uint64_t*)&cgen_var_1175, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17976 | stream->write((VkDeviceSize*)&local_countBufferOffset, sizeof(VkDeviceSize)); |
| 17977 | stream->write((uint32_t*)&local_maxDrawCount, sizeof(uint32_t)); |
| 17978 | stream->write((uint32_t*)&local_stride, sizeof(uint32_t)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 17979 | AEMU_SCOPED_TRACE("vkCmdDrawIndirectCountKHR readParams"); |
| 17980 | AEMU_SCOPED_TRACE("vkCmdDrawIndirectCountKHR returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17981 | mImpl->log("finish vkCmdDrawIndirectCountKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17982 | } |
| 17983 | |
| 17984 | void VkEncoder::vkCmdDrawIndexedIndirectCountKHR( |
| 17985 | VkCommandBuffer commandBuffer, |
| 17986 | VkBuffer buffer, |
| 17987 | VkDeviceSize offset, |
| 17988 | VkBuffer countBuffer, |
| 17989 | VkDeviceSize countBufferOffset, |
| 17990 | uint32_t maxDrawCount, |
| 17991 | uint32_t stride) |
| 17992 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 17993 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 17994 | AEMU_SCOPED_TRACE("vkCmdDrawIndexedIndirectCountKHR encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17995 | mImpl->log("start vkCmdDrawIndexedIndirectCountKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17996 | auto stream = mImpl->stream(); |
| 17997 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17998 | auto resources = mImpl->resources(); |
| 17999 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 18000 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18001 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18002 | VkBuffer local_buffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18003 | VkDeviceSize local_offset; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18004 | VkBuffer local_countBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18005 | VkDeviceSize local_countBufferOffset; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18006 | uint32_t local_maxDrawCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18007 | uint32_t local_stride; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 18008 | local_commandBuffer = commandBuffer; |
| 18009 | local_buffer = buffer; |
| 18010 | local_offset = offset; |
| 18011 | local_countBuffer = countBuffer; |
| 18012 | local_countBufferOffset = countBufferOffset; |
| 18013 | local_maxDrawCount = maxDrawCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18014 | local_stride = stride; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18015 | countingStream->rewind(); |
| 18016 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18017 | uint64_t cgen_var_1176; |
| 18018 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1176, 1); |
| 18019 | countingStream->write((uint64_t*)&cgen_var_1176, 1 * 8); |
| 18020 | uint64_t cgen_var_1177; |
| 18021 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_1177, 1); |
| 18022 | countingStream->write((uint64_t*)&cgen_var_1177, 1 * 8); |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 18023 | countingStream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18024 | uint64_t cgen_var_1178; |
| 18025 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_countBuffer, &cgen_var_1178, 1); |
| 18026 | countingStream->write((uint64_t*)&cgen_var_1178, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18027 | countingStream->write((VkDeviceSize*)&local_countBufferOffset, sizeof(VkDeviceSize)); |
| 18028 | countingStream->write((uint32_t*)&local_maxDrawCount, sizeof(uint32_t)); |
| 18029 | countingStream->write((uint32_t*)&local_stride, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18030 | } |
| 18031 | uint32_t packetSize_vkCmdDrawIndexedIndirectCountKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 18032 | countingStream->rewind(); |
| 18033 | uint32_t opcode_vkCmdDrawIndexedIndirectCountKHR = OP_vkCmdDrawIndexedIndirectCountKHR; |
| 18034 | stream->write(&opcode_vkCmdDrawIndexedIndirectCountKHR, sizeof(uint32_t)); |
| 18035 | stream->write(&packetSize_vkCmdDrawIndexedIndirectCountKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18036 | uint64_t cgen_var_1179; |
| 18037 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1179, 1); |
| 18038 | stream->write((uint64_t*)&cgen_var_1179, 1 * 8); |
| 18039 | uint64_t cgen_var_1180; |
| 18040 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_1180, 1); |
| 18041 | stream->write((uint64_t*)&cgen_var_1180, 1 * 8); |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 18042 | stream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18043 | uint64_t cgen_var_1181; |
| 18044 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_countBuffer, &cgen_var_1181, 1); |
| 18045 | stream->write((uint64_t*)&cgen_var_1181, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18046 | stream->write((VkDeviceSize*)&local_countBufferOffset, sizeof(VkDeviceSize)); |
| 18047 | stream->write((uint32_t*)&local_maxDrawCount, sizeof(uint32_t)); |
| 18048 | stream->write((uint32_t*)&local_stride, sizeof(uint32_t)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 18049 | AEMU_SCOPED_TRACE("vkCmdDrawIndexedIndirectCountKHR readParams"); |
| 18050 | AEMU_SCOPED_TRACE("vkCmdDrawIndexedIndirectCountKHR returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18051 | mImpl->log("finish vkCmdDrawIndexedIndirectCountKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18052 | } |
| 18053 | |
| 18054 | #endif |
| 18055 | #ifdef VK_KHR_8bit_storage |
| 18056 | #endif |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 18057 | #ifdef VK_ANDROID_native_buffer |
| 18058 | VkResult VkEncoder::vkGetSwapchainGrallocUsageANDROID( |
| 18059 | VkDevice device, |
| 18060 | VkFormat format, |
| 18061 | VkImageUsageFlags imageUsage, |
| 18062 | int* grallocUsage) |
| 18063 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 18064 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 18065 | AEMU_SCOPED_TRACE("vkGetSwapchainGrallocUsageANDROID encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18066 | mImpl->log("start vkGetSwapchainGrallocUsageANDROID"); |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 18067 | auto stream = mImpl->stream(); |
| 18068 | auto countingStream = mImpl->countingStream(); |
| 18069 | auto resources = mImpl->resources(); |
| 18070 | auto pool = mImpl->pool(); |
| 18071 | stream->setHandleMapping(resources->unwrapMapping()); |
| 18072 | VkDevice local_device; |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 18073 | VkFormat local_format; |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 18074 | VkImageUsageFlags local_imageUsage; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 18075 | local_device = device; |
| 18076 | local_format = format; |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 18077 | local_imageUsage = imageUsage; |
| 18078 | countingStream->rewind(); |
| 18079 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18080 | uint64_t cgen_var_1182; |
| 18081 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1182, 1); |
| 18082 | countingStream->write((uint64_t*)&cgen_var_1182, 1 * 8); |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 18083 | countingStream->write((VkFormat*)&local_format, sizeof(VkFormat)); |
| 18084 | countingStream->write((VkImageUsageFlags*)&local_imageUsage, sizeof(VkImageUsageFlags)); |
| 18085 | countingStream->write((int*)grallocUsage, sizeof(int)); |
| 18086 | } |
| 18087 | uint32_t packetSize_vkGetSwapchainGrallocUsageANDROID = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 18088 | countingStream->rewind(); |
| 18089 | uint32_t opcode_vkGetSwapchainGrallocUsageANDROID = OP_vkGetSwapchainGrallocUsageANDROID; |
| 18090 | stream->write(&opcode_vkGetSwapchainGrallocUsageANDROID, sizeof(uint32_t)); |
| 18091 | stream->write(&packetSize_vkGetSwapchainGrallocUsageANDROID, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18092 | uint64_t cgen_var_1183; |
| 18093 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1183, 1); |
| 18094 | stream->write((uint64_t*)&cgen_var_1183, 1 * 8); |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 18095 | stream->write((VkFormat*)&local_format, sizeof(VkFormat)); |
| 18096 | stream->write((VkImageUsageFlags*)&local_imageUsage, sizeof(VkImageUsageFlags)); |
| 18097 | stream->write((int*)grallocUsage, sizeof(int)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 18098 | AEMU_SCOPED_TRACE("vkGetSwapchainGrallocUsageANDROID readParams"); |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 18099 | stream->read((int*)grallocUsage, sizeof(int)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 18100 | AEMU_SCOPED_TRACE("vkGetSwapchainGrallocUsageANDROID returnUnmarshal"); |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 18101 | VkResult vkGetSwapchainGrallocUsageANDROID_VkResult_return = (VkResult)0; |
| 18102 | stream->read(&vkGetSwapchainGrallocUsageANDROID_VkResult_return, sizeof(VkResult)); |
| 18103 | countingStream->clearPool(); |
| 18104 | stream->clearPool(); |
| 18105 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18106 | mImpl->log("finish vkGetSwapchainGrallocUsageANDROID");; |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 18107 | return vkGetSwapchainGrallocUsageANDROID_VkResult_return; |
| 18108 | } |
| 18109 | |
| 18110 | VkResult VkEncoder::vkAcquireImageANDROID( |
| 18111 | VkDevice device, |
| 18112 | VkImage image, |
| 18113 | int nativeFenceFd, |
| 18114 | VkSemaphore semaphore, |
| 18115 | VkFence fence) |
| 18116 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 18117 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 18118 | AEMU_SCOPED_TRACE("vkAcquireImageANDROID encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18119 | mImpl->log("start vkAcquireImageANDROID"); |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 18120 | auto stream = mImpl->stream(); |
| 18121 | auto countingStream = mImpl->countingStream(); |
| 18122 | auto resources = mImpl->resources(); |
| 18123 | auto pool = mImpl->pool(); |
| 18124 | stream->setHandleMapping(resources->unwrapMapping()); |
| 18125 | VkDevice local_device; |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 18126 | VkImage local_image; |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 18127 | int local_nativeFenceFd; |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 18128 | VkSemaphore local_semaphore; |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 18129 | VkFence local_fence; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 18130 | local_device = device; |
| 18131 | local_image = image; |
| 18132 | local_nativeFenceFd = nativeFenceFd; |
| 18133 | local_semaphore = semaphore; |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 18134 | local_fence = fence; |
| Lingfeng Yang | def88ba | 2018-12-13 12:43:17 -0800 | [diff] [blame] | 18135 | mImpl->resources()->unwrap_vkAcquireImageANDROID_nativeFenceFd(nativeFenceFd, &local_nativeFenceFd); |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 18136 | countingStream->rewind(); |
| 18137 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18138 | uint64_t cgen_var_1184; |
| 18139 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1184, 1); |
| 18140 | countingStream->write((uint64_t*)&cgen_var_1184, 1 * 8); |
| 18141 | uint64_t cgen_var_1185; |
| 18142 | countingStream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_1185, 1); |
| 18143 | countingStream->write((uint64_t*)&cgen_var_1185, 1 * 8); |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 18144 | countingStream->write((int*)&local_nativeFenceFd, sizeof(int)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18145 | uint64_t cgen_var_1186; |
| 18146 | countingStream->handleMapping()->mapHandles_VkSemaphore_u64(&local_semaphore, &cgen_var_1186, 1); |
| 18147 | countingStream->write((uint64_t*)&cgen_var_1186, 1 * 8); |
| 18148 | uint64_t cgen_var_1187; |
| 18149 | countingStream->handleMapping()->mapHandles_VkFence_u64(&local_fence, &cgen_var_1187, 1); |
| 18150 | countingStream->write((uint64_t*)&cgen_var_1187, 1 * 8); |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 18151 | } |
| 18152 | uint32_t packetSize_vkAcquireImageANDROID = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 18153 | countingStream->rewind(); |
| 18154 | uint32_t opcode_vkAcquireImageANDROID = OP_vkAcquireImageANDROID; |
| 18155 | stream->write(&opcode_vkAcquireImageANDROID, sizeof(uint32_t)); |
| 18156 | stream->write(&packetSize_vkAcquireImageANDROID, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18157 | uint64_t cgen_var_1188; |
| 18158 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1188, 1); |
| 18159 | stream->write((uint64_t*)&cgen_var_1188, 1 * 8); |
| 18160 | uint64_t cgen_var_1189; |
| 18161 | stream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_1189, 1); |
| 18162 | stream->write((uint64_t*)&cgen_var_1189, 1 * 8); |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 18163 | stream->write((int*)&local_nativeFenceFd, sizeof(int)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18164 | uint64_t cgen_var_1190; |
| 18165 | stream->handleMapping()->mapHandles_VkSemaphore_u64(&local_semaphore, &cgen_var_1190, 1); |
| 18166 | stream->write((uint64_t*)&cgen_var_1190, 1 * 8); |
| 18167 | uint64_t cgen_var_1191; |
| 18168 | stream->handleMapping()->mapHandles_VkFence_u64(&local_fence, &cgen_var_1191, 1); |
| 18169 | stream->write((uint64_t*)&cgen_var_1191, 1 * 8); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 18170 | AEMU_SCOPED_TRACE("vkAcquireImageANDROID readParams"); |
| 18171 | AEMU_SCOPED_TRACE("vkAcquireImageANDROID returnUnmarshal"); |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 18172 | VkResult vkAcquireImageANDROID_VkResult_return = (VkResult)0; |
| 18173 | stream->read(&vkAcquireImageANDROID_VkResult_return, sizeof(VkResult)); |
| 18174 | countingStream->clearPool(); |
| 18175 | stream->clearPool(); |
| 18176 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18177 | mImpl->log("finish vkAcquireImageANDROID");; |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 18178 | return vkAcquireImageANDROID_VkResult_return; |
| 18179 | } |
| 18180 | |
| 18181 | VkResult VkEncoder::vkQueueSignalReleaseImageANDROID( |
| 18182 | VkQueue queue, |
| 18183 | uint32_t waitSemaphoreCount, |
| 18184 | const VkSemaphore* pWaitSemaphores, |
| 18185 | VkImage image, |
| 18186 | int* pNativeFenceFd) |
| 18187 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 18188 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 18189 | AEMU_SCOPED_TRACE("vkQueueSignalReleaseImageANDROID encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18190 | mImpl->log("start vkQueueSignalReleaseImageANDROID"); |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 18191 | auto stream = mImpl->stream(); |
| 18192 | auto countingStream = mImpl->countingStream(); |
| 18193 | auto resources = mImpl->resources(); |
| 18194 | auto pool = mImpl->pool(); |
| 18195 | stream->setHandleMapping(resources->unwrapMapping()); |
| 18196 | VkQueue local_queue; |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 18197 | uint32_t local_waitSemaphoreCount; |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 18198 | VkSemaphore* local_pWaitSemaphores; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 18199 | VkImage local_image; |
| 18200 | local_queue = queue; |
| 18201 | local_waitSemaphoreCount = waitSemaphoreCount; |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 18202 | local_pWaitSemaphores = nullptr; |
| 18203 | if (pWaitSemaphores) |
| 18204 | { |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame] | 18205 | local_pWaitSemaphores = (VkSemaphore*)pool->dupArray(pWaitSemaphores, ((waitSemaphoreCount)) * sizeof(const VkSemaphore)); |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 18206 | } |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 18207 | local_image = image; |
| 18208 | countingStream->rewind(); |
| 18209 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18210 | uint64_t cgen_var_1192; |
| 18211 | countingStream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_1192, 1); |
| 18212 | countingStream->write((uint64_t*)&cgen_var_1192, 1 * 8); |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 18213 | countingStream->write((uint32_t*)&local_waitSemaphoreCount, sizeof(uint32_t)); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame] | 18214 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18215 | uint64_t cgen_var_1193 = (uint64_t)(uintptr_t)local_pWaitSemaphores; |
| 18216 | countingStream->putBe64(cgen_var_1193); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame] | 18217 | if (local_pWaitSemaphores) |
| 18218 | { |
| 18219 | if (((waitSemaphoreCount))) |
| 18220 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18221 | uint64_t* cgen_var_1194; |
| 18222 | countingStream->alloc((void**)&cgen_var_1194, ((waitSemaphoreCount)) * 8); |
| 18223 | countingStream->handleMapping()->mapHandles_VkSemaphore_u64(local_pWaitSemaphores, cgen_var_1194, ((waitSemaphoreCount))); |
| 18224 | countingStream->write((uint64_t*)cgen_var_1194, ((waitSemaphoreCount)) * 8); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame] | 18225 | } |
| 18226 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18227 | uint64_t cgen_var_1195; |
| 18228 | countingStream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_1195, 1); |
| 18229 | countingStream->write((uint64_t*)&cgen_var_1195, 1 * 8); |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 18230 | countingStream->write((int*)pNativeFenceFd, sizeof(int)); |
| 18231 | } |
| 18232 | uint32_t packetSize_vkQueueSignalReleaseImageANDROID = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 18233 | countingStream->rewind(); |
| 18234 | uint32_t opcode_vkQueueSignalReleaseImageANDROID = OP_vkQueueSignalReleaseImageANDROID; |
| 18235 | stream->write(&opcode_vkQueueSignalReleaseImageANDROID, sizeof(uint32_t)); |
| 18236 | stream->write(&packetSize_vkQueueSignalReleaseImageANDROID, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18237 | uint64_t cgen_var_1196; |
| 18238 | stream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_1196, 1); |
| 18239 | stream->write((uint64_t*)&cgen_var_1196, 1 * 8); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame] | 18240 | stream->write((uint32_t*)&local_waitSemaphoreCount, sizeof(uint32_t)); |
| 18241 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18242 | uint64_t cgen_var_1197 = (uint64_t)(uintptr_t)local_pWaitSemaphores; |
| 18243 | stream->putBe64(cgen_var_1197); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame] | 18244 | if (local_pWaitSemaphores) |
| 18245 | { |
| 18246 | if (((waitSemaphoreCount))) |
| 18247 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18248 | uint64_t* cgen_var_1198; |
| 18249 | stream->alloc((void**)&cgen_var_1198, ((waitSemaphoreCount)) * 8); |
| 18250 | stream->handleMapping()->mapHandles_VkSemaphore_u64(local_pWaitSemaphores, cgen_var_1198, ((waitSemaphoreCount))); |
| 18251 | stream->write((uint64_t*)cgen_var_1198, ((waitSemaphoreCount)) * 8); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame] | 18252 | } |
| 18253 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18254 | uint64_t cgen_var_1199; |
| 18255 | stream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_1199, 1); |
| 18256 | stream->write((uint64_t*)&cgen_var_1199, 1 * 8); |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 18257 | stream->write((int*)pNativeFenceFd, sizeof(int)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 18258 | AEMU_SCOPED_TRACE("vkQueueSignalReleaseImageANDROID readParams"); |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 18259 | stream->read((int*)pNativeFenceFd, sizeof(int)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 18260 | AEMU_SCOPED_TRACE("vkQueueSignalReleaseImageANDROID returnUnmarshal"); |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 18261 | VkResult vkQueueSignalReleaseImageANDROID_VkResult_return = (VkResult)0; |
| 18262 | stream->read(&vkQueueSignalReleaseImageANDROID_VkResult_return, sizeof(VkResult)); |
| 18263 | countingStream->clearPool(); |
| 18264 | stream->clearPool(); |
| 18265 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18266 | mImpl->log("finish vkQueueSignalReleaseImageANDROID");; |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 18267 | return vkQueueSignalReleaseImageANDROID_VkResult_return; |
| 18268 | } |
| 18269 | |
| 18270 | #endif |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18271 | #ifdef VK_EXT_debug_report |
| 18272 | VkResult VkEncoder::vkCreateDebugReportCallbackEXT( |
| 18273 | VkInstance instance, |
| 18274 | const VkDebugReportCallbackCreateInfoEXT* pCreateInfo, |
| 18275 | const VkAllocationCallbacks* pAllocator, |
| 18276 | VkDebugReportCallbackEXT* pCallback) |
| 18277 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 18278 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 18279 | AEMU_SCOPED_TRACE("vkCreateDebugReportCallbackEXT encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18280 | mImpl->log("start vkCreateDebugReportCallbackEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18281 | auto stream = mImpl->stream(); |
| 18282 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18283 | auto resources = mImpl->resources(); |
| 18284 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 18285 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18286 | VkInstance local_instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18287 | VkDebugReportCallbackCreateInfoEXT* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 18288 | VkAllocationCallbacks* local_pAllocator; |
| 18289 | local_instance = instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18290 | local_pCreateInfo = nullptr; |
| 18291 | if (pCreateInfo) |
| 18292 | { |
| 18293 | local_pCreateInfo = (VkDebugReportCallbackCreateInfoEXT*)pool->alloc(sizeof(const VkDebugReportCallbackCreateInfoEXT)); |
| 18294 | deepcopy_VkDebugReportCallbackCreateInfoEXT(pool, pCreateInfo, (VkDebugReportCallbackCreateInfoEXT*)(local_pCreateInfo)); |
| 18295 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18296 | local_pAllocator = nullptr; |
| 18297 | if (pAllocator) |
| 18298 | { |
| 18299 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 18300 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 18301 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 18302 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 18303 | if (local_pCreateInfo) |
| 18304 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 18305 | transform_tohost_VkDebugReportCallbackCreateInfoEXT(mImpl->resources(), (VkDebugReportCallbackCreateInfoEXT*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 18306 | } |
| 18307 | if (local_pAllocator) |
| 18308 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 18309 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 18310 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18311 | countingStream->rewind(); |
| 18312 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18313 | uint64_t cgen_var_1200; |
| 18314 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1200, 1); |
| 18315 | countingStream->write((uint64_t*)&cgen_var_1200, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18316 | marshal_VkDebugReportCallbackCreateInfoEXT(countingStream, (VkDebugReportCallbackCreateInfoEXT*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 18317 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18318 | uint64_t cgen_var_1201 = (uint64_t)(uintptr_t)local_pAllocator; |
| 18319 | countingStream->putBe64(cgen_var_1201); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18320 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18321 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18322 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18323 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18324 | uint64_t cgen_var_1202; |
| 18325 | countingStream->handleMapping()->mapHandles_VkDebugReportCallbackEXT_u64(pCallback, &cgen_var_1202, 1); |
| 18326 | countingStream->write((uint64_t*)&cgen_var_1202, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18327 | } |
| 18328 | uint32_t packetSize_vkCreateDebugReportCallbackEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 18329 | countingStream->rewind(); |
| 18330 | uint32_t opcode_vkCreateDebugReportCallbackEXT = OP_vkCreateDebugReportCallbackEXT; |
| 18331 | stream->write(&opcode_vkCreateDebugReportCallbackEXT, sizeof(uint32_t)); |
| 18332 | stream->write(&packetSize_vkCreateDebugReportCallbackEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18333 | uint64_t cgen_var_1203; |
| 18334 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1203, 1); |
| 18335 | stream->write((uint64_t*)&cgen_var_1203, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18336 | marshal_VkDebugReportCallbackCreateInfoEXT(stream, (VkDebugReportCallbackCreateInfoEXT*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 18337 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18338 | uint64_t cgen_var_1204 = (uint64_t)(uintptr_t)local_pAllocator; |
| 18339 | stream->putBe64(cgen_var_1204); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18340 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18341 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18342 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18343 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 18344 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18345 | uint64_t cgen_var_1205; |
| 18346 | stream->handleMapping()->mapHandles_VkDebugReportCallbackEXT_u64(pCallback, &cgen_var_1205, 1); |
| 18347 | stream->write((uint64_t*)&cgen_var_1205, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 18348 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 18349 | AEMU_SCOPED_TRACE("vkCreateDebugReportCallbackEXT readParams"); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 18350 | stream->setHandleMapping(resources->createMapping()); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18351 | uint64_t cgen_var_1206; |
| 18352 | stream->read((uint64_t*)&cgen_var_1206, 8); |
| 18353 | stream->handleMapping()->mapHandles_u64_VkDebugReportCallbackEXT(&cgen_var_1206, (VkDebugReportCallbackEXT*)pCallback, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 18354 | stream->unsetHandleMapping(); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 18355 | AEMU_SCOPED_TRACE("vkCreateDebugReportCallbackEXT returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18356 | VkResult vkCreateDebugReportCallbackEXT_VkResult_return = (VkResult)0; |
| 18357 | stream->read(&vkCreateDebugReportCallbackEXT_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 18358 | countingStream->clearPool(); |
| 18359 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 18360 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18361 | mImpl->log("finish vkCreateDebugReportCallbackEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18362 | return vkCreateDebugReportCallbackEXT_VkResult_return; |
| 18363 | } |
| 18364 | |
| 18365 | void VkEncoder::vkDestroyDebugReportCallbackEXT( |
| 18366 | VkInstance instance, |
| 18367 | VkDebugReportCallbackEXT callback, |
| 18368 | const VkAllocationCallbacks* pAllocator) |
| 18369 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 18370 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 18371 | AEMU_SCOPED_TRACE("vkDestroyDebugReportCallbackEXT encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18372 | mImpl->log("start vkDestroyDebugReportCallbackEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18373 | auto stream = mImpl->stream(); |
| 18374 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18375 | auto resources = mImpl->resources(); |
| 18376 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 18377 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18378 | VkInstance local_instance; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 18379 | VkDebugReportCallbackEXT local_callback; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18380 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 18381 | local_instance = instance; |
| 18382 | local_callback = callback; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18383 | local_pAllocator = nullptr; |
| 18384 | if (pAllocator) |
| 18385 | { |
| 18386 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 18387 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 18388 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 18389 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 18390 | if (local_pAllocator) |
| 18391 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 18392 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 18393 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18394 | countingStream->rewind(); |
| 18395 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18396 | uint64_t cgen_var_1207; |
| 18397 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1207, 1); |
| 18398 | countingStream->write((uint64_t*)&cgen_var_1207, 1 * 8); |
| 18399 | uint64_t cgen_var_1208; |
| 18400 | countingStream->handleMapping()->mapHandles_VkDebugReportCallbackEXT_u64(&local_callback, &cgen_var_1208, 1); |
| 18401 | countingStream->write((uint64_t*)&cgen_var_1208, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 18402 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18403 | uint64_t cgen_var_1209 = (uint64_t)(uintptr_t)local_pAllocator; |
| 18404 | countingStream->putBe64(cgen_var_1209); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18405 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18406 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18407 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18408 | } |
| 18409 | } |
| 18410 | uint32_t packetSize_vkDestroyDebugReportCallbackEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 18411 | countingStream->rewind(); |
| 18412 | uint32_t opcode_vkDestroyDebugReportCallbackEXT = OP_vkDestroyDebugReportCallbackEXT; |
| 18413 | stream->write(&opcode_vkDestroyDebugReportCallbackEXT, sizeof(uint32_t)); |
| 18414 | stream->write(&packetSize_vkDestroyDebugReportCallbackEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18415 | uint64_t cgen_var_1210; |
| 18416 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1210, 1); |
| 18417 | stream->write((uint64_t*)&cgen_var_1210, 1 * 8); |
| 18418 | uint64_t cgen_var_1211; |
| 18419 | stream->handleMapping()->mapHandles_VkDebugReportCallbackEXT_u64(&local_callback, &cgen_var_1211, 1); |
| 18420 | stream->write((uint64_t*)&cgen_var_1211, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 18421 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18422 | uint64_t cgen_var_1212 = (uint64_t)(uintptr_t)local_pAllocator; |
| 18423 | stream->putBe64(cgen_var_1212); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18424 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18425 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18426 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18427 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 18428 | AEMU_SCOPED_TRACE("vkDestroyDebugReportCallbackEXT readParams"); |
| 18429 | AEMU_SCOPED_TRACE("vkDestroyDebugReportCallbackEXT returnUnmarshal"); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18430 | resources->destroyMapping()->mapHandles_VkDebugReportCallbackEXT((VkDebugReportCallbackEXT*)&callback); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18431 | mImpl->log("finish vkDestroyDebugReportCallbackEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18432 | } |
| 18433 | |
| 18434 | void VkEncoder::vkDebugReportMessageEXT( |
| 18435 | VkInstance instance, |
| 18436 | VkDebugReportFlagsEXT flags, |
| 18437 | VkDebugReportObjectTypeEXT objectType, |
| 18438 | uint64_t object, |
| 18439 | size_t location, |
| 18440 | int32_t messageCode, |
| 18441 | const char* pLayerPrefix, |
| 18442 | const char* pMessage) |
| 18443 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 18444 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 18445 | AEMU_SCOPED_TRACE("vkDebugReportMessageEXT encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18446 | mImpl->log("start vkDebugReportMessageEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18447 | auto stream = mImpl->stream(); |
| 18448 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18449 | auto resources = mImpl->resources(); |
| 18450 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 18451 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18452 | VkInstance local_instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18453 | VkDebugReportFlagsEXT local_flags; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18454 | VkDebugReportObjectTypeEXT local_objectType; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18455 | uint64_t local_object; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18456 | size_t local_location; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18457 | int32_t local_messageCode; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18458 | char* local_pLayerPrefix; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 18459 | char* local_pMessage; |
| 18460 | local_instance = instance; |
| 18461 | local_flags = flags; |
| 18462 | local_objectType = objectType; |
| 18463 | local_object = object; |
| 18464 | local_location = location; |
| 18465 | local_messageCode = messageCode; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18466 | local_pLayerPrefix = nullptr; |
| 18467 | if (pLayerPrefix) |
| 18468 | { |
| 18469 | local_pLayerPrefix = pool->strDup(pLayerPrefix); |
| 18470 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18471 | local_pMessage = nullptr; |
| 18472 | if (pMessage) |
| 18473 | { |
| 18474 | local_pMessage = pool->strDup(pMessage); |
| 18475 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18476 | countingStream->rewind(); |
| 18477 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18478 | uint64_t cgen_var_1213; |
| 18479 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1213, 1); |
| 18480 | countingStream->write((uint64_t*)&cgen_var_1213, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18481 | countingStream->write((VkDebugReportFlagsEXT*)&local_flags, sizeof(VkDebugReportFlagsEXT)); |
| 18482 | countingStream->write((VkDebugReportObjectTypeEXT*)&local_objectType, sizeof(VkDebugReportObjectTypeEXT)); |
| 18483 | countingStream->write((uint64_t*)&local_object, sizeof(uint64_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18484 | uint64_t cgen_var_1214 = (uint64_t)local_location; |
| 18485 | countingStream->putBe64(cgen_var_1214); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18486 | countingStream->write((int32_t*)&local_messageCode, sizeof(int32_t)); |
| 18487 | countingStream->putString(local_pLayerPrefix); |
| 18488 | countingStream->putString(local_pMessage); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18489 | } |
| 18490 | uint32_t packetSize_vkDebugReportMessageEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 18491 | countingStream->rewind(); |
| 18492 | uint32_t opcode_vkDebugReportMessageEXT = OP_vkDebugReportMessageEXT; |
| 18493 | stream->write(&opcode_vkDebugReportMessageEXT, sizeof(uint32_t)); |
| 18494 | stream->write(&packetSize_vkDebugReportMessageEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18495 | uint64_t cgen_var_1215; |
| 18496 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1215, 1); |
| 18497 | stream->write((uint64_t*)&cgen_var_1215, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18498 | stream->write((VkDebugReportFlagsEXT*)&local_flags, sizeof(VkDebugReportFlagsEXT)); |
| 18499 | stream->write((VkDebugReportObjectTypeEXT*)&local_objectType, sizeof(VkDebugReportObjectTypeEXT)); |
| 18500 | stream->write((uint64_t*)&local_object, sizeof(uint64_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18501 | uint64_t cgen_var_1216 = (uint64_t)local_location; |
| 18502 | stream->putBe64(cgen_var_1216); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18503 | stream->write((int32_t*)&local_messageCode, sizeof(int32_t)); |
| 18504 | stream->putString(local_pLayerPrefix); |
| 18505 | stream->putString(local_pMessage); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 18506 | AEMU_SCOPED_TRACE("vkDebugReportMessageEXT readParams"); |
| 18507 | AEMU_SCOPED_TRACE("vkDebugReportMessageEXT returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18508 | mImpl->log("finish vkDebugReportMessageEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18509 | } |
| 18510 | |
| 18511 | #endif |
| 18512 | #ifdef VK_NV_glsl_shader |
| 18513 | #endif |
| 18514 | #ifdef VK_EXT_depth_range_unrestricted |
| 18515 | #endif |
| 18516 | #ifdef VK_IMG_filter_cubic |
| 18517 | #endif |
| 18518 | #ifdef VK_AMD_rasterization_order |
| 18519 | #endif |
| 18520 | #ifdef VK_AMD_shader_trinary_minmax |
| 18521 | #endif |
| 18522 | #ifdef VK_AMD_shader_explicit_vertex_parameter |
| 18523 | #endif |
| 18524 | #ifdef VK_EXT_debug_marker |
| 18525 | VkResult VkEncoder::vkDebugMarkerSetObjectTagEXT( |
| 18526 | VkDevice device, |
| 18527 | const VkDebugMarkerObjectTagInfoEXT* pTagInfo) |
| 18528 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 18529 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 18530 | AEMU_SCOPED_TRACE("vkDebugMarkerSetObjectTagEXT encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18531 | mImpl->log("start vkDebugMarkerSetObjectTagEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18532 | auto stream = mImpl->stream(); |
| 18533 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18534 | auto resources = mImpl->resources(); |
| 18535 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 18536 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18537 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18538 | VkDebugMarkerObjectTagInfoEXT* local_pTagInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 18539 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18540 | local_pTagInfo = nullptr; |
| 18541 | if (pTagInfo) |
| 18542 | { |
| 18543 | local_pTagInfo = (VkDebugMarkerObjectTagInfoEXT*)pool->alloc(sizeof(const VkDebugMarkerObjectTagInfoEXT)); |
| 18544 | deepcopy_VkDebugMarkerObjectTagInfoEXT(pool, pTagInfo, (VkDebugMarkerObjectTagInfoEXT*)(local_pTagInfo)); |
| 18545 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 18546 | if (local_pTagInfo) |
| 18547 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 18548 | transform_tohost_VkDebugMarkerObjectTagInfoEXT(mImpl->resources(), (VkDebugMarkerObjectTagInfoEXT*)(local_pTagInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 18549 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18550 | countingStream->rewind(); |
| 18551 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18552 | uint64_t cgen_var_1217; |
| 18553 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1217, 1); |
| 18554 | countingStream->write((uint64_t*)&cgen_var_1217, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18555 | marshal_VkDebugMarkerObjectTagInfoEXT(countingStream, (VkDebugMarkerObjectTagInfoEXT*)(local_pTagInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18556 | } |
| 18557 | uint32_t packetSize_vkDebugMarkerSetObjectTagEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 18558 | countingStream->rewind(); |
| 18559 | uint32_t opcode_vkDebugMarkerSetObjectTagEXT = OP_vkDebugMarkerSetObjectTagEXT; |
| 18560 | stream->write(&opcode_vkDebugMarkerSetObjectTagEXT, sizeof(uint32_t)); |
| 18561 | stream->write(&packetSize_vkDebugMarkerSetObjectTagEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18562 | uint64_t cgen_var_1218; |
| 18563 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1218, 1); |
| 18564 | stream->write((uint64_t*)&cgen_var_1218, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18565 | marshal_VkDebugMarkerObjectTagInfoEXT(stream, (VkDebugMarkerObjectTagInfoEXT*)(local_pTagInfo)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 18566 | AEMU_SCOPED_TRACE("vkDebugMarkerSetObjectTagEXT readParams"); |
| 18567 | AEMU_SCOPED_TRACE("vkDebugMarkerSetObjectTagEXT returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18568 | VkResult vkDebugMarkerSetObjectTagEXT_VkResult_return = (VkResult)0; |
| 18569 | stream->read(&vkDebugMarkerSetObjectTagEXT_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 18570 | countingStream->clearPool(); |
| 18571 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 18572 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18573 | mImpl->log("finish vkDebugMarkerSetObjectTagEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18574 | return vkDebugMarkerSetObjectTagEXT_VkResult_return; |
| 18575 | } |
| 18576 | |
| 18577 | VkResult VkEncoder::vkDebugMarkerSetObjectNameEXT( |
| 18578 | VkDevice device, |
| 18579 | const VkDebugMarkerObjectNameInfoEXT* pNameInfo) |
| 18580 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 18581 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 18582 | AEMU_SCOPED_TRACE("vkDebugMarkerSetObjectNameEXT encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18583 | mImpl->log("start vkDebugMarkerSetObjectNameEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18584 | auto stream = mImpl->stream(); |
| 18585 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18586 | auto resources = mImpl->resources(); |
| 18587 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 18588 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18589 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18590 | VkDebugMarkerObjectNameInfoEXT* local_pNameInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 18591 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18592 | local_pNameInfo = nullptr; |
| 18593 | if (pNameInfo) |
| 18594 | { |
| 18595 | local_pNameInfo = (VkDebugMarkerObjectNameInfoEXT*)pool->alloc(sizeof(const VkDebugMarkerObjectNameInfoEXT)); |
| 18596 | deepcopy_VkDebugMarkerObjectNameInfoEXT(pool, pNameInfo, (VkDebugMarkerObjectNameInfoEXT*)(local_pNameInfo)); |
| 18597 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 18598 | if (local_pNameInfo) |
| 18599 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 18600 | transform_tohost_VkDebugMarkerObjectNameInfoEXT(mImpl->resources(), (VkDebugMarkerObjectNameInfoEXT*)(local_pNameInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 18601 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18602 | countingStream->rewind(); |
| 18603 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18604 | uint64_t cgen_var_1219; |
| 18605 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1219, 1); |
| 18606 | countingStream->write((uint64_t*)&cgen_var_1219, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18607 | marshal_VkDebugMarkerObjectNameInfoEXT(countingStream, (VkDebugMarkerObjectNameInfoEXT*)(local_pNameInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18608 | } |
| 18609 | uint32_t packetSize_vkDebugMarkerSetObjectNameEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 18610 | countingStream->rewind(); |
| 18611 | uint32_t opcode_vkDebugMarkerSetObjectNameEXT = OP_vkDebugMarkerSetObjectNameEXT; |
| 18612 | stream->write(&opcode_vkDebugMarkerSetObjectNameEXT, sizeof(uint32_t)); |
| 18613 | stream->write(&packetSize_vkDebugMarkerSetObjectNameEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18614 | uint64_t cgen_var_1220; |
| 18615 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1220, 1); |
| 18616 | stream->write((uint64_t*)&cgen_var_1220, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18617 | marshal_VkDebugMarkerObjectNameInfoEXT(stream, (VkDebugMarkerObjectNameInfoEXT*)(local_pNameInfo)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 18618 | AEMU_SCOPED_TRACE("vkDebugMarkerSetObjectNameEXT readParams"); |
| 18619 | AEMU_SCOPED_TRACE("vkDebugMarkerSetObjectNameEXT returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18620 | VkResult vkDebugMarkerSetObjectNameEXT_VkResult_return = (VkResult)0; |
| 18621 | stream->read(&vkDebugMarkerSetObjectNameEXT_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 18622 | countingStream->clearPool(); |
| 18623 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 18624 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18625 | mImpl->log("finish vkDebugMarkerSetObjectNameEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18626 | return vkDebugMarkerSetObjectNameEXT_VkResult_return; |
| 18627 | } |
| 18628 | |
| 18629 | void VkEncoder::vkCmdDebugMarkerBeginEXT( |
| 18630 | VkCommandBuffer commandBuffer, |
| 18631 | const VkDebugMarkerMarkerInfoEXT* pMarkerInfo) |
| 18632 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 18633 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 18634 | AEMU_SCOPED_TRACE("vkCmdDebugMarkerBeginEXT encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18635 | mImpl->log("start vkCmdDebugMarkerBeginEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18636 | auto stream = mImpl->stream(); |
| 18637 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18638 | auto resources = mImpl->resources(); |
| 18639 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 18640 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18641 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18642 | VkDebugMarkerMarkerInfoEXT* local_pMarkerInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 18643 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18644 | local_pMarkerInfo = nullptr; |
| 18645 | if (pMarkerInfo) |
| 18646 | { |
| 18647 | local_pMarkerInfo = (VkDebugMarkerMarkerInfoEXT*)pool->alloc(sizeof(const VkDebugMarkerMarkerInfoEXT)); |
| 18648 | deepcopy_VkDebugMarkerMarkerInfoEXT(pool, pMarkerInfo, (VkDebugMarkerMarkerInfoEXT*)(local_pMarkerInfo)); |
| 18649 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 18650 | if (local_pMarkerInfo) |
| 18651 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 18652 | transform_tohost_VkDebugMarkerMarkerInfoEXT(mImpl->resources(), (VkDebugMarkerMarkerInfoEXT*)(local_pMarkerInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 18653 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18654 | countingStream->rewind(); |
| 18655 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18656 | uint64_t cgen_var_1221; |
| 18657 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1221, 1); |
| 18658 | countingStream->write((uint64_t*)&cgen_var_1221, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18659 | marshal_VkDebugMarkerMarkerInfoEXT(countingStream, (VkDebugMarkerMarkerInfoEXT*)(local_pMarkerInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18660 | } |
| 18661 | uint32_t packetSize_vkCmdDebugMarkerBeginEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 18662 | countingStream->rewind(); |
| 18663 | uint32_t opcode_vkCmdDebugMarkerBeginEXT = OP_vkCmdDebugMarkerBeginEXT; |
| 18664 | stream->write(&opcode_vkCmdDebugMarkerBeginEXT, sizeof(uint32_t)); |
| 18665 | stream->write(&packetSize_vkCmdDebugMarkerBeginEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18666 | uint64_t cgen_var_1222; |
| 18667 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1222, 1); |
| 18668 | stream->write((uint64_t*)&cgen_var_1222, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18669 | marshal_VkDebugMarkerMarkerInfoEXT(stream, (VkDebugMarkerMarkerInfoEXT*)(local_pMarkerInfo)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 18670 | AEMU_SCOPED_TRACE("vkCmdDebugMarkerBeginEXT readParams"); |
| 18671 | AEMU_SCOPED_TRACE("vkCmdDebugMarkerBeginEXT returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18672 | mImpl->log("finish vkCmdDebugMarkerBeginEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18673 | } |
| 18674 | |
| 18675 | void VkEncoder::vkCmdDebugMarkerEndEXT( |
| 18676 | VkCommandBuffer commandBuffer) |
| 18677 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 18678 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 18679 | AEMU_SCOPED_TRACE("vkCmdDebugMarkerEndEXT encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18680 | mImpl->log("start vkCmdDebugMarkerEndEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18681 | auto stream = mImpl->stream(); |
| 18682 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18683 | auto resources = mImpl->resources(); |
| 18684 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 18685 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18686 | VkCommandBuffer local_commandBuffer; |
| 18687 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18688 | countingStream->rewind(); |
| 18689 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18690 | uint64_t cgen_var_1223; |
| 18691 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1223, 1); |
| 18692 | countingStream->write((uint64_t*)&cgen_var_1223, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18693 | } |
| 18694 | uint32_t packetSize_vkCmdDebugMarkerEndEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 18695 | countingStream->rewind(); |
| 18696 | uint32_t opcode_vkCmdDebugMarkerEndEXT = OP_vkCmdDebugMarkerEndEXT; |
| 18697 | stream->write(&opcode_vkCmdDebugMarkerEndEXT, sizeof(uint32_t)); |
| 18698 | stream->write(&packetSize_vkCmdDebugMarkerEndEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18699 | uint64_t cgen_var_1224; |
| 18700 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1224, 1); |
| 18701 | stream->write((uint64_t*)&cgen_var_1224, 1 * 8); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 18702 | AEMU_SCOPED_TRACE("vkCmdDebugMarkerEndEXT readParams"); |
| 18703 | AEMU_SCOPED_TRACE("vkCmdDebugMarkerEndEXT returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18704 | mImpl->log("finish vkCmdDebugMarkerEndEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18705 | } |
| 18706 | |
| 18707 | void VkEncoder::vkCmdDebugMarkerInsertEXT( |
| 18708 | VkCommandBuffer commandBuffer, |
| 18709 | const VkDebugMarkerMarkerInfoEXT* pMarkerInfo) |
| 18710 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 18711 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 18712 | AEMU_SCOPED_TRACE("vkCmdDebugMarkerInsertEXT encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18713 | mImpl->log("start vkCmdDebugMarkerInsertEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18714 | auto stream = mImpl->stream(); |
| 18715 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18716 | auto resources = mImpl->resources(); |
| 18717 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 18718 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18719 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18720 | VkDebugMarkerMarkerInfoEXT* local_pMarkerInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 18721 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18722 | local_pMarkerInfo = nullptr; |
| 18723 | if (pMarkerInfo) |
| 18724 | { |
| 18725 | local_pMarkerInfo = (VkDebugMarkerMarkerInfoEXT*)pool->alloc(sizeof(const VkDebugMarkerMarkerInfoEXT)); |
| 18726 | deepcopy_VkDebugMarkerMarkerInfoEXT(pool, pMarkerInfo, (VkDebugMarkerMarkerInfoEXT*)(local_pMarkerInfo)); |
| 18727 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 18728 | if (local_pMarkerInfo) |
| 18729 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 18730 | transform_tohost_VkDebugMarkerMarkerInfoEXT(mImpl->resources(), (VkDebugMarkerMarkerInfoEXT*)(local_pMarkerInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 18731 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18732 | countingStream->rewind(); |
| 18733 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18734 | uint64_t cgen_var_1225; |
| 18735 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1225, 1); |
| 18736 | countingStream->write((uint64_t*)&cgen_var_1225, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18737 | marshal_VkDebugMarkerMarkerInfoEXT(countingStream, (VkDebugMarkerMarkerInfoEXT*)(local_pMarkerInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18738 | } |
| 18739 | uint32_t packetSize_vkCmdDebugMarkerInsertEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 18740 | countingStream->rewind(); |
| 18741 | uint32_t opcode_vkCmdDebugMarkerInsertEXT = OP_vkCmdDebugMarkerInsertEXT; |
| 18742 | stream->write(&opcode_vkCmdDebugMarkerInsertEXT, sizeof(uint32_t)); |
| 18743 | stream->write(&packetSize_vkCmdDebugMarkerInsertEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18744 | uint64_t cgen_var_1226; |
| 18745 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1226, 1); |
| 18746 | stream->write((uint64_t*)&cgen_var_1226, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18747 | marshal_VkDebugMarkerMarkerInfoEXT(stream, (VkDebugMarkerMarkerInfoEXT*)(local_pMarkerInfo)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 18748 | AEMU_SCOPED_TRACE("vkCmdDebugMarkerInsertEXT readParams"); |
| 18749 | AEMU_SCOPED_TRACE("vkCmdDebugMarkerInsertEXT returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18750 | mImpl->log("finish vkCmdDebugMarkerInsertEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18751 | } |
| 18752 | |
| 18753 | #endif |
| 18754 | #ifdef VK_AMD_gcn_shader |
| 18755 | #endif |
| 18756 | #ifdef VK_NV_dedicated_allocation |
| 18757 | #endif |
| 18758 | #ifdef VK_AMD_draw_indirect_count |
| 18759 | void VkEncoder::vkCmdDrawIndirectCountAMD( |
| 18760 | VkCommandBuffer commandBuffer, |
| 18761 | VkBuffer buffer, |
| 18762 | VkDeviceSize offset, |
| 18763 | VkBuffer countBuffer, |
| 18764 | VkDeviceSize countBufferOffset, |
| 18765 | uint32_t maxDrawCount, |
| 18766 | uint32_t stride) |
| 18767 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 18768 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 18769 | AEMU_SCOPED_TRACE("vkCmdDrawIndirectCountAMD encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18770 | mImpl->log("start vkCmdDrawIndirectCountAMD"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18771 | auto stream = mImpl->stream(); |
| 18772 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18773 | auto resources = mImpl->resources(); |
| 18774 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 18775 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18776 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18777 | VkBuffer local_buffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18778 | VkDeviceSize local_offset; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18779 | VkBuffer local_countBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18780 | VkDeviceSize local_countBufferOffset; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18781 | uint32_t local_maxDrawCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18782 | uint32_t local_stride; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 18783 | local_commandBuffer = commandBuffer; |
| 18784 | local_buffer = buffer; |
| 18785 | local_offset = offset; |
| 18786 | local_countBuffer = countBuffer; |
| 18787 | local_countBufferOffset = countBufferOffset; |
| 18788 | local_maxDrawCount = maxDrawCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18789 | local_stride = stride; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18790 | countingStream->rewind(); |
| 18791 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18792 | uint64_t cgen_var_1227; |
| 18793 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1227, 1); |
| 18794 | countingStream->write((uint64_t*)&cgen_var_1227, 1 * 8); |
| 18795 | uint64_t cgen_var_1228; |
| 18796 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_1228, 1); |
| 18797 | countingStream->write((uint64_t*)&cgen_var_1228, 1 * 8); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame] | 18798 | countingStream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18799 | uint64_t cgen_var_1229; |
| 18800 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_countBuffer, &cgen_var_1229, 1); |
| 18801 | countingStream->write((uint64_t*)&cgen_var_1229, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18802 | countingStream->write((VkDeviceSize*)&local_countBufferOffset, sizeof(VkDeviceSize)); |
| 18803 | countingStream->write((uint32_t*)&local_maxDrawCount, sizeof(uint32_t)); |
| 18804 | countingStream->write((uint32_t*)&local_stride, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18805 | } |
| 18806 | uint32_t packetSize_vkCmdDrawIndirectCountAMD = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 18807 | countingStream->rewind(); |
| 18808 | uint32_t opcode_vkCmdDrawIndirectCountAMD = OP_vkCmdDrawIndirectCountAMD; |
| 18809 | stream->write(&opcode_vkCmdDrawIndirectCountAMD, sizeof(uint32_t)); |
| 18810 | stream->write(&packetSize_vkCmdDrawIndirectCountAMD, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18811 | uint64_t cgen_var_1230; |
| 18812 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1230, 1); |
| 18813 | stream->write((uint64_t*)&cgen_var_1230, 1 * 8); |
| 18814 | uint64_t cgen_var_1231; |
| 18815 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_1231, 1); |
| 18816 | stream->write((uint64_t*)&cgen_var_1231, 1 * 8); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame] | 18817 | stream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18818 | uint64_t cgen_var_1232; |
| 18819 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_countBuffer, &cgen_var_1232, 1); |
| 18820 | stream->write((uint64_t*)&cgen_var_1232, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18821 | stream->write((VkDeviceSize*)&local_countBufferOffset, sizeof(VkDeviceSize)); |
| 18822 | stream->write((uint32_t*)&local_maxDrawCount, sizeof(uint32_t)); |
| 18823 | stream->write((uint32_t*)&local_stride, sizeof(uint32_t)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 18824 | AEMU_SCOPED_TRACE("vkCmdDrawIndirectCountAMD readParams"); |
| 18825 | AEMU_SCOPED_TRACE("vkCmdDrawIndirectCountAMD returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18826 | mImpl->log("finish vkCmdDrawIndirectCountAMD");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18827 | } |
| 18828 | |
| 18829 | void VkEncoder::vkCmdDrawIndexedIndirectCountAMD( |
| 18830 | VkCommandBuffer commandBuffer, |
| 18831 | VkBuffer buffer, |
| 18832 | VkDeviceSize offset, |
| 18833 | VkBuffer countBuffer, |
| 18834 | VkDeviceSize countBufferOffset, |
| 18835 | uint32_t maxDrawCount, |
| 18836 | uint32_t stride) |
| 18837 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 18838 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 18839 | AEMU_SCOPED_TRACE("vkCmdDrawIndexedIndirectCountAMD encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18840 | mImpl->log("start vkCmdDrawIndexedIndirectCountAMD"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18841 | auto stream = mImpl->stream(); |
| 18842 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18843 | auto resources = mImpl->resources(); |
| 18844 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 18845 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18846 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18847 | VkBuffer local_buffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18848 | VkDeviceSize local_offset; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18849 | VkBuffer local_countBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18850 | VkDeviceSize local_countBufferOffset; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18851 | uint32_t local_maxDrawCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18852 | uint32_t local_stride; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 18853 | local_commandBuffer = commandBuffer; |
| 18854 | local_buffer = buffer; |
| 18855 | local_offset = offset; |
| 18856 | local_countBuffer = countBuffer; |
| 18857 | local_countBufferOffset = countBufferOffset; |
| 18858 | local_maxDrawCount = maxDrawCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18859 | local_stride = stride; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18860 | countingStream->rewind(); |
| 18861 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18862 | uint64_t cgen_var_1233; |
| 18863 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1233, 1); |
| 18864 | countingStream->write((uint64_t*)&cgen_var_1233, 1 * 8); |
| 18865 | uint64_t cgen_var_1234; |
| 18866 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_1234, 1); |
| 18867 | countingStream->write((uint64_t*)&cgen_var_1234, 1 * 8); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame] | 18868 | countingStream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18869 | uint64_t cgen_var_1235; |
| 18870 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_countBuffer, &cgen_var_1235, 1); |
| 18871 | countingStream->write((uint64_t*)&cgen_var_1235, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18872 | countingStream->write((VkDeviceSize*)&local_countBufferOffset, sizeof(VkDeviceSize)); |
| 18873 | countingStream->write((uint32_t*)&local_maxDrawCount, sizeof(uint32_t)); |
| 18874 | countingStream->write((uint32_t*)&local_stride, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18875 | } |
| 18876 | uint32_t packetSize_vkCmdDrawIndexedIndirectCountAMD = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 18877 | countingStream->rewind(); |
| 18878 | uint32_t opcode_vkCmdDrawIndexedIndirectCountAMD = OP_vkCmdDrawIndexedIndirectCountAMD; |
| 18879 | stream->write(&opcode_vkCmdDrawIndexedIndirectCountAMD, sizeof(uint32_t)); |
| 18880 | stream->write(&packetSize_vkCmdDrawIndexedIndirectCountAMD, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18881 | uint64_t cgen_var_1236; |
| 18882 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1236, 1); |
| 18883 | stream->write((uint64_t*)&cgen_var_1236, 1 * 8); |
| 18884 | uint64_t cgen_var_1237; |
| 18885 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_1237, 1); |
| 18886 | stream->write((uint64_t*)&cgen_var_1237, 1 * 8); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame] | 18887 | stream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18888 | uint64_t cgen_var_1238; |
| 18889 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_countBuffer, &cgen_var_1238, 1); |
| 18890 | stream->write((uint64_t*)&cgen_var_1238, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18891 | stream->write((VkDeviceSize*)&local_countBufferOffset, sizeof(VkDeviceSize)); |
| 18892 | stream->write((uint32_t*)&local_maxDrawCount, sizeof(uint32_t)); |
| 18893 | stream->write((uint32_t*)&local_stride, sizeof(uint32_t)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 18894 | AEMU_SCOPED_TRACE("vkCmdDrawIndexedIndirectCountAMD readParams"); |
| 18895 | AEMU_SCOPED_TRACE("vkCmdDrawIndexedIndirectCountAMD returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18896 | mImpl->log("finish vkCmdDrawIndexedIndirectCountAMD");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18897 | } |
| 18898 | |
| 18899 | #endif |
| 18900 | #ifdef VK_AMD_negative_viewport_height |
| 18901 | #endif |
| 18902 | #ifdef VK_AMD_gpu_shader_half_float |
| 18903 | #endif |
| 18904 | #ifdef VK_AMD_shader_ballot |
| 18905 | #endif |
| 18906 | #ifdef VK_AMD_texture_gather_bias_lod |
| 18907 | #endif |
| 18908 | #ifdef VK_AMD_shader_info |
| 18909 | VkResult VkEncoder::vkGetShaderInfoAMD( |
| 18910 | VkDevice device, |
| 18911 | VkPipeline pipeline, |
| 18912 | VkShaderStageFlagBits shaderStage, |
| 18913 | VkShaderInfoTypeAMD infoType, |
| 18914 | size_t* pInfoSize, |
| 18915 | void* pInfo) |
| 18916 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 18917 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 18918 | AEMU_SCOPED_TRACE("vkGetShaderInfoAMD encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18919 | mImpl->log("start vkGetShaderInfoAMD"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18920 | auto stream = mImpl->stream(); |
| 18921 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18922 | auto resources = mImpl->resources(); |
| 18923 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 18924 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18925 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18926 | VkPipeline local_pipeline; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18927 | VkShaderStageFlagBits local_shaderStage; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18928 | VkShaderInfoTypeAMD local_infoType; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 18929 | local_device = device; |
| 18930 | local_pipeline = pipeline; |
| 18931 | local_shaderStage = shaderStage; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18932 | local_infoType = infoType; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18933 | countingStream->rewind(); |
| 18934 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18935 | uint64_t cgen_var_1239; |
| 18936 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1239, 1); |
| 18937 | countingStream->write((uint64_t*)&cgen_var_1239, 1 * 8); |
| 18938 | uint64_t cgen_var_1240; |
| 18939 | countingStream->handleMapping()->mapHandles_VkPipeline_u64(&local_pipeline, &cgen_var_1240, 1); |
| 18940 | countingStream->write((uint64_t*)&cgen_var_1240, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18941 | countingStream->write((VkShaderStageFlagBits*)&local_shaderStage, sizeof(VkShaderStageFlagBits)); |
| 18942 | countingStream->write((VkShaderInfoTypeAMD*)&local_infoType, sizeof(VkShaderInfoTypeAMD)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 18943 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18944 | uint64_t cgen_var_1241 = (uint64_t)(uintptr_t)pInfoSize; |
| 18945 | countingStream->putBe64(cgen_var_1241); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18946 | if (pInfoSize) |
| 18947 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18948 | uint64_t cgen_var_1242 = (uint64_t)(*pInfoSize); |
| 18949 | countingStream->putBe64(cgen_var_1242); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18950 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 18951 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18952 | uint64_t cgen_var_1243 = (uint64_t)(uintptr_t)pInfo; |
| 18953 | countingStream->putBe64(cgen_var_1243); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18954 | if (pInfo) |
| 18955 | { |
| 18956 | countingStream->write((void*)pInfo, (*(pInfoSize)) * sizeof(uint8_t)); |
| 18957 | } |
| 18958 | } |
| 18959 | uint32_t packetSize_vkGetShaderInfoAMD = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 18960 | countingStream->rewind(); |
| 18961 | uint32_t opcode_vkGetShaderInfoAMD = OP_vkGetShaderInfoAMD; |
| 18962 | stream->write(&opcode_vkGetShaderInfoAMD, sizeof(uint32_t)); |
| 18963 | stream->write(&packetSize_vkGetShaderInfoAMD, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18964 | uint64_t cgen_var_1244; |
| 18965 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1244, 1); |
| 18966 | stream->write((uint64_t*)&cgen_var_1244, 1 * 8); |
| 18967 | uint64_t cgen_var_1245; |
| 18968 | stream->handleMapping()->mapHandles_VkPipeline_u64(&local_pipeline, &cgen_var_1245, 1); |
| 18969 | stream->write((uint64_t*)&cgen_var_1245, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18970 | stream->write((VkShaderStageFlagBits*)&local_shaderStage, sizeof(VkShaderStageFlagBits)); |
| 18971 | stream->write((VkShaderInfoTypeAMD*)&local_infoType, sizeof(VkShaderInfoTypeAMD)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 18972 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18973 | uint64_t cgen_var_1246 = (uint64_t)(uintptr_t)pInfoSize; |
| 18974 | stream->putBe64(cgen_var_1246); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18975 | if (pInfoSize) |
| 18976 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18977 | uint64_t cgen_var_1247 = (uint64_t)(*pInfoSize); |
| 18978 | stream->putBe64(cgen_var_1247); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18979 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 18980 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18981 | uint64_t cgen_var_1248 = (uint64_t)(uintptr_t)pInfo; |
| 18982 | stream->putBe64(cgen_var_1248); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18983 | if (pInfo) |
| 18984 | { |
| 18985 | stream->write((void*)pInfo, (*(pInfoSize)) * sizeof(uint8_t)); |
| 18986 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 18987 | AEMU_SCOPED_TRACE("vkGetShaderInfoAMD readParams"); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 18988 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18989 | size_t* check_pInfoSize; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 18990 | check_pInfoSize = (size_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18991 | if (pInfoSize) |
| 18992 | { |
| 18993 | if (!(check_pInfoSize)) |
| 18994 | { |
| 18995 | fprintf(stderr, "fatal: pInfoSize inconsistent between guest and host\n"); |
| 18996 | } |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 18997 | (*pInfoSize) = (size_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18998 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 18999 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19000 | void* check_pInfo; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 19001 | check_pInfo = (void*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19002 | if (pInfo) |
| 19003 | { |
| 19004 | if (!(check_pInfo)) |
| 19005 | { |
| 19006 | fprintf(stderr, "fatal: pInfo inconsistent between guest and host\n"); |
| 19007 | } |
| 19008 | stream->read((void*)pInfo, (*(pInfoSize)) * sizeof(uint8_t)); |
| 19009 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 19010 | AEMU_SCOPED_TRACE("vkGetShaderInfoAMD returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19011 | VkResult vkGetShaderInfoAMD_VkResult_return = (VkResult)0; |
| 19012 | stream->read(&vkGetShaderInfoAMD_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 19013 | countingStream->clearPool(); |
| 19014 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19015 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19016 | mImpl->log("finish vkGetShaderInfoAMD");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19017 | return vkGetShaderInfoAMD_VkResult_return; |
| 19018 | } |
| 19019 | |
| 19020 | #endif |
| 19021 | #ifdef VK_AMD_shader_image_load_store_lod |
| 19022 | #endif |
| 19023 | #ifdef VK_IMG_format_pvrtc |
| 19024 | #endif |
| 19025 | #ifdef VK_NV_external_memory_capabilities |
| 19026 | VkResult VkEncoder::vkGetPhysicalDeviceExternalImageFormatPropertiesNV( |
| 19027 | VkPhysicalDevice physicalDevice, |
| 19028 | VkFormat format, |
| 19029 | VkImageType type, |
| 19030 | VkImageTiling tiling, |
| 19031 | VkImageUsageFlags usage, |
| 19032 | VkImageCreateFlags flags, |
| 19033 | VkExternalMemoryHandleTypeFlagsNV externalHandleType, |
| 19034 | VkExternalImageFormatPropertiesNV* pExternalImageFormatProperties) |
| 19035 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 19036 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 19037 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceExternalImageFormatPropertiesNV encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19038 | mImpl->log("start vkGetPhysicalDeviceExternalImageFormatPropertiesNV"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19039 | auto stream = mImpl->stream(); |
| 19040 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19041 | auto resources = mImpl->resources(); |
| 19042 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19043 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19044 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19045 | VkFormat local_format; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19046 | VkImageType local_type; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19047 | VkImageTiling local_tiling; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19048 | VkImageUsageFlags local_usage; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19049 | VkImageCreateFlags local_flags; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19050 | VkExternalMemoryHandleTypeFlagsNV local_externalHandleType; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 19051 | local_physicalDevice = physicalDevice; |
| 19052 | local_format = format; |
| 19053 | local_type = type; |
| 19054 | local_tiling = tiling; |
| 19055 | local_usage = usage; |
| 19056 | local_flags = flags; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19057 | local_externalHandleType = externalHandleType; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19058 | countingStream->rewind(); |
| 19059 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19060 | uint64_t cgen_var_1252; |
| 19061 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1252, 1); |
| 19062 | countingStream->write((uint64_t*)&cgen_var_1252, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19063 | countingStream->write((VkFormat*)&local_format, sizeof(VkFormat)); |
| 19064 | countingStream->write((VkImageType*)&local_type, sizeof(VkImageType)); |
| 19065 | countingStream->write((VkImageTiling*)&local_tiling, sizeof(VkImageTiling)); |
| 19066 | countingStream->write((VkImageUsageFlags*)&local_usage, sizeof(VkImageUsageFlags)); |
| 19067 | countingStream->write((VkImageCreateFlags*)&local_flags, sizeof(VkImageCreateFlags)); |
| 19068 | countingStream->write((VkExternalMemoryHandleTypeFlagsNV*)&local_externalHandleType, sizeof(VkExternalMemoryHandleTypeFlagsNV)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19069 | marshal_VkExternalImageFormatPropertiesNV(countingStream, (VkExternalImageFormatPropertiesNV*)(pExternalImageFormatProperties)); |
| 19070 | } |
| 19071 | uint32_t packetSize_vkGetPhysicalDeviceExternalImageFormatPropertiesNV = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 19072 | countingStream->rewind(); |
| 19073 | uint32_t opcode_vkGetPhysicalDeviceExternalImageFormatPropertiesNV = OP_vkGetPhysicalDeviceExternalImageFormatPropertiesNV; |
| 19074 | stream->write(&opcode_vkGetPhysicalDeviceExternalImageFormatPropertiesNV, sizeof(uint32_t)); |
| 19075 | stream->write(&packetSize_vkGetPhysicalDeviceExternalImageFormatPropertiesNV, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19076 | uint64_t cgen_var_1253; |
| 19077 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1253, 1); |
| 19078 | stream->write((uint64_t*)&cgen_var_1253, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19079 | stream->write((VkFormat*)&local_format, sizeof(VkFormat)); |
| 19080 | stream->write((VkImageType*)&local_type, sizeof(VkImageType)); |
| 19081 | stream->write((VkImageTiling*)&local_tiling, sizeof(VkImageTiling)); |
| 19082 | stream->write((VkImageUsageFlags*)&local_usage, sizeof(VkImageUsageFlags)); |
| 19083 | stream->write((VkImageCreateFlags*)&local_flags, sizeof(VkImageCreateFlags)); |
| 19084 | stream->write((VkExternalMemoryHandleTypeFlagsNV*)&local_externalHandleType, sizeof(VkExternalMemoryHandleTypeFlagsNV)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19085 | marshal_VkExternalImageFormatPropertiesNV(stream, (VkExternalImageFormatPropertiesNV*)(pExternalImageFormatProperties)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 19086 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceExternalImageFormatPropertiesNV readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19087 | unmarshal_VkExternalImageFormatPropertiesNV(stream, (VkExternalImageFormatPropertiesNV*)(pExternalImageFormatProperties)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 19088 | if (pExternalImageFormatProperties) |
| 19089 | { |
| 19090 | transform_fromhost_VkExternalImageFormatPropertiesNV(mImpl->resources(), (VkExternalImageFormatPropertiesNV*)(pExternalImageFormatProperties)); |
| 19091 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 19092 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceExternalImageFormatPropertiesNV returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19093 | VkResult vkGetPhysicalDeviceExternalImageFormatPropertiesNV_VkResult_return = (VkResult)0; |
| 19094 | stream->read(&vkGetPhysicalDeviceExternalImageFormatPropertiesNV_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 19095 | countingStream->clearPool(); |
| 19096 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19097 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19098 | mImpl->log("finish vkGetPhysicalDeviceExternalImageFormatPropertiesNV");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19099 | return vkGetPhysicalDeviceExternalImageFormatPropertiesNV_VkResult_return; |
| 19100 | } |
| 19101 | |
| 19102 | #endif |
| 19103 | #ifdef VK_NV_external_memory |
| 19104 | #endif |
| 19105 | #ifdef VK_NV_external_memory_win32 |
| 19106 | VkResult VkEncoder::vkGetMemoryWin32HandleNV( |
| 19107 | VkDevice device, |
| 19108 | VkDeviceMemory memory, |
| 19109 | VkExternalMemoryHandleTypeFlagsNV handleType, |
| 19110 | HANDLE* pHandle) |
| 19111 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 19112 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 19113 | AEMU_SCOPED_TRACE("vkGetMemoryWin32HandleNV encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19114 | mImpl->log("start vkGetMemoryWin32HandleNV"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19115 | auto stream = mImpl->stream(); |
| 19116 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19117 | auto resources = mImpl->resources(); |
| 19118 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19119 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19120 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19121 | VkDeviceMemory local_memory; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19122 | VkExternalMemoryHandleTypeFlagsNV local_handleType; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 19123 | local_device = device; |
| 19124 | local_memory = memory; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19125 | local_handleType = handleType; |
| Lingfeng Yang | 2b1b8cf | 2019-02-08 09:53:36 -0800 | [diff] [blame] | 19126 | 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] | 19127 | countingStream->rewind(); |
| 19128 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19129 | uint64_t cgen_var_1254; |
| 19130 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1254, 1); |
| 19131 | countingStream->write((uint64_t*)&cgen_var_1254, 1 * 8); |
| 19132 | uint64_t cgen_var_1255; |
| 19133 | countingStream->handleMapping()->mapHandles_VkDeviceMemory_u64(&local_memory, &cgen_var_1255, 1); |
| 19134 | countingStream->write((uint64_t*)&cgen_var_1255, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19135 | countingStream->write((VkExternalMemoryHandleTypeFlagsNV*)&local_handleType, sizeof(VkExternalMemoryHandleTypeFlagsNV)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19136 | countingStream->write((HANDLE*)pHandle, sizeof(HANDLE)); |
| 19137 | } |
| 19138 | uint32_t packetSize_vkGetMemoryWin32HandleNV = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 19139 | countingStream->rewind(); |
| 19140 | uint32_t opcode_vkGetMemoryWin32HandleNV = OP_vkGetMemoryWin32HandleNV; |
| 19141 | stream->write(&opcode_vkGetMemoryWin32HandleNV, sizeof(uint32_t)); |
| 19142 | stream->write(&packetSize_vkGetMemoryWin32HandleNV, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19143 | uint64_t cgen_var_1256; |
| 19144 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1256, 1); |
| 19145 | stream->write((uint64_t*)&cgen_var_1256, 1 * 8); |
| 19146 | uint64_t cgen_var_1257; |
| 19147 | stream->handleMapping()->mapHandles_VkDeviceMemory_u64(&local_memory, &cgen_var_1257, 1); |
| 19148 | stream->write((uint64_t*)&cgen_var_1257, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19149 | stream->write((VkExternalMemoryHandleTypeFlagsNV*)&local_handleType, sizeof(VkExternalMemoryHandleTypeFlagsNV)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19150 | stream->write((HANDLE*)pHandle, sizeof(HANDLE)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 19151 | AEMU_SCOPED_TRACE("vkGetMemoryWin32HandleNV readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19152 | stream->read((HANDLE*)pHandle, sizeof(HANDLE)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 19153 | AEMU_SCOPED_TRACE("vkGetMemoryWin32HandleNV returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19154 | VkResult vkGetMemoryWin32HandleNV_VkResult_return = (VkResult)0; |
| 19155 | stream->read(&vkGetMemoryWin32HandleNV_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 19156 | countingStream->clearPool(); |
| 19157 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19158 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19159 | mImpl->log("finish vkGetMemoryWin32HandleNV");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19160 | return vkGetMemoryWin32HandleNV_VkResult_return; |
| 19161 | } |
| 19162 | |
| 19163 | #endif |
| 19164 | #ifdef VK_NV_win32_keyed_mutex |
| 19165 | #endif |
| 19166 | #ifdef VK_EXT_validation_flags |
| 19167 | #endif |
| 19168 | #ifdef VK_NN_vi_surface |
| 19169 | VkResult VkEncoder::vkCreateViSurfaceNN( |
| 19170 | VkInstance instance, |
| 19171 | const VkViSurfaceCreateInfoNN* pCreateInfo, |
| 19172 | const VkAllocationCallbacks* pAllocator, |
| 19173 | VkSurfaceKHR* pSurface) |
| 19174 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 19175 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 19176 | AEMU_SCOPED_TRACE("vkCreateViSurfaceNN encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19177 | mImpl->log("start vkCreateViSurfaceNN"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19178 | auto stream = mImpl->stream(); |
| 19179 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19180 | auto resources = mImpl->resources(); |
| 19181 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19182 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19183 | VkInstance local_instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19184 | VkViSurfaceCreateInfoNN* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 19185 | VkAllocationCallbacks* local_pAllocator; |
| 19186 | local_instance = instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19187 | local_pCreateInfo = nullptr; |
| 19188 | if (pCreateInfo) |
| 19189 | { |
| 19190 | local_pCreateInfo = (VkViSurfaceCreateInfoNN*)pool->alloc(sizeof(const VkViSurfaceCreateInfoNN)); |
| 19191 | deepcopy_VkViSurfaceCreateInfoNN(pool, pCreateInfo, (VkViSurfaceCreateInfoNN*)(local_pCreateInfo)); |
| 19192 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19193 | local_pAllocator = nullptr; |
| 19194 | if (pAllocator) |
| 19195 | { |
| 19196 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 19197 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 19198 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 19199 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 19200 | if (local_pCreateInfo) |
| 19201 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 19202 | transform_tohost_VkViSurfaceCreateInfoNN(mImpl->resources(), (VkViSurfaceCreateInfoNN*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 19203 | } |
| 19204 | if (local_pAllocator) |
| 19205 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 19206 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 19207 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19208 | countingStream->rewind(); |
| 19209 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19210 | uint64_t cgen_var_1258; |
| 19211 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1258, 1); |
| 19212 | countingStream->write((uint64_t*)&cgen_var_1258, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19213 | marshal_VkViSurfaceCreateInfoNN(countingStream, (VkViSurfaceCreateInfoNN*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 19214 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19215 | uint64_t cgen_var_1259 = (uint64_t)(uintptr_t)local_pAllocator; |
| 19216 | countingStream->putBe64(cgen_var_1259); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19217 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19218 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19219 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19220 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19221 | uint64_t cgen_var_1260; |
| 19222 | countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_1260, 1); |
| 19223 | countingStream->write((uint64_t*)&cgen_var_1260, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19224 | } |
| 19225 | uint32_t packetSize_vkCreateViSurfaceNN = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 19226 | countingStream->rewind(); |
| 19227 | uint32_t opcode_vkCreateViSurfaceNN = OP_vkCreateViSurfaceNN; |
| 19228 | stream->write(&opcode_vkCreateViSurfaceNN, sizeof(uint32_t)); |
| 19229 | stream->write(&packetSize_vkCreateViSurfaceNN, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19230 | uint64_t cgen_var_1261; |
| 19231 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1261, 1); |
| 19232 | stream->write((uint64_t*)&cgen_var_1261, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19233 | marshal_VkViSurfaceCreateInfoNN(stream, (VkViSurfaceCreateInfoNN*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 19234 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19235 | uint64_t cgen_var_1262 = (uint64_t)(uintptr_t)local_pAllocator; |
| 19236 | stream->putBe64(cgen_var_1262); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19237 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19238 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19239 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19240 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19241 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19242 | uint64_t cgen_var_1263; |
| 19243 | stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_1263, 1); |
| 19244 | stream->write((uint64_t*)&cgen_var_1263, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19245 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 19246 | AEMU_SCOPED_TRACE("vkCreateViSurfaceNN readParams"); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19247 | uint64_t cgen_var_1264; |
| 19248 | stream->read((uint64_t*)&cgen_var_1264, 8); |
| 19249 | stream->handleMapping()->mapHandles_u64_VkSurfaceKHR(&cgen_var_1264, (VkSurfaceKHR*)pSurface, 1); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 19250 | AEMU_SCOPED_TRACE("vkCreateViSurfaceNN returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19251 | VkResult vkCreateViSurfaceNN_VkResult_return = (VkResult)0; |
| 19252 | stream->read(&vkCreateViSurfaceNN_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 19253 | countingStream->clearPool(); |
| 19254 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19255 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19256 | mImpl->log("finish vkCreateViSurfaceNN");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19257 | return vkCreateViSurfaceNN_VkResult_return; |
| 19258 | } |
| 19259 | |
| 19260 | #endif |
| 19261 | #ifdef VK_EXT_shader_subgroup_ballot |
| 19262 | #endif |
| 19263 | #ifdef VK_EXT_shader_subgroup_vote |
| 19264 | #endif |
| 19265 | #ifdef VK_EXT_conditional_rendering |
| 19266 | void VkEncoder::vkCmdBeginConditionalRenderingEXT( |
| 19267 | VkCommandBuffer commandBuffer, |
| 19268 | const VkConditionalRenderingBeginInfoEXT* pConditionalRenderingBegin) |
| 19269 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 19270 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 19271 | AEMU_SCOPED_TRACE("vkCmdBeginConditionalRenderingEXT encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19272 | mImpl->log("start vkCmdBeginConditionalRenderingEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19273 | auto stream = mImpl->stream(); |
| 19274 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19275 | auto resources = mImpl->resources(); |
| 19276 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19277 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19278 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19279 | VkConditionalRenderingBeginInfoEXT* local_pConditionalRenderingBegin; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 19280 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19281 | local_pConditionalRenderingBegin = nullptr; |
| 19282 | if (pConditionalRenderingBegin) |
| 19283 | { |
| 19284 | local_pConditionalRenderingBegin = (VkConditionalRenderingBeginInfoEXT*)pool->alloc(sizeof(const VkConditionalRenderingBeginInfoEXT)); |
| 19285 | deepcopy_VkConditionalRenderingBeginInfoEXT(pool, pConditionalRenderingBegin, (VkConditionalRenderingBeginInfoEXT*)(local_pConditionalRenderingBegin)); |
| 19286 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 19287 | if (local_pConditionalRenderingBegin) |
| 19288 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 19289 | transform_tohost_VkConditionalRenderingBeginInfoEXT(mImpl->resources(), (VkConditionalRenderingBeginInfoEXT*)(local_pConditionalRenderingBegin)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 19290 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19291 | countingStream->rewind(); |
| 19292 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19293 | uint64_t cgen_var_1265; |
| 19294 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1265, 1); |
| 19295 | countingStream->write((uint64_t*)&cgen_var_1265, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19296 | marshal_VkConditionalRenderingBeginInfoEXT(countingStream, (VkConditionalRenderingBeginInfoEXT*)(local_pConditionalRenderingBegin)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19297 | } |
| 19298 | uint32_t packetSize_vkCmdBeginConditionalRenderingEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 19299 | countingStream->rewind(); |
| 19300 | uint32_t opcode_vkCmdBeginConditionalRenderingEXT = OP_vkCmdBeginConditionalRenderingEXT; |
| 19301 | stream->write(&opcode_vkCmdBeginConditionalRenderingEXT, sizeof(uint32_t)); |
| 19302 | stream->write(&packetSize_vkCmdBeginConditionalRenderingEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19303 | uint64_t cgen_var_1266; |
| 19304 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1266, 1); |
| 19305 | stream->write((uint64_t*)&cgen_var_1266, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19306 | marshal_VkConditionalRenderingBeginInfoEXT(stream, (VkConditionalRenderingBeginInfoEXT*)(local_pConditionalRenderingBegin)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 19307 | AEMU_SCOPED_TRACE("vkCmdBeginConditionalRenderingEXT readParams"); |
| 19308 | AEMU_SCOPED_TRACE("vkCmdBeginConditionalRenderingEXT returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19309 | mImpl->log("finish vkCmdBeginConditionalRenderingEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19310 | } |
| 19311 | |
| 19312 | void VkEncoder::vkCmdEndConditionalRenderingEXT( |
| 19313 | VkCommandBuffer commandBuffer) |
| 19314 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 19315 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 19316 | AEMU_SCOPED_TRACE("vkCmdEndConditionalRenderingEXT encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19317 | mImpl->log("start vkCmdEndConditionalRenderingEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19318 | auto stream = mImpl->stream(); |
| 19319 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19320 | auto resources = mImpl->resources(); |
| 19321 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19322 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19323 | VkCommandBuffer local_commandBuffer; |
| 19324 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19325 | countingStream->rewind(); |
| 19326 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19327 | uint64_t cgen_var_1267; |
| 19328 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1267, 1); |
| 19329 | countingStream->write((uint64_t*)&cgen_var_1267, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19330 | } |
| 19331 | uint32_t packetSize_vkCmdEndConditionalRenderingEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 19332 | countingStream->rewind(); |
| 19333 | uint32_t opcode_vkCmdEndConditionalRenderingEXT = OP_vkCmdEndConditionalRenderingEXT; |
| 19334 | stream->write(&opcode_vkCmdEndConditionalRenderingEXT, sizeof(uint32_t)); |
| 19335 | stream->write(&packetSize_vkCmdEndConditionalRenderingEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19336 | uint64_t cgen_var_1268; |
| 19337 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1268, 1); |
| 19338 | stream->write((uint64_t*)&cgen_var_1268, 1 * 8); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 19339 | AEMU_SCOPED_TRACE("vkCmdEndConditionalRenderingEXT readParams"); |
| 19340 | AEMU_SCOPED_TRACE("vkCmdEndConditionalRenderingEXT returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19341 | mImpl->log("finish vkCmdEndConditionalRenderingEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19342 | } |
| 19343 | |
| 19344 | #endif |
| 19345 | #ifdef VK_NVX_device_generated_commands |
| 19346 | void VkEncoder::vkCmdProcessCommandsNVX( |
| 19347 | VkCommandBuffer commandBuffer, |
| 19348 | const VkCmdProcessCommandsInfoNVX* pProcessCommandsInfo) |
| 19349 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 19350 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 19351 | AEMU_SCOPED_TRACE("vkCmdProcessCommandsNVX encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19352 | mImpl->log("start vkCmdProcessCommandsNVX"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19353 | auto stream = mImpl->stream(); |
| 19354 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19355 | auto resources = mImpl->resources(); |
| 19356 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19357 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19358 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19359 | VkCmdProcessCommandsInfoNVX* local_pProcessCommandsInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 19360 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19361 | local_pProcessCommandsInfo = nullptr; |
| 19362 | if (pProcessCommandsInfo) |
| 19363 | { |
| 19364 | local_pProcessCommandsInfo = (VkCmdProcessCommandsInfoNVX*)pool->alloc(sizeof(const VkCmdProcessCommandsInfoNVX)); |
| 19365 | deepcopy_VkCmdProcessCommandsInfoNVX(pool, pProcessCommandsInfo, (VkCmdProcessCommandsInfoNVX*)(local_pProcessCommandsInfo)); |
| 19366 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 19367 | if (local_pProcessCommandsInfo) |
| 19368 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 19369 | transform_tohost_VkCmdProcessCommandsInfoNVX(mImpl->resources(), (VkCmdProcessCommandsInfoNVX*)(local_pProcessCommandsInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 19370 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19371 | countingStream->rewind(); |
| 19372 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19373 | uint64_t cgen_var_1269; |
| 19374 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1269, 1); |
| 19375 | countingStream->write((uint64_t*)&cgen_var_1269, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19376 | marshal_VkCmdProcessCommandsInfoNVX(countingStream, (VkCmdProcessCommandsInfoNVX*)(local_pProcessCommandsInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19377 | } |
| 19378 | uint32_t packetSize_vkCmdProcessCommandsNVX = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 19379 | countingStream->rewind(); |
| 19380 | uint32_t opcode_vkCmdProcessCommandsNVX = OP_vkCmdProcessCommandsNVX; |
| 19381 | stream->write(&opcode_vkCmdProcessCommandsNVX, sizeof(uint32_t)); |
| 19382 | stream->write(&packetSize_vkCmdProcessCommandsNVX, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19383 | uint64_t cgen_var_1270; |
| 19384 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1270, 1); |
| 19385 | stream->write((uint64_t*)&cgen_var_1270, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19386 | marshal_VkCmdProcessCommandsInfoNVX(stream, (VkCmdProcessCommandsInfoNVX*)(local_pProcessCommandsInfo)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 19387 | AEMU_SCOPED_TRACE("vkCmdProcessCommandsNVX readParams"); |
| 19388 | AEMU_SCOPED_TRACE("vkCmdProcessCommandsNVX returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19389 | mImpl->log("finish vkCmdProcessCommandsNVX");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19390 | } |
| 19391 | |
| 19392 | void VkEncoder::vkCmdReserveSpaceForCommandsNVX( |
| 19393 | VkCommandBuffer commandBuffer, |
| 19394 | const VkCmdReserveSpaceForCommandsInfoNVX* pReserveSpaceInfo) |
| 19395 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 19396 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 19397 | AEMU_SCOPED_TRACE("vkCmdReserveSpaceForCommandsNVX encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19398 | mImpl->log("start vkCmdReserveSpaceForCommandsNVX"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19399 | auto stream = mImpl->stream(); |
| 19400 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19401 | auto resources = mImpl->resources(); |
| 19402 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19403 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19404 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19405 | VkCmdReserveSpaceForCommandsInfoNVX* local_pReserveSpaceInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 19406 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19407 | local_pReserveSpaceInfo = nullptr; |
| 19408 | if (pReserveSpaceInfo) |
| 19409 | { |
| 19410 | local_pReserveSpaceInfo = (VkCmdReserveSpaceForCommandsInfoNVX*)pool->alloc(sizeof(const VkCmdReserveSpaceForCommandsInfoNVX)); |
| 19411 | deepcopy_VkCmdReserveSpaceForCommandsInfoNVX(pool, pReserveSpaceInfo, (VkCmdReserveSpaceForCommandsInfoNVX*)(local_pReserveSpaceInfo)); |
| 19412 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 19413 | if (local_pReserveSpaceInfo) |
| 19414 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 19415 | transform_tohost_VkCmdReserveSpaceForCommandsInfoNVX(mImpl->resources(), (VkCmdReserveSpaceForCommandsInfoNVX*)(local_pReserveSpaceInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 19416 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19417 | countingStream->rewind(); |
| 19418 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19419 | uint64_t cgen_var_1271; |
| 19420 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1271, 1); |
| 19421 | countingStream->write((uint64_t*)&cgen_var_1271, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19422 | marshal_VkCmdReserveSpaceForCommandsInfoNVX(countingStream, (VkCmdReserveSpaceForCommandsInfoNVX*)(local_pReserveSpaceInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19423 | } |
| 19424 | uint32_t packetSize_vkCmdReserveSpaceForCommandsNVX = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 19425 | countingStream->rewind(); |
| 19426 | uint32_t opcode_vkCmdReserveSpaceForCommandsNVX = OP_vkCmdReserveSpaceForCommandsNVX; |
| 19427 | stream->write(&opcode_vkCmdReserveSpaceForCommandsNVX, sizeof(uint32_t)); |
| 19428 | stream->write(&packetSize_vkCmdReserveSpaceForCommandsNVX, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19429 | uint64_t cgen_var_1272; |
| 19430 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1272, 1); |
| 19431 | stream->write((uint64_t*)&cgen_var_1272, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19432 | marshal_VkCmdReserveSpaceForCommandsInfoNVX(stream, (VkCmdReserveSpaceForCommandsInfoNVX*)(local_pReserveSpaceInfo)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 19433 | AEMU_SCOPED_TRACE("vkCmdReserveSpaceForCommandsNVX readParams"); |
| 19434 | AEMU_SCOPED_TRACE("vkCmdReserveSpaceForCommandsNVX returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19435 | mImpl->log("finish vkCmdReserveSpaceForCommandsNVX");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19436 | } |
| 19437 | |
| 19438 | VkResult VkEncoder::vkCreateIndirectCommandsLayoutNVX( |
| 19439 | VkDevice device, |
| 19440 | const VkIndirectCommandsLayoutCreateInfoNVX* pCreateInfo, |
| 19441 | const VkAllocationCallbacks* pAllocator, |
| 19442 | VkIndirectCommandsLayoutNVX* pIndirectCommandsLayout) |
| 19443 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 19444 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 19445 | AEMU_SCOPED_TRACE("vkCreateIndirectCommandsLayoutNVX encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19446 | mImpl->log("start vkCreateIndirectCommandsLayoutNVX"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19447 | auto stream = mImpl->stream(); |
| 19448 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19449 | auto resources = mImpl->resources(); |
| 19450 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19451 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19452 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19453 | VkIndirectCommandsLayoutCreateInfoNVX* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 19454 | VkAllocationCallbacks* local_pAllocator; |
| 19455 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19456 | local_pCreateInfo = nullptr; |
| 19457 | if (pCreateInfo) |
| 19458 | { |
| 19459 | local_pCreateInfo = (VkIndirectCommandsLayoutCreateInfoNVX*)pool->alloc(sizeof(const VkIndirectCommandsLayoutCreateInfoNVX)); |
| 19460 | deepcopy_VkIndirectCommandsLayoutCreateInfoNVX(pool, pCreateInfo, (VkIndirectCommandsLayoutCreateInfoNVX*)(local_pCreateInfo)); |
| 19461 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19462 | local_pAllocator = nullptr; |
| 19463 | if (pAllocator) |
| 19464 | { |
| 19465 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 19466 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 19467 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 19468 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 19469 | if (local_pCreateInfo) |
| 19470 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 19471 | transform_tohost_VkIndirectCommandsLayoutCreateInfoNVX(mImpl->resources(), (VkIndirectCommandsLayoutCreateInfoNVX*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 19472 | } |
| 19473 | if (local_pAllocator) |
| 19474 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 19475 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 19476 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19477 | countingStream->rewind(); |
| 19478 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19479 | uint64_t cgen_var_1273; |
| 19480 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1273, 1); |
| 19481 | countingStream->write((uint64_t*)&cgen_var_1273, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19482 | marshal_VkIndirectCommandsLayoutCreateInfoNVX(countingStream, (VkIndirectCommandsLayoutCreateInfoNVX*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 19483 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19484 | uint64_t cgen_var_1274 = (uint64_t)(uintptr_t)local_pAllocator; |
| 19485 | countingStream->putBe64(cgen_var_1274); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19486 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19487 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19488 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19489 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19490 | uint64_t cgen_var_1275; |
| 19491 | countingStream->handleMapping()->mapHandles_VkIndirectCommandsLayoutNVX_u64(pIndirectCommandsLayout, &cgen_var_1275, 1); |
| 19492 | countingStream->write((uint64_t*)&cgen_var_1275, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19493 | } |
| 19494 | uint32_t packetSize_vkCreateIndirectCommandsLayoutNVX = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 19495 | countingStream->rewind(); |
| 19496 | uint32_t opcode_vkCreateIndirectCommandsLayoutNVX = OP_vkCreateIndirectCommandsLayoutNVX; |
| 19497 | stream->write(&opcode_vkCreateIndirectCommandsLayoutNVX, sizeof(uint32_t)); |
| 19498 | stream->write(&packetSize_vkCreateIndirectCommandsLayoutNVX, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19499 | uint64_t cgen_var_1276; |
| 19500 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1276, 1); |
| 19501 | stream->write((uint64_t*)&cgen_var_1276, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19502 | marshal_VkIndirectCommandsLayoutCreateInfoNVX(stream, (VkIndirectCommandsLayoutCreateInfoNVX*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 19503 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19504 | uint64_t cgen_var_1277 = (uint64_t)(uintptr_t)local_pAllocator; |
| 19505 | stream->putBe64(cgen_var_1277); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19506 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19507 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19508 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19509 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19510 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19511 | uint64_t cgen_var_1278; |
| 19512 | stream->handleMapping()->mapHandles_VkIndirectCommandsLayoutNVX_u64(pIndirectCommandsLayout, &cgen_var_1278, 1); |
| 19513 | stream->write((uint64_t*)&cgen_var_1278, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19514 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 19515 | AEMU_SCOPED_TRACE("vkCreateIndirectCommandsLayoutNVX readParams"); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19516 | stream->setHandleMapping(resources->createMapping()); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19517 | uint64_t cgen_var_1279; |
| 19518 | stream->read((uint64_t*)&cgen_var_1279, 8); |
| 19519 | stream->handleMapping()->mapHandles_u64_VkIndirectCommandsLayoutNVX(&cgen_var_1279, (VkIndirectCommandsLayoutNVX*)pIndirectCommandsLayout, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19520 | stream->unsetHandleMapping(); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 19521 | AEMU_SCOPED_TRACE("vkCreateIndirectCommandsLayoutNVX returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19522 | VkResult vkCreateIndirectCommandsLayoutNVX_VkResult_return = (VkResult)0; |
| 19523 | stream->read(&vkCreateIndirectCommandsLayoutNVX_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 19524 | countingStream->clearPool(); |
| 19525 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19526 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19527 | mImpl->log("finish vkCreateIndirectCommandsLayoutNVX");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19528 | return vkCreateIndirectCommandsLayoutNVX_VkResult_return; |
| 19529 | } |
| 19530 | |
| 19531 | void VkEncoder::vkDestroyIndirectCommandsLayoutNVX( |
| 19532 | VkDevice device, |
| 19533 | VkIndirectCommandsLayoutNVX indirectCommandsLayout, |
| 19534 | const VkAllocationCallbacks* pAllocator) |
| 19535 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 19536 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 19537 | AEMU_SCOPED_TRACE("vkDestroyIndirectCommandsLayoutNVX encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19538 | mImpl->log("start vkDestroyIndirectCommandsLayoutNVX"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19539 | auto stream = mImpl->stream(); |
| 19540 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19541 | auto resources = mImpl->resources(); |
| 19542 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19543 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19544 | VkDevice local_device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 19545 | VkIndirectCommandsLayoutNVX local_indirectCommandsLayout; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19546 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 19547 | local_device = device; |
| 19548 | local_indirectCommandsLayout = indirectCommandsLayout; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19549 | local_pAllocator = nullptr; |
| 19550 | if (pAllocator) |
| 19551 | { |
| 19552 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 19553 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 19554 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 19555 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 19556 | if (local_pAllocator) |
| 19557 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 19558 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 19559 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19560 | countingStream->rewind(); |
| 19561 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19562 | uint64_t cgen_var_1280; |
| 19563 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1280, 1); |
| 19564 | countingStream->write((uint64_t*)&cgen_var_1280, 1 * 8); |
| 19565 | uint64_t cgen_var_1281; |
| 19566 | countingStream->handleMapping()->mapHandles_VkIndirectCommandsLayoutNVX_u64(&local_indirectCommandsLayout, &cgen_var_1281, 1); |
| 19567 | countingStream->write((uint64_t*)&cgen_var_1281, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 19568 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19569 | uint64_t cgen_var_1282 = (uint64_t)(uintptr_t)local_pAllocator; |
| 19570 | countingStream->putBe64(cgen_var_1282); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19571 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19572 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19573 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19574 | } |
| 19575 | } |
| 19576 | uint32_t packetSize_vkDestroyIndirectCommandsLayoutNVX = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 19577 | countingStream->rewind(); |
| 19578 | uint32_t opcode_vkDestroyIndirectCommandsLayoutNVX = OP_vkDestroyIndirectCommandsLayoutNVX; |
| 19579 | stream->write(&opcode_vkDestroyIndirectCommandsLayoutNVX, sizeof(uint32_t)); |
| 19580 | stream->write(&packetSize_vkDestroyIndirectCommandsLayoutNVX, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19581 | uint64_t cgen_var_1283; |
| 19582 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1283, 1); |
| 19583 | stream->write((uint64_t*)&cgen_var_1283, 1 * 8); |
| 19584 | uint64_t cgen_var_1284; |
| 19585 | stream->handleMapping()->mapHandles_VkIndirectCommandsLayoutNVX_u64(&local_indirectCommandsLayout, &cgen_var_1284, 1); |
| 19586 | stream->write((uint64_t*)&cgen_var_1284, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 19587 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19588 | uint64_t cgen_var_1285 = (uint64_t)(uintptr_t)local_pAllocator; |
| 19589 | stream->putBe64(cgen_var_1285); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19590 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19591 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19592 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19593 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 19594 | AEMU_SCOPED_TRACE("vkDestroyIndirectCommandsLayoutNVX readParams"); |
| 19595 | AEMU_SCOPED_TRACE("vkDestroyIndirectCommandsLayoutNVX returnUnmarshal"); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19596 | resources->destroyMapping()->mapHandles_VkIndirectCommandsLayoutNVX((VkIndirectCommandsLayoutNVX*)&indirectCommandsLayout); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19597 | mImpl->log("finish vkDestroyIndirectCommandsLayoutNVX");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19598 | } |
| 19599 | |
| 19600 | VkResult VkEncoder::vkCreateObjectTableNVX( |
| 19601 | VkDevice device, |
| 19602 | const VkObjectTableCreateInfoNVX* pCreateInfo, |
| 19603 | const VkAllocationCallbacks* pAllocator, |
| 19604 | VkObjectTableNVX* pObjectTable) |
| 19605 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 19606 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 19607 | AEMU_SCOPED_TRACE("vkCreateObjectTableNVX encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19608 | mImpl->log("start vkCreateObjectTableNVX"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19609 | auto stream = mImpl->stream(); |
| 19610 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19611 | auto resources = mImpl->resources(); |
| 19612 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19613 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19614 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19615 | VkObjectTableCreateInfoNVX* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 19616 | VkAllocationCallbacks* local_pAllocator; |
| 19617 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19618 | local_pCreateInfo = nullptr; |
| 19619 | if (pCreateInfo) |
| 19620 | { |
| 19621 | local_pCreateInfo = (VkObjectTableCreateInfoNVX*)pool->alloc(sizeof(const VkObjectTableCreateInfoNVX)); |
| 19622 | deepcopy_VkObjectTableCreateInfoNVX(pool, pCreateInfo, (VkObjectTableCreateInfoNVX*)(local_pCreateInfo)); |
| 19623 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19624 | local_pAllocator = nullptr; |
| 19625 | if (pAllocator) |
| 19626 | { |
| 19627 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 19628 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 19629 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 19630 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 19631 | if (local_pCreateInfo) |
| 19632 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 19633 | transform_tohost_VkObjectTableCreateInfoNVX(mImpl->resources(), (VkObjectTableCreateInfoNVX*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 19634 | } |
| 19635 | if (local_pAllocator) |
| 19636 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 19637 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 19638 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19639 | countingStream->rewind(); |
| 19640 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19641 | uint64_t cgen_var_1286; |
| 19642 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1286, 1); |
| 19643 | countingStream->write((uint64_t*)&cgen_var_1286, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19644 | marshal_VkObjectTableCreateInfoNVX(countingStream, (VkObjectTableCreateInfoNVX*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 19645 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19646 | uint64_t cgen_var_1287 = (uint64_t)(uintptr_t)local_pAllocator; |
| 19647 | countingStream->putBe64(cgen_var_1287); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19648 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19649 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19650 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19651 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19652 | uint64_t cgen_var_1288; |
| 19653 | countingStream->handleMapping()->mapHandles_VkObjectTableNVX_u64(pObjectTable, &cgen_var_1288, 1); |
| 19654 | countingStream->write((uint64_t*)&cgen_var_1288, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19655 | } |
| 19656 | uint32_t packetSize_vkCreateObjectTableNVX = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 19657 | countingStream->rewind(); |
| 19658 | uint32_t opcode_vkCreateObjectTableNVX = OP_vkCreateObjectTableNVX; |
| 19659 | stream->write(&opcode_vkCreateObjectTableNVX, sizeof(uint32_t)); |
| 19660 | stream->write(&packetSize_vkCreateObjectTableNVX, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19661 | uint64_t cgen_var_1289; |
| 19662 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1289, 1); |
| 19663 | stream->write((uint64_t*)&cgen_var_1289, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19664 | marshal_VkObjectTableCreateInfoNVX(stream, (VkObjectTableCreateInfoNVX*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 19665 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19666 | uint64_t cgen_var_1290 = (uint64_t)(uintptr_t)local_pAllocator; |
| 19667 | stream->putBe64(cgen_var_1290); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19668 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19669 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19670 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19671 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19672 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19673 | uint64_t cgen_var_1291; |
| 19674 | stream->handleMapping()->mapHandles_VkObjectTableNVX_u64(pObjectTable, &cgen_var_1291, 1); |
| 19675 | stream->write((uint64_t*)&cgen_var_1291, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19676 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 19677 | AEMU_SCOPED_TRACE("vkCreateObjectTableNVX readParams"); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19678 | stream->setHandleMapping(resources->createMapping()); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19679 | uint64_t cgen_var_1292; |
| 19680 | stream->read((uint64_t*)&cgen_var_1292, 8); |
| 19681 | stream->handleMapping()->mapHandles_u64_VkObjectTableNVX(&cgen_var_1292, (VkObjectTableNVX*)pObjectTable, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19682 | stream->unsetHandleMapping(); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 19683 | AEMU_SCOPED_TRACE("vkCreateObjectTableNVX returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19684 | VkResult vkCreateObjectTableNVX_VkResult_return = (VkResult)0; |
| 19685 | stream->read(&vkCreateObjectTableNVX_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 19686 | countingStream->clearPool(); |
| 19687 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19688 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19689 | mImpl->log("finish vkCreateObjectTableNVX");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19690 | return vkCreateObjectTableNVX_VkResult_return; |
| 19691 | } |
| 19692 | |
| 19693 | void VkEncoder::vkDestroyObjectTableNVX( |
| 19694 | VkDevice device, |
| 19695 | VkObjectTableNVX objectTable, |
| 19696 | const VkAllocationCallbacks* pAllocator) |
| 19697 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 19698 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 19699 | AEMU_SCOPED_TRACE("vkDestroyObjectTableNVX encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19700 | mImpl->log("start vkDestroyObjectTableNVX"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19701 | auto stream = mImpl->stream(); |
| 19702 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19703 | auto resources = mImpl->resources(); |
| 19704 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19705 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19706 | VkDevice local_device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 19707 | VkObjectTableNVX local_objectTable; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19708 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 19709 | local_device = device; |
| 19710 | local_objectTable = objectTable; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19711 | local_pAllocator = nullptr; |
| 19712 | if (pAllocator) |
| 19713 | { |
| 19714 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 19715 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 19716 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 19717 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 19718 | if (local_pAllocator) |
| 19719 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 19720 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 19721 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19722 | countingStream->rewind(); |
| 19723 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19724 | uint64_t cgen_var_1293; |
| 19725 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1293, 1); |
| 19726 | countingStream->write((uint64_t*)&cgen_var_1293, 1 * 8); |
| 19727 | uint64_t cgen_var_1294; |
| 19728 | countingStream->handleMapping()->mapHandles_VkObjectTableNVX_u64(&local_objectTable, &cgen_var_1294, 1); |
| 19729 | countingStream->write((uint64_t*)&cgen_var_1294, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 19730 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19731 | uint64_t cgen_var_1295 = (uint64_t)(uintptr_t)local_pAllocator; |
| 19732 | countingStream->putBe64(cgen_var_1295); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19733 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19734 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19735 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19736 | } |
| 19737 | } |
| 19738 | uint32_t packetSize_vkDestroyObjectTableNVX = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 19739 | countingStream->rewind(); |
| 19740 | uint32_t opcode_vkDestroyObjectTableNVX = OP_vkDestroyObjectTableNVX; |
| 19741 | stream->write(&opcode_vkDestroyObjectTableNVX, sizeof(uint32_t)); |
| 19742 | stream->write(&packetSize_vkDestroyObjectTableNVX, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19743 | uint64_t cgen_var_1296; |
| 19744 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1296, 1); |
| 19745 | stream->write((uint64_t*)&cgen_var_1296, 1 * 8); |
| 19746 | uint64_t cgen_var_1297; |
| 19747 | stream->handleMapping()->mapHandles_VkObjectTableNVX_u64(&local_objectTable, &cgen_var_1297, 1); |
| 19748 | stream->write((uint64_t*)&cgen_var_1297, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 19749 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19750 | uint64_t cgen_var_1298 = (uint64_t)(uintptr_t)local_pAllocator; |
| 19751 | stream->putBe64(cgen_var_1298); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19752 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19753 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19754 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19755 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 19756 | AEMU_SCOPED_TRACE("vkDestroyObjectTableNVX readParams"); |
| 19757 | AEMU_SCOPED_TRACE("vkDestroyObjectTableNVX returnUnmarshal"); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19758 | resources->destroyMapping()->mapHandles_VkObjectTableNVX((VkObjectTableNVX*)&objectTable); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19759 | mImpl->log("finish vkDestroyObjectTableNVX");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19760 | } |
| 19761 | |
| 19762 | VkResult VkEncoder::vkRegisterObjectsNVX( |
| 19763 | VkDevice device, |
| 19764 | VkObjectTableNVX objectTable, |
| 19765 | uint32_t objectCount, |
| 19766 | const VkObjectTableEntryNVX* const* ppObjectTableEntries, |
| 19767 | const uint32_t* pObjectIndices) |
| 19768 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 19769 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 19770 | AEMU_SCOPED_TRACE("vkRegisterObjectsNVX encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19771 | mImpl->log("start vkRegisterObjectsNVX"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19772 | auto stream = mImpl->stream(); |
| 19773 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19774 | auto resources = mImpl->resources(); |
| 19775 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19776 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19777 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19778 | VkObjectTableNVX local_objectTable; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19779 | uint32_t local_objectCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19780 | VkObjectTableEntryNVX** local_ppObjectTableEntries; |
| 19781 | uint32_t* local_pObjectIndices; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 19782 | local_device = device; |
| 19783 | local_objectTable = objectTable; |
| 19784 | local_objectCount = objectCount; |
| 19785 | (void)ppObjectTableEntries; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19786 | local_pObjectIndices = nullptr; |
| 19787 | if (pObjectIndices) |
| 19788 | { |
| 19789 | local_pObjectIndices = (uint32_t*)pool->dupArray(pObjectIndices, ((objectCount)) * sizeof(const uint32_t)); |
| 19790 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 19791 | (void)local_ppObjectTableEntries; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19792 | countingStream->rewind(); |
| 19793 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19794 | uint64_t cgen_var_1299; |
| 19795 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1299, 1); |
| 19796 | countingStream->write((uint64_t*)&cgen_var_1299, 1 * 8); |
| 19797 | uint64_t cgen_var_1300; |
| 19798 | countingStream->handleMapping()->mapHandles_VkObjectTableNVX_u64(&local_objectTable, &cgen_var_1300, 1); |
| 19799 | countingStream->write((uint64_t*)&cgen_var_1300, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19800 | countingStream->write((uint32_t*)&local_objectCount, sizeof(uint32_t)); |
| Lingfeng Yang | 36891c5 | 2018-11-09 14:18:35 -0800 | [diff] [blame] | 19801 | (void)local_ppObjectTableEntries; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19802 | countingStream->write((uint32_t*)local_pObjectIndices, ((objectCount)) * sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19803 | } |
| 19804 | uint32_t packetSize_vkRegisterObjectsNVX = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 19805 | countingStream->rewind(); |
| 19806 | uint32_t opcode_vkRegisterObjectsNVX = OP_vkRegisterObjectsNVX; |
| 19807 | stream->write(&opcode_vkRegisterObjectsNVX, sizeof(uint32_t)); |
| 19808 | stream->write(&packetSize_vkRegisterObjectsNVX, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19809 | uint64_t cgen_var_1301; |
| 19810 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1301, 1); |
| 19811 | stream->write((uint64_t*)&cgen_var_1301, 1 * 8); |
| 19812 | uint64_t cgen_var_1302; |
| 19813 | stream->handleMapping()->mapHandles_VkObjectTableNVX_u64(&local_objectTable, &cgen_var_1302, 1); |
| 19814 | stream->write((uint64_t*)&cgen_var_1302, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19815 | stream->write((uint32_t*)&local_objectCount, sizeof(uint32_t)); |
| Lingfeng Yang | 36891c5 | 2018-11-09 14:18:35 -0800 | [diff] [blame] | 19816 | (void)local_ppObjectTableEntries; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19817 | stream->write((uint32_t*)local_pObjectIndices, ((objectCount)) * sizeof(uint32_t)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 19818 | AEMU_SCOPED_TRACE("vkRegisterObjectsNVX readParams"); |
| 19819 | AEMU_SCOPED_TRACE("vkRegisterObjectsNVX returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19820 | VkResult vkRegisterObjectsNVX_VkResult_return = (VkResult)0; |
| 19821 | stream->read(&vkRegisterObjectsNVX_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 19822 | countingStream->clearPool(); |
| 19823 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19824 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19825 | mImpl->log("finish vkRegisterObjectsNVX");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19826 | return vkRegisterObjectsNVX_VkResult_return; |
| 19827 | } |
| 19828 | |
| 19829 | VkResult VkEncoder::vkUnregisterObjectsNVX( |
| 19830 | VkDevice device, |
| 19831 | VkObjectTableNVX objectTable, |
| 19832 | uint32_t objectCount, |
| 19833 | const VkObjectEntryTypeNVX* pObjectEntryTypes, |
| 19834 | const uint32_t* pObjectIndices) |
| 19835 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 19836 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 19837 | AEMU_SCOPED_TRACE("vkUnregisterObjectsNVX encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19838 | mImpl->log("start vkUnregisterObjectsNVX"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19839 | auto stream = mImpl->stream(); |
| 19840 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19841 | auto resources = mImpl->resources(); |
| 19842 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19843 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19844 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19845 | VkObjectTableNVX local_objectTable; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19846 | uint32_t local_objectCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19847 | VkObjectEntryTypeNVX* local_pObjectEntryTypes; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 19848 | uint32_t* local_pObjectIndices; |
| 19849 | local_device = device; |
| 19850 | local_objectTable = objectTable; |
| 19851 | local_objectCount = objectCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19852 | local_pObjectEntryTypes = nullptr; |
| 19853 | if (pObjectEntryTypes) |
| 19854 | { |
| 19855 | local_pObjectEntryTypes = (VkObjectEntryTypeNVX*)pool->dupArray(pObjectEntryTypes, ((objectCount)) * sizeof(const VkObjectEntryTypeNVX)); |
| 19856 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19857 | local_pObjectIndices = nullptr; |
| 19858 | if (pObjectIndices) |
| 19859 | { |
| 19860 | local_pObjectIndices = (uint32_t*)pool->dupArray(pObjectIndices, ((objectCount)) * sizeof(const uint32_t)); |
| 19861 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19862 | countingStream->rewind(); |
| 19863 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19864 | uint64_t cgen_var_1303; |
| 19865 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1303, 1); |
| 19866 | countingStream->write((uint64_t*)&cgen_var_1303, 1 * 8); |
| 19867 | uint64_t cgen_var_1304; |
| 19868 | countingStream->handleMapping()->mapHandles_VkObjectTableNVX_u64(&local_objectTable, &cgen_var_1304, 1); |
| 19869 | countingStream->write((uint64_t*)&cgen_var_1304, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19870 | countingStream->write((uint32_t*)&local_objectCount, sizeof(uint32_t)); |
| 19871 | countingStream->write((VkObjectEntryTypeNVX*)local_pObjectEntryTypes, ((objectCount)) * sizeof(VkObjectEntryTypeNVX)); |
| 19872 | countingStream->write((uint32_t*)local_pObjectIndices, ((objectCount)) * sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19873 | } |
| 19874 | uint32_t packetSize_vkUnregisterObjectsNVX = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 19875 | countingStream->rewind(); |
| 19876 | uint32_t opcode_vkUnregisterObjectsNVX = OP_vkUnregisterObjectsNVX; |
| 19877 | stream->write(&opcode_vkUnregisterObjectsNVX, sizeof(uint32_t)); |
| 19878 | stream->write(&packetSize_vkUnregisterObjectsNVX, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19879 | uint64_t cgen_var_1305; |
| 19880 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1305, 1); |
| 19881 | stream->write((uint64_t*)&cgen_var_1305, 1 * 8); |
| 19882 | uint64_t cgen_var_1306; |
| 19883 | stream->handleMapping()->mapHandles_VkObjectTableNVX_u64(&local_objectTable, &cgen_var_1306, 1); |
| 19884 | stream->write((uint64_t*)&cgen_var_1306, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19885 | stream->write((uint32_t*)&local_objectCount, sizeof(uint32_t)); |
| 19886 | stream->write((VkObjectEntryTypeNVX*)local_pObjectEntryTypes, ((objectCount)) * sizeof(VkObjectEntryTypeNVX)); |
| 19887 | stream->write((uint32_t*)local_pObjectIndices, ((objectCount)) * sizeof(uint32_t)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 19888 | AEMU_SCOPED_TRACE("vkUnregisterObjectsNVX readParams"); |
| 19889 | AEMU_SCOPED_TRACE("vkUnregisterObjectsNVX returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19890 | VkResult vkUnregisterObjectsNVX_VkResult_return = (VkResult)0; |
| 19891 | stream->read(&vkUnregisterObjectsNVX_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 19892 | countingStream->clearPool(); |
| 19893 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19894 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19895 | mImpl->log("finish vkUnregisterObjectsNVX");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19896 | return vkUnregisterObjectsNVX_VkResult_return; |
| 19897 | } |
| 19898 | |
| 19899 | void VkEncoder::vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX( |
| 19900 | VkPhysicalDevice physicalDevice, |
| 19901 | VkDeviceGeneratedCommandsFeaturesNVX* pFeatures, |
| 19902 | VkDeviceGeneratedCommandsLimitsNVX* pLimits) |
| 19903 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 19904 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 19905 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19906 | mImpl->log("start vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19907 | auto stream = mImpl->stream(); |
| 19908 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19909 | auto resources = mImpl->resources(); |
| 19910 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19911 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19912 | VkPhysicalDevice local_physicalDevice; |
| 19913 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19914 | countingStream->rewind(); |
| 19915 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19916 | uint64_t cgen_var_1307; |
| 19917 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1307, 1); |
| 19918 | countingStream->write((uint64_t*)&cgen_var_1307, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19919 | marshal_VkDeviceGeneratedCommandsFeaturesNVX(countingStream, (VkDeviceGeneratedCommandsFeaturesNVX*)(pFeatures)); |
| 19920 | marshal_VkDeviceGeneratedCommandsLimitsNVX(countingStream, (VkDeviceGeneratedCommandsLimitsNVX*)(pLimits)); |
| 19921 | } |
| 19922 | uint32_t packetSize_vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 19923 | countingStream->rewind(); |
| 19924 | uint32_t opcode_vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX = OP_vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX; |
| 19925 | stream->write(&opcode_vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX, sizeof(uint32_t)); |
| 19926 | stream->write(&packetSize_vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19927 | uint64_t cgen_var_1308; |
| 19928 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1308, 1); |
| 19929 | stream->write((uint64_t*)&cgen_var_1308, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19930 | marshal_VkDeviceGeneratedCommandsFeaturesNVX(stream, (VkDeviceGeneratedCommandsFeaturesNVX*)(pFeatures)); |
| 19931 | marshal_VkDeviceGeneratedCommandsLimitsNVX(stream, (VkDeviceGeneratedCommandsLimitsNVX*)(pLimits)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 19932 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19933 | unmarshal_VkDeviceGeneratedCommandsFeaturesNVX(stream, (VkDeviceGeneratedCommandsFeaturesNVX*)(pFeatures)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 19934 | if (pFeatures) |
| 19935 | { |
| 19936 | transform_fromhost_VkDeviceGeneratedCommandsFeaturesNVX(mImpl->resources(), (VkDeviceGeneratedCommandsFeaturesNVX*)(pFeatures)); |
| 19937 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19938 | unmarshal_VkDeviceGeneratedCommandsLimitsNVX(stream, (VkDeviceGeneratedCommandsLimitsNVX*)(pLimits)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 19939 | if (pLimits) |
| 19940 | { |
| 19941 | transform_fromhost_VkDeviceGeneratedCommandsLimitsNVX(mImpl->resources(), (VkDeviceGeneratedCommandsLimitsNVX*)(pLimits)); |
| 19942 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 19943 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19944 | mImpl->log("finish vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19945 | } |
| 19946 | |
| 19947 | #endif |
| 19948 | #ifdef VK_NV_clip_space_w_scaling |
| 19949 | void VkEncoder::vkCmdSetViewportWScalingNV( |
| 19950 | VkCommandBuffer commandBuffer, |
| 19951 | uint32_t firstViewport, |
| 19952 | uint32_t viewportCount, |
| 19953 | const VkViewportWScalingNV* pViewportWScalings) |
| 19954 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 19955 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 19956 | AEMU_SCOPED_TRACE("vkCmdSetViewportWScalingNV encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19957 | mImpl->log("start vkCmdSetViewportWScalingNV"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19958 | auto stream = mImpl->stream(); |
| 19959 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19960 | auto resources = mImpl->resources(); |
| 19961 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19962 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19963 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19964 | uint32_t local_firstViewport; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19965 | uint32_t local_viewportCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19966 | VkViewportWScalingNV* local_pViewportWScalings; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 19967 | local_commandBuffer = commandBuffer; |
| 19968 | local_firstViewport = firstViewport; |
| 19969 | local_viewportCount = viewportCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19970 | local_pViewportWScalings = nullptr; |
| 19971 | if (pViewportWScalings) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19972 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19973 | local_pViewportWScalings = (VkViewportWScalingNV*)pool->alloc(((viewportCount)) * sizeof(const VkViewportWScalingNV)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19974 | for (uint32_t i = 0; i < (uint32_t)((viewportCount)); ++i) |
| 19975 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19976 | deepcopy_VkViewportWScalingNV(pool, pViewportWScalings + i, (VkViewportWScalingNV*)(local_pViewportWScalings + i)); |
| 19977 | } |
| 19978 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 19979 | if (local_pViewportWScalings) |
| 19980 | { |
| 19981 | for (uint32_t i = 0; i < (uint32_t)((viewportCount)); ++i) |
| 19982 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 19983 | transform_tohost_VkViewportWScalingNV(mImpl->resources(), (VkViewportWScalingNV*)(local_pViewportWScalings + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 19984 | } |
| 19985 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19986 | countingStream->rewind(); |
| 19987 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19988 | uint64_t cgen_var_1309; |
| 19989 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1309, 1); |
| 19990 | countingStream->write((uint64_t*)&cgen_var_1309, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19991 | countingStream->write((uint32_t*)&local_firstViewport, sizeof(uint32_t)); |
| 19992 | countingStream->write((uint32_t*)&local_viewportCount, sizeof(uint32_t)); |
| 19993 | for (uint32_t i = 0; i < (uint32_t)((viewportCount)); ++i) |
| 19994 | { |
| 19995 | marshal_VkViewportWScalingNV(countingStream, (VkViewportWScalingNV*)(local_pViewportWScalings + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19996 | } |
| 19997 | } |
| 19998 | uint32_t packetSize_vkCmdSetViewportWScalingNV = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 19999 | countingStream->rewind(); |
| 20000 | uint32_t opcode_vkCmdSetViewportWScalingNV = OP_vkCmdSetViewportWScalingNV; |
| 20001 | stream->write(&opcode_vkCmdSetViewportWScalingNV, sizeof(uint32_t)); |
| 20002 | stream->write(&packetSize_vkCmdSetViewportWScalingNV, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20003 | uint64_t cgen_var_1310; |
| 20004 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1310, 1); |
| 20005 | stream->write((uint64_t*)&cgen_var_1310, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20006 | stream->write((uint32_t*)&local_firstViewport, sizeof(uint32_t)); |
| 20007 | stream->write((uint32_t*)&local_viewportCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20008 | for (uint32_t i = 0; i < (uint32_t)((viewportCount)); ++i) |
| 20009 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20010 | marshal_VkViewportWScalingNV(stream, (VkViewportWScalingNV*)(local_pViewportWScalings + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20011 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 20012 | AEMU_SCOPED_TRACE("vkCmdSetViewportWScalingNV readParams"); |
| 20013 | AEMU_SCOPED_TRACE("vkCmdSetViewportWScalingNV returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20014 | mImpl->log("finish vkCmdSetViewportWScalingNV");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20015 | } |
| 20016 | |
| 20017 | #endif |
| 20018 | #ifdef VK_EXT_direct_mode_display |
| 20019 | VkResult VkEncoder::vkReleaseDisplayEXT( |
| 20020 | VkPhysicalDevice physicalDevice, |
| 20021 | VkDisplayKHR display) |
| 20022 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 20023 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 20024 | AEMU_SCOPED_TRACE("vkReleaseDisplayEXT encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20025 | mImpl->log("start vkReleaseDisplayEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20026 | auto stream = mImpl->stream(); |
| 20027 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20028 | auto resources = mImpl->resources(); |
| 20029 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20030 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20031 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20032 | VkDisplayKHR local_display; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 20033 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20034 | local_display = display; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20035 | countingStream->rewind(); |
| 20036 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20037 | uint64_t cgen_var_1311; |
| 20038 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1311, 1); |
| 20039 | countingStream->write((uint64_t*)&cgen_var_1311, 1 * 8); |
| 20040 | uint64_t cgen_var_1312; |
| 20041 | countingStream->handleMapping()->mapHandles_VkDisplayKHR_u64(&local_display, &cgen_var_1312, 1); |
| 20042 | countingStream->write((uint64_t*)&cgen_var_1312, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20043 | } |
| 20044 | uint32_t packetSize_vkReleaseDisplayEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 20045 | countingStream->rewind(); |
| 20046 | uint32_t opcode_vkReleaseDisplayEXT = OP_vkReleaseDisplayEXT; |
| 20047 | stream->write(&opcode_vkReleaseDisplayEXT, sizeof(uint32_t)); |
| 20048 | stream->write(&packetSize_vkReleaseDisplayEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20049 | uint64_t cgen_var_1313; |
| 20050 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1313, 1); |
| 20051 | stream->write((uint64_t*)&cgen_var_1313, 1 * 8); |
| 20052 | uint64_t cgen_var_1314; |
| 20053 | stream->handleMapping()->mapHandles_VkDisplayKHR_u64(&local_display, &cgen_var_1314, 1); |
| 20054 | stream->write((uint64_t*)&cgen_var_1314, 1 * 8); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 20055 | AEMU_SCOPED_TRACE("vkReleaseDisplayEXT readParams"); |
| 20056 | AEMU_SCOPED_TRACE("vkReleaseDisplayEXT returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20057 | VkResult vkReleaseDisplayEXT_VkResult_return = (VkResult)0; |
| 20058 | stream->read(&vkReleaseDisplayEXT_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 20059 | countingStream->clearPool(); |
| 20060 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20061 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20062 | mImpl->log("finish vkReleaseDisplayEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20063 | return vkReleaseDisplayEXT_VkResult_return; |
| 20064 | } |
| 20065 | |
| 20066 | #endif |
| 20067 | #ifdef VK_EXT_acquire_xlib_display |
| 20068 | VkResult VkEncoder::vkAcquireXlibDisplayEXT( |
| 20069 | VkPhysicalDevice physicalDevice, |
| 20070 | Display* dpy, |
| 20071 | VkDisplayKHR display) |
| 20072 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 20073 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 20074 | AEMU_SCOPED_TRACE("vkAcquireXlibDisplayEXT encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20075 | mImpl->log("start vkAcquireXlibDisplayEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20076 | auto stream = mImpl->stream(); |
| 20077 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20078 | auto resources = mImpl->resources(); |
| 20079 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20080 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20081 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20082 | VkDisplayKHR local_display; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 20083 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20084 | local_display = display; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20085 | countingStream->rewind(); |
| 20086 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20087 | uint64_t cgen_var_1315; |
| 20088 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1315, 1); |
| 20089 | countingStream->write((uint64_t*)&cgen_var_1315, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20090 | countingStream->write((Display*)dpy, sizeof(Display)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20091 | uint64_t cgen_var_1316; |
| 20092 | countingStream->handleMapping()->mapHandles_VkDisplayKHR_u64(&local_display, &cgen_var_1316, 1); |
| 20093 | countingStream->write((uint64_t*)&cgen_var_1316, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20094 | } |
| 20095 | uint32_t packetSize_vkAcquireXlibDisplayEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 20096 | countingStream->rewind(); |
| 20097 | uint32_t opcode_vkAcquireXlibDisplayEXT = OP_vkAcquireXlibDisplayEXT; |
| 20098 | stream->write(&opcode_vkAcquireXlibDisplayEXT, sizeof(uint32_t)); |
| 20099 | stream->write(&packetSize_vkAcquireXlibDisplayEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20100 | uint64_t cgen_var_1317; |
| 20101 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1317, 1); |
| 20102 | stream->write((uint64_t*)&cgen_var_1317, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20103 | stream->write((Display*)dpy, sizeof(Display)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20104 | uint64_t cgen_var_1318; |
| 20105 | stream->handleMapping()->mapHandles_VkDisplayKHR_u64(&local_display, &cgen_var_1318, 1); |
| 20106 | stream->write((uint64_t*)&cgen_var_1318, 1 * 8); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 20107 | AEMU_SCOPED_TRACE("vkAcquireXlibDisplayEXT readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20108 | stream->read((Display*)dpy, sizeof(Display)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 20109 | AEMU_SCOPED_TRACE("vkAcquireXlibDisplayEXT returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20110 | VkResult vkAcquireXlibDisplayEXT_VkResult_return = (VkResult)0; |
| 20111 | stream->read(&vkAcquireXlibDisplayEXT_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 20112 | countingStream->clearPool(); |
| 20113 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20114 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20115 | mImpl->log("finish vkAcquireXlibDisplayEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20116 | return vkAcquireXlibDisplayEXT_VkResult_return; |
| 20117 | } |
| 20118 | |
| 20119 | VkResult VkEncoder::vkGetRandROutputDisplayEXT( |
| 20120 | VkPhysicalDevice physicalDevice, |
| 20121 | Display* dpy, |
| 20122 | RROutput rrOutput, |
| 20123 | VkDisplayKHR* pDisplay) |
| 20124 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 20125 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 20126 | AEMU_SCOPED_TRACE("vkGetRandROutputDisplayEXT encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20127 | mImpl->log("start vkGetRandROutputDisplayEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20128 | auto stream = mImpl->stream(); |
| 20129 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20130 | auto resources = mImpl->resources(); |
| 20131 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20132 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20133 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20134 | RROutput local_rrOutput; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 20135 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20136 | local_rrOutput = rrOutput; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20137 | countingStream->rewind(); |
| 20138 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20139 | uint64_t cgen_var_1319; |
| 20140 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1319, 1); |
| 20141 | countingStream->write((uint64_t*)&cgen_var_1319, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20142 | countingStream->write((Display*)dpy, sizeof(Display)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20143 | countingStream->write((RROutput*)&local_rrOutput, sizeof(RROutput)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20144 | uint64_t cgen_var_1320; |
| 20145 | countingStream->handleMapping()->mapHandles_VkDisplayKHR_u64(pDisplay, &cgen_var_1320, 1); |
| 20146 | countingStream->write((uint64_t*)&cgen_var_1320, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20147 | } |
| 20148 | uint32_t packetSize_vkGetRandROutputDisplayEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 20149 | countingStream->rewind(); |
| 20150 | uint32_t opcode_vkGetRandROutputDisplayEXT = OP_vkGetRandROutputDisplayEXT; |
| 20151 | stream->write(&opcode_vkGetRandROutputDisplayEXT, sizeof(uint32_t)); |
| 20152 | stream->write(&packetSize_vkGetRandROutputDisplayEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20153 | uint64_t cgen_var_1321; |
| 20154 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1321, 1); |
| 20155 | stream->write((uint64_t*)&cgen_var_1321, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20156 | stream->write((Display*)dpy, sizeof(Display)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20157 | stream->write((RROutput*)&local_rrOutput, sizeof(RROutput)); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20158 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20159 | uint64_t cgen_var_1322; |
| 20160 | stream->handleMapping()->mapHandles_VkDisplayKHR_u64(pDisplay, &cgen_var_1322, 1); |
| 20161 | stream->write((uint64_t*)&cgen_var_1322, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20162 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 20163 | AEMU_SCOPED_TRACE("vkGetRandROutputDisplayEXT readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20164 | stream->read((Display*)dpy, sizeof(Display)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20165 | uint64_t cgen_var_1323; |
| 20166 | stream->read((uint64_t*)&cgen_var_1323, 8); |
| 20167 | stream->handleMapping()->mapHandles_u64_VkDisplayKHR(&cgen_var_1323, (VkDisplayKHR*)pDisplay, 1); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 20168 | AEMU_SCOPED_TRACE("vkGetRandROutputDisplayEXT returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20169 | VkResult vkGetRandROutputDisplayEXT_VkResult_return = (VkResult)0; |
| 20170 | stream->read(&vkGetRandROutputDisplayEXT_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 20171 | countingStream->clearPool(); |
| 20172 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20173 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20174 | mImpl->log("finish vkGetRandROutputDisplayEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20175 | return vkGetRandROutputDisplayEXT_VkResult_return; |
| 20176 | } |
| 20177 | |
| 20178 | #endif |
| 20179 | #ifdef VK_EXT_display_surface_counter |
| 20180 | VkResult VkEncoder::vkGetPhysicalDeviceSurfaceCapabilities2EXT( |
| 20181 | VkPhysicalDevice physicalDevice, |
| 20182 | VkSurfaceKHR surface, |
| 20183 | VkSurfaceCapabilities2EXT* pSurfaceCapabilities) |
| 20184 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 20185 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 20186 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceSurfaceCapabilities2EXT encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20187 | mImpl->log("start vkGetPhysicalDeviceSurfaceCapabilities2EXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20188 | auto stream = mImpl->stream(); |
| 20189 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20190 | auto resources = mImpl->resources(); |
| 20191 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20192 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20193 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20194 | VkSurfaceKHR local_surface; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 20195 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20196 | local_surface = surface; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20197 | countingStream->rewind(); |
| 20198 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20199 | uint64_t cgen_var_1324; |
| 20200 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1324, 1); |
| 20201 | countingStream->write((uint64_t*)&cgen_var_1324, 1 * 8); |
| 20202 | uint64_t cgen_var_1325; |
| 20203 | countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(&local_surface, &cgen_var_1325, 1); |
| 20204 | countingStream->write((uint64_t*)&cgen_var_1325, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20205 | marshal_VkSurfaceCapabilities2EXT(countingStream, (VkSurfaceCapabilities2EXT*)(pSurfaceCapabilities)); |
| 20206 | } |
| 20207 | uint32_t packetSize_vkGetPhysicalDeviceSurfaceCapabilities2EXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 20208 | countingStream->rewind(); |
| 20209 | uint32_t opcode_vkGetPhysicalDeviceSurfaceCapabilities2EXT = OP_vkGetPhysicalDeviceSurfaceCapabilities2EXT; |
| 20210 | stream->write(&opcode_vkGetPhysicalDeviceSurfaceCapabilities2EXT, sizeof(uint32_t)); |
| 20211 | stream->write(&packetSize_vkGetPhysicalDeviceSurfaceCapabilities2EXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20212 | uint64_t cgen_var_1326; |
| 20213 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1326, 1); |
| 20214 | stream->write((uint64_t*)&cgen_var_1326, 1 * 8); |
| 20215 | uint64_t cgen_var_1327; |
| 20216 | stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(&local_surface, &cgen_var_1327, 1); |
| 20217 | stream->write((uint64_t*)&cgen_var_1327, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20218 | marshal_VkSurfaceCapabilities2EXT(stream, (VkSurfaceCapabilities2EXT*)(pSurfaceCapabilities)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 20219 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceSurfaceCapabilities2EXT readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20220 | unmarshal_VkSurfaceCapabilities2EXT(stream, (VkSurfaceCapabilities2EXT*)(pSurfaceCapabilities)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 20221 | if (pSurfaceCapabilities) |
| 20222 | { |
| 20223 | transform_fromhost_VkSurfaceCapabilities2EXT(mImpl->resources(), (VkSurfaceCapabilities2EXT*)(pSurfaceCapabilities)); |
| 20224 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 20225 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceSurfaceCapabilities2EXT returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20226 | VkResult vkGetPhysicalDeviceSurfaceCapabilities2EXT_VkResult_return = (VkResult)0; |
| 20227 | stream->read(&vkGetPhysicalDeviceSurfaceCapabilities2EXT_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 20228 | countingStream->clearPool(); |
| 20229 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20230 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20231 | mImpl->log("finish vkGetPhysicalDeviceSurfaceCapabilities2EXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20232 | return vkGetPhysicalDeviceSurfaceCapabilities2EXT_VkResult_return; |
| 20233 | } |
| 20234 | |
| 20235 | #endif |
| 20236 | #ifdef VK_EXT_display_control |
| 20237 | VkResult VkEncoder::vkDisplayPowerControlEXT( |
| 20238 | VkDevice device, |
| 20239 | VkDisplayKHR display, |
| 20240 | const VkDisplayPowerInfoEXT* pDisplayPowerInfo) |
| 20241 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 20242 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 20243 | AEMU_SCOPED_TRACE("vkDisplayPowerControlEXT encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20244 | mImpl->log("start vkDisplayPowerControlEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20245 | auto stream = mImpl->stream(); |
| 20246 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20247 | auto resources = mImpl->resources(); |
| 20248 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20249 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20250 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20251 | VkDisplayKHR local_display; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20252 | VkDisplayPowerInfoEXT* local_pDisplayPowerInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 20253 | local_device = device; |
| 20254 | local_display = display; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20255 | local_pDisplayPowerInfo = nullptr; |
| 20256 | if (pDisplayPowerInfo) |
| 20257 | { |
| 20258 | local_pDisplayPowerInfo = (VkDisplayPowerInfoEXT*)pool->alloc(sizeof(const VkDisplayPowerInfoEXT)); |
| 20259 | deepcopy_VkDisplayPowerInfoEXT(pool, pDisplayPowerInfo, (VkDisplayPowerInfoEXT*)(local_pDisplayPowerInfo)); |
| 20260 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 20261 | if (local_pDisplayPowerInfo) |
| 20262 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 20263 | transform_tohost_VkDisplayPowerInfoEXT(mImpl->resources(), (VkDisplayPowerInfoEXT*)(local_pDisplayPowerInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 20264 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20265 | countingStream->rewind(); |
| 20266 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20267 | uint64_t cgen_var_1328; |
| 20268 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1328, 1); |
| 20269 | countingStream->write((uint64_t*)&cgen_var_1328, 1 * 8); |
| 20270 | uint64_t cgen_var_1329; |
| 20271 | countingStream->handleMapping()->mapHandles_VkDisplayKHR_u64(&local_display, &cgen_var_1329, 1); |
| 20272 | countingStream->write((uint64_t*)&cgen_var_1329, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20273 | marshal_VkDisplayPowerInfoEXT(countingStream, (VkDisplayPowerInfoEXT*)(local_pDisplayPowerInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20274 | } |
| 20275 | uint32_t packetSize_vkDisplayPowerControlEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 20276 | countingStream->rewind(); |
| 20277 | uint32_t opcode_vkDisplayPowerControlEXT = OP_vkDisplayPowerControlEXT; |
| 20278 | stream->write(&opcode_vkDisplayPowerControlEXT, sizeof(uint32_t)); |
| 20279 | stream->write(&packetSize_vkDisplayPowerControlEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20280 | uint64_t cgen_var_1330; |
| 20281 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1330, 1); |
| 20282 | stream->write((uint64_t*)&cgen_var_1330, 1 * 8); |
| 20283 | uint64_t cgen_var_1331; |
| 20284 | stream->handleMapping()->mapHandles_VkDisplayKHR_u64(&local_display, &cgen_var_1331, 1); |
| 20285 | stream->write((uint64_t*)&cgen_var_1331, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20286 | marshal_VkDisplayPowerInfoEXT(stream, (VkDisplayPowerInfoEXT*)(local_pDisplayPowerInfo)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 20287 | AEMU_SCOPED_TRACE("vkDisplayPowerControlEXT readParams"); |
| 20288 | AEMU_SCOPED_TRACE("vkDisplayPowerControlEXT returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20289 | VkResult vkDisplayPowerControlEXT_VkResult_return = (VkResult)0; |
| 20290 | stream->read(&vkDisplayPowerControlEXT_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 20291 | countingStream->clearPool(); |
| 20292 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20293 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20294 | mImpl->log("finish vkDisplayPowerControlEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20295 | return vkDisplayPowerControlEXT_VkResult_return; |
| 20296 | } |
| 20297 | |
| 20298 | VkResult VkEncoder::vkRegisterDeviceEventEXT( |
| 20299 | VkDevice device, |
| 20300 | const VkDeviceEventInfoEXT* pDeviceEventInfo, |
| 20301 | const VkAllocationCallbacks* pAllocator, |
| 20302 | VkFence* pFence) |
| 20303 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 20304 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 20305 | AEMU_SCOPED_TRACE("vkRegisterDeviceEventEXT encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20306 | mImpl->log("start vkRegisterDeviceEventEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20307 | auto stream = mImpl->stream(); |
| 20308 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20309 | auto resources = mImpl->resources(); |
| 20310 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20311 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20312 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20313 | VkDeviceEventInfoEXT* local_pDeviceEventInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 20314 | VkAllocationCallbacks* local_pAllocator; |
| 20315 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20316 | local_pDeviceEventInfo = nullptr; |
| 20317 | if (pDeviceEventInfo) |
| 20318 | { |
| 20319 | local_pDeviceEventInfo = (VkDeviceEventInfoEXT*)pool->alloc(sizeof(const VkDeviceEventInfoEXT)); |
| 20320 | deepcopy_VkDeviceEventInfoEXT(pool, pDeviceEventInfo, (VkDeviceEventInfoEXT*)(local_pDeviceEventInfo)); |
| 20321 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20322 | local_pAllocator = nullptr; |
| 20323 | if (pAllocator) |
| 20324 | { |
| 20325 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 20326 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 20327 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 20328 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 20329 | if (local_pDeviceEventInfo) |
| 20330 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 20331 | transform_tohost_VkDeviceEventInfoEXT(mImpl->resources(), (VkDeviceEventInfoEXT*)(local_pDeviceEventInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 20332 | } |
| 20333 | if (local_pAllocator) |
| 20334 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 20335 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 20336 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20337 | countingStream->rewind(); |
| 20338 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20339 | uint64_t cgen_var_1332; |
| 20340 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1332, 1); |
| 20341 | countingStream->write((uint64_t*)&cgen_var_1332, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20342 | marshal_VkDeviceEventInfoEXT(countingStream, (VkDeviceEventInfoEXT*)(local_pDeviceEventInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 20343 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20344 | uint64_t cgen_var_1333 = (uint64_t)(uintptr_t)local_pAllocator; |
| 20345 | countingStream->putBe64(cgen_var_1333); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20346 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20347 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20348 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20349 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20350 | uint64_t cgen_var_1334; |
| 20351 | countingStream->handleMapping()->mapHandles_VkFence_u64(pFence, &cgen_var_1334, 1); |
| 20352 | countingStream->write((uint64_t*)&cgen_var_1334, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20353 | } |
| 20354 | uint32_t packetSize_vkRegisterDeviceEventEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 20355 | countingStream->rewind(); |
| 20356 | uint32_t opcode_vkRegisterDeviceEventEXT = OP_vkRegisterDeviceEventEXT; |
| 20357 | stream->write(&opcode_vkRegisterDeviceEventEXT, sizeof(uint32_t)); |
| 20358 | stream->write(&packetSize_vkRegisterDeviceEventEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20359 | uint64_t cgen_var_1335; |
| 20360 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1335, 1); |
| 20361 | stream->write((uint64_t*)&cgen_var_1335, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20362 | marshal_VkDeviceEventInfoEXT(stream, (VkDeviceEventInfoEXT*)(local_pDeviceEventInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 20363 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20364 | uint64_t cgen_var_1336 = (uint64_t)(uintptr_t)local_pAllocator; |
| 20365 | stream->putBe64(cgen_var_1336); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20366 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20367 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20368 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20369 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20370 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20371 | uint64_t cgen_var_1337; |
| 20372 | stream->handleMapping()->mapHandles_VkFence_u64(pFence, &cgen_var_1337, 1); |
| 20373 | stream->write((uint64_t*)&cgen_var_1337, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20374 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 20375 | AEMU_SCOPED_TRACE("vkRegisterDeviceEventEXT readParams"); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20376 | uint64_t cgen_var_1338; |
| 20377 | stream->read((uint64_t*)&cgen_var_1338, 8); |
| 20378 | stream->handleMapping()->mapHandles_u64_VkFence(&cgen_var_1338, (VkFence*)pFence, 1); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 20379 | AEMU_SCOPED_TRACE("vkRegisterDeviceEventEXT returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20380 | VkResult vkRegisterDeviceEventEXT_VkResult_return = (VkResult)0; |
| 20381 | stream->read(&vkRegisterDeviceEventEXT_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 20382 | countingStream->clearPool(); |
| 20383 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20384 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20385 | mImpl->log("finish vkRegisterDeviceEventEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20386 | return vkRegisterDeviceEventEXT_VkResult_return; |
| 20387 | } |
| 20388 | |
| 20389 | VkResult VkEncoder::vkRegisterDisplayEventEXT( |
| 20390 | VkDevice device, |
| 20391 | VkDisplayKHR display, |
| 20392 | const VkDisplayEventInfoEXT* pDisplayEventInfo, |
| 20393 | const VkAllocationCallbacks* pAllocator, |
| 20394 | VkFence* pFence) |
| 20395 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 20396 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 20397 | AEMU_SCOPED_TRACE("vkRegisterDisplayEventEXT encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20398 | mImpl->log("start vkRegisterDisplayEventEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20399 | auto stream = mImpl->stream(); |
| 20400 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20401 | auto resources = mImpl->resources(); |
| 20402 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20403 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20404 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20405 | VkDisplayKHR local_display; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20406 | VkDisplayEventInfoEXT* local_pDisplayEventInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 20407 | VkAllocationCallbacks* local_pAllocator; |
| 20408 | local_device = device; |
| 20409 | local_display = display; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20410 | local_pDisplayEventInfo = nullptr; |
| 20411 | if (pDisplayEventInfo) |
| 20412 | { |
| 20413 | local_pDisplayEventInfo = (VkDisplayEventInfoEXT*)pool->alloc(sizeof(const VkDisplayEventInfoEXT)); |
| 20414 | deepcopy_VkDisplayEventInfoEXT(pool, pDisplayEventInfo, (VkDisplayEventInfoEXT*)(local_pDisplayEventInfo)); |
| 20415 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20416 | local_pAllocator = nullptr; |
| 20417 | if (pAllocator) |
| 20418 | { |
| 20419 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 20420 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 20421 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 20422 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 20423 | if (local_pDisplayEventInfo) |
| 20424 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 20425 | transform_tohost_VkDisplayEventInfoEXT(mImpl->resources(), (VkDisplayEventInfoEXT*)(local_pDisplayEventInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 20426 | } |
| 20427 | if (local_pAllocator) |
| 20428 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 20429 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 20430 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20431 | countingStream->rewind(); |
| 20432 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20433 | uint64_t cgen_var_1339; |
| 20434 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1339, 1); |
| 20435 | countingStream->write((uint64_t*)&cgen_var_1339, 1 * 8); |
| 20436 | uint64_t cgen_var_1340; |
| 20437 | countingStream->handleMapping()->mapHandles_VkDisplayKHR_u64(&local_display, &cgen_var_1340, 1); |
| 20438 | countingStream->write((uint64_t*)&cgen_var_1340, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20439 | marshal_VkDisplayEventInfoEXT(countingStream, (VkDisplayEventInfoEXT*)(local_pDisplayEventInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 20440 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20441 | uint64_t cgen_var_1341 = (uint64_t)(uintptr_t)local_pAllocator; |
| 20442 | countingStream->putBe64(cgen_var_1341); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20443 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20444 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20445 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20446 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20447 | uint64_t cgen_var_1342; |
| 20448 | countingStream->handleMapping()->mapHandles_VkFence_u64(pFence, &cgen_var_1342, 1); |
| 20449 | countingStream->write((uint64_t*)&cgen_var_1342, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20450 | } |
| 20451 | uint32_t packetSize_vkRegisterDisplayEventEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 20452 | countingStream->rewind(); |
| 20453 | uint32_t opcode_vkRegisterDisplayEventEXT = OP_vkRegisterDisplayEventEXT; |
| 20454 | stream->write(&opcode_vkRegisterDisplayEventEXT, sizeof(uint32_t)); |
| 20455 | stream->write(&packetSize_vkRegisterDisplayEventEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20456 | uint64_t cgen_var_1343; |
| 20457 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1343, 1); |
| 20458 | stream->write((uint64_t*)&cgen_var_1343, 1 * 8); |
| 20459 | uint64_t cgen_var_1344; |
| 20460 | stream->handleMapping()->mapHandles_VkDisplayKHR_u64(&local_display, &cgen_var_1344, 1); |
| 20461 | stream->write((uint64_t*)&cgen_var_1344, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20462 | marshal_VkDisplayEventInfoEXT(stream, (VkDisplayEventInfoEXT*)(local_pDisplayEventInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 20463 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20464 | uint64_t cgen_var_1345 = (uint64_t)(uintptr_t)local_pAllocator; |
| 20465 | stream->putBe64(cgen_var_1345); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20466 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20467 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20468 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20469 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20470 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20471 | uint64_t cgen_var_1346; |
| 20472 | stream->handleMapping()->mapHandles_VkFence_u64(pFence, &cgen_var_1346, 1); |
| 20473 | stream->write((uint64_t*)&cgen_var_1346, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20474 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 20475 | AEMU_SCOPED_TRACE("vkRegisterDisplayEventEXT readParams"); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20476 | uint64_t cgen_var_1347; |
| 20477 | stream->read((uint64_t*)&cgen_var_1347, 8); |
| 20478 | stream->handleMapping()->mapHandles_u64_VkFence(&cgen_var_1347, (VkFence*)pFence, 1); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 20479 | AEMU_SCOPED_TRACE("vkRegisterDisplayEventEXT returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20480 | VkResult vkRegisterDisplayEventEXT_VkResult_return = (VkResult)0; |
| 20481 | stream->read(&vkRegisterDisplayEventEXT_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 20482 | countingStream->clearPool(); |
| 20483 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20484 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20485 | mImpl->log("finish vkRegisterDisplayEventEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20486 | return vkRegisterDisplayEventEXT_VkResult_return; |
| 20487 | } |
| 20488 | |
| 20489 | VkResult VkEncoder::vkGetSwapchainCounterEXT( |
| 20490 | VkDevice device, |
| 20491 | VkSwapchainKHR swapchain, |
| 20492 | VkSurfaceCounterFlagBitsEXT counter, |
| 20493 | uint64_t* pCounterValue) |
| 20494 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 20495 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 20496 | AEMU_SCOPED_TRACE("vkGetSwapchainCounterEXT encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20497 | mImpl->log("start vkGetSwapchainCounterEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20498 | auto stream = mImpl->stream(); |
| 20499 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20500 | auto resources = mImpl->resources(); |
| 20501 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20502 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20503 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20504 | VkSwapchainKHR local_swapchain; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20505 | VkSurfaceCounterFlagBitsEXT local_counter; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 20506 | local_device = device; |
| 20507 | local_swapchain = swapchain; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20508 | local_counter = counter; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20509 | countingStream->rewind(); |
| 20510 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20511 | uint64_t cgen_var_1348; |
| 20512 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1348, 1); |
| 20513 | countingStream->write((uint64_t*)&cgen_var_1348, 1 * 8); |
| 20514 | uint64_t cgen_var_1349; |
| 20515 | countingStream->handleMapping()->mapHandles_VkSwapchainKHR_u64(&local_swapchain, &cgen_var_1349, 1); |
| 20516 | countingStream->write((uint64_t*)&cgen_var_1349, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20517 | countingStream->write((VkSurfaceCounterFlagBitsEXT*)&local_counter, sizeof(VkSurfaceCounterFlagBitsEXT)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20518 | countingStream->write((uint64_t*)pCounterValue, sizeof(uint64_t)); |
| 20519 | } |
| 20520 | uint32_t packetSize_vkGetSwapchainCounterEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 20521 | countingStream->rewind(); |
| 20522 | uint32_t opcode_vkGetSwapchainCounterEXT = OP_vkGetSwapchainCounterEXT; |
| 20523 | stream->write(&opcode_vkGetSwapchainCounterEXT, sizeof(uint32_t)); |
| 20524 | stream->write(&packetSize_vkGetSwapchainCounterEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20525 | uint64_t cgen_var_1350; |
| 20526 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1350, 1); |
| 20527 | stream->write((uint64_t*)&cgen_var_1350, 1 * 8); |
| 20528 | uint64_t cgen_var_1351; |
| 20529 | stream->handleMapping()->mapHandles_VkSwapchainKHR_u64(&local_swapchain, &cgen_var_1351, 1); |
| 20530 | stream->write((uint64_t*)&cgen_var_1351, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20531 | stream->write((VkSurfaceCounterFlagBitsEXT*)&local_counter, sizeof(VkSurfaceCounterFlagBitsEXT)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20532 | stream->write((uint64_t*)pCounterValue, sizeof(uint64_t)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 20533 | AEMU_SCOPED_TRACE("vkGetSwapchainCounterEXT readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20534 | stream->read((uint64_t*)pCounterValue, sizeof(uint64_t)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 20535 | AEMU_SCOPED_TRACE("vkGetSwapchainCounterEXT returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20536 | VkResult vkGetSwapchainCounterEXT_VkResult_return = (VkResult)0; |
| 20537 | stream->read(&vkGetSwapchainCounterEXT_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 20538 | countingStream->clearPool(); |
| 20539 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20540 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20541 | mImpl->log("finish vkGetSwapchainCounterEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20542 | return vkGetSwapchainCounterEXT_VkResult_return; |
| 20543 | } |
| 20544 | |
| 20545 | #endif |
| 20546 | #ifdef VK_GOOGLE_display_timing |
| 20547 | VkResult VkEncoder::vkGetRefreshCycleDurationGOOGLE( |
| 20548 | VkDevice device, |
| 20549 | VkSwapchainKHR swapchain, |
| 20550 | VkRefreshCycleDurationGOOGLE* pDisplayTimingProperties) |
| 20551 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 20552 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 20553 | AEMU_SCOPED_TRACE("vkGetRefreshCycleDurationGOOGLE encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20554 | mImpl->log("start vkGetRefreshCycleDurationGOOGLE"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20555 | auto stream = mImpl->stream(); |
| 20556 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20557 | auto resources = mImpl->resources(); |
| 20558 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20559 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20560 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20561 | VkSwapchainKHR local_swapchain; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 20562 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20563 | local_swapchain = swapchain; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20564 | countingStream->rewind(); |
| 20565 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20566 | uint64_t cgen_var_1352; |
| 20567 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1352, 1); |
| 20568 | countingStream->write((uint64_t*)&cgen_var_1352, 1 * 8); |
| 20569 | uint64_t cgen_var_1353; |
| 20570 | countingStream->handleMapping()->mapHandles_VkSwapchainKHR_u64(&local_swapchain, &cgen_var_1353, 1); |
| 20571 | countingStream->write((uint64_t*)&cgen_var_1353, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20572 | marshal_VkRefreshCycleDurationGOOGLE(countingStream, (VkRefreshCycleDurationGOOGLE*)(pDisplayTimingProperties)); |
| 20573 | } |
| 20574 | uint32_t packetSize_vkGetRefreshCycleDurationGOOGLE = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 20575 | countingStream->rewind(); |
| 20576 | uint32_t opcode_vkGetRefreshCycleDurationGOOGLE = OP_vkGetRefreshCycleDurationGOOGLE; |
| 20577 | stream->write(&opcode_vkGetRefreshCycleDurationGOOGLE, sizeof(uint32_t)); |
| 20578 | stream->write(&packetSize_vkGetRefreshCycleDurationGOOGLE, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20579 | uint64_t cgen_var_1354; |
| 20580 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1354, 1); |
| 20581 | stream->write((uint64_t*)&cgen_var_1354, 1 * 8); |
| 20582 | uint64_t cgen_var_1355; |
| 20583 | stream->handleMapping()->mapHandles_VkSwapchainKHR_u64(&local_swapchain, &cgen_var_1355, 1); |
| 20584 | stream->write((uint64_t*)&cgen_var_1355, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20585 | marshal_VkRefreshCycleDurationGOOGLE(stream, (VkRefreshCycleDurationGOOGLE*)(pDisplayTimingProperties)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 20586 | AEMU_SCOPED_TRACE("vkGetRefreshCycleDurationGOOGLE readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20587 | unmarshal_VkRefreshCycleDurationGOOGLE(stream, (VkRefreshCycleDurationGOOGLE*)(pDisplayTimingProperties)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 20588 | if (pDisplayTimingProperties) |
| 20589 | { |
| 20590 | transform_fromhost_VkRefreshCycleDurationGOOGLE(mImpl->resources(), (VkRefreshCycleDurationGOOGLE*)(pDisplayTimingProperties)); |
| 20591 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 20592 | AEMU_SCOPED_TRACE("vkGetRefreshCycleDurationGOOGLE returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20593 | VkResult vkGetRefreshCycleDurationGOOGLE_VkResult_return = (VkResult)0; |
| 20594 | stream->read(&vkGetRefreshCycleDurationGOOGLE_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 20595 | countingStream->clearPool(); |
| 20596 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20597 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20598 | mImpl->log("finish vkGetRefreshCycleDurationGOOGLE");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20599 | return vkGetRefreshCycleDurationGOOGLE_VkResult_return; |
| 20600 | } |
| 20601 | |
| 20602 | VkResult VkEncoder::vkGetPastPresentationTimingGOOGLE( |
| 20603 | VkDevice device, |
| 20604 | VkSwapchainKHR swapchain, |
| 20605 | uint32_t* pPresentationTimingCount, |
| 20606 | VkPastPresentationTimingGOOGLE* pPresentationTimings) |
| 20607 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 20608 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 20609 | AEMU_SCOPED_TRACE("vkGetPastPresentationTimingGOOGLE encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20610 | mImpl->log("start vkGetPastPresentationTimingGOOGLE"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20611 | auto stream = mImpl->stream(); |
| 20612 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20613 | auto resources = mImpl->resources(); |
| 20614 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20615 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20616 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20617 | VkSwapchainKHR local_swapchain; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 20618 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20619 | local_swapchain = swapchain; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20620 | countingStream->rewind(); |
| 20621 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20622 | uint64_t cgen_var_1356; |
| 20623 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1356, 1); |
| 20624 | countingStream->write((uint64_t*)&cgen_var_1356, 1 * 8); |
| 20625 | uint64_t cgen_var_1357; |
| 20626 | countingStream->handleMapping()->mapHandles_VkSwapchainKHR_u64(&local_swapchain, &cgen_var_1357, 1); |
| 20627 | countingStream->write((uint64_t*)&cgen_var_1357, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 20628 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20629 | uint64_t cgen_var_1358 = (uint64_t)(uintptr_t)pPresentationTimingCount; |
| 20630 | countingStream->putBe64(cgen_var_1358); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20631 | if (pPresentationTimingCount) |
| 20632 | { |
| 20633 | countingStream->write((uint32_t*)pPresentationTimingCount, sizeof(uint32_t)); |
| 20634 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 20635 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20636 | uint64_t cgen_var_1359 = (uint64_t)(uintptr_t)pPresentationTimings; |
| 20637 | countingStream->putBe64(cgen_var_1359); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20638 | if (pPresentationTimings) |
| 20639 | { |
| 20640 | for (uint32_t i = 0; i < (uint32_t)(*(pPresentationTimingCount)); ++i) |
| 20641 | { |
| 20642 | marshal_VkPastPresentationTimingGOOGLE(countingStream, (VkPastPresentationTimingGOOGLE*)(pPresentationTimings + i)); |
| 20643 | } |
| 20644 | } |
| 20645 | } |
| 20646 | uint32_t packetSize_vkGetPastPresentationTimingGOOGLE = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 20647 | countingStream->rewind(); |
| 20648 | uint32_t opcode_vkGetPastPresentationTimingGOOGLE = OP_vkGetPastPresentationTimingGOOGLE; |
| 20649 | stream->write(&opcode_vkGetPastPresentationTimingGOOGLE, sizeof(uint32_t)); |
| 20650 | stream->write(&packetSize_vkGetPastPresentationTimingGOOGLE, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20651 | uint64_t cgen_var_1360; |
| 20652 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1360, 1); |
| 20653 | stream->write((uint64_t*)&cgen_var_1360, 1 * 8); |
| 20654 | uint64_t cgen_var_1361; |
| 20655 | stream->handleMapping()->mapHandles_VkSwapchainKHR_u64(&local_swapchain, &cgen_var_1361, 1); |
| 20656 | stream->write((uint64_t*)&cgen_var_1361, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 20657 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20658 | uint64_t cgen_var_1362 = (uint64_t)(uintptr_t)pPresentationTimingCount; |
| 20659 | stream->putBe64(cgen_var_1362); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20660 | if (pPresentationTimingCount) |
| 20661 | { |
| 20662 | stream->write((uint32_t*)pPresentationTimingCount, sizeof(uint32_t)); |
| 20663 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 20664 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20665 | uint64_t cgen_var_1363 = (uint64_t)(uintptr_t)pPresentationTimings; |
| 20666 | stream->putBe64(cgen_var_1363); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20667 | if (pPresentationTimings) |
| 20668 | { |
| 20669 | for (uint32_t i = 0; i < (uint32_t)(*(pPresentationTimingCount)); ++i) |
| 20670 | { |
| 20671 | marshal_VkPastPresentationTimingGOOGLE(stream, (VkPastPresentationTimingGOOGLE*)(pPresentationTimings + i)); |
| 20672 | } |
| 20673 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 20674 | AEMU_SCOPED_TRACE("vkGetPastPresentationTimingGOOGLE readParams"); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 20675 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20676 | uint32_t* check_pPresentationTimingCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 20677 | check_pPresentationTimingCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20678 | if (pPresentationTimingCount) |
| 20679 | { |
| 20680 | if (!(check_pPresentationTimingCount)) |
| 20681 | { |
| 20682 | fprintf(stderr, "fatal: pPresentationTimingCount inconsistent between guest and host\n"); |
| 20683 | } |
| 20684 | stream->read((uint32_t*)pPresentationTimingCount, sizeof(uint32_t)); |
| 20685 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 20686 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20687 | VkPastPresentationTimingGOOGLE* check_pPresentationTimings; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 20688 | check_pPresentationTimings = (VkPastPresentationTimingGOOGLE*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20689 | if (pPresentationTimings) |
| 20690 | { |
| 20691 | if (!(check_pPresentationTimings)) |
| 20692 | { |
| 20693 | fprintf(stderr, "fatal: pPresentationTimings inconsistent between guest and host\n"); |
| 20694 | } |
| 20695 | for (uint32_t i = 0; i < (uint32_t)(*(pPresentationTimingCount)); ++i) |
| 20696 | { |
| 20697 | unmarshal_VkPastPresentationTimingGOOGLE(stream, (VkPastPresentationTimingGOOGLE*)(pPresentationTimings + i)); |
| 20698 | } |
| 20699 | } |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 20700 | if (pPresentationTimings) |
| 20701 | { |
| 20702 | for (uint32_t i = 0; i < (uint32_t)(*(pPresentationTimingCount)); ++i) |
| 20703 | { |
| 20704 | transform_fromhost_VkPastPresentationTimingGOOGLE(mImpl->resources(), (VkPastPresentationTimingGOOGLE*)(pPresentationTimings + i)); |
| 20705 | } |
| 20706 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 20707 | AEMU_SCOPED_TRACE("vkGetPastPresentationTimingGOOGLE returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20708 | VkResult vkGetPastPresentationTimingGOOGLE_VkResult_return = (VkResult)0; |
| 20709 | stream->read(&vkGetPastPresentationTimingGOOGLE_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 20710 | countingStream->clearPool(); |
| 20711 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20712 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20713 | mImpl->log("finish vkGetPastPresentationTimingGOOGLE");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20714 | return vkGetPastPresentationTimingGOOGLE_VkResult_return; |
| 20715 | } |
| 20716 | |
| 20717 | #endif |
| 20718 | #ifdef VK_NV_sample_mask_override_coverage |
| 20719 | #endif |
| 20720 | #ifdef VK_NV_geometry_shader_passthrough |
| 20721 | #endif |
| 20722 | #ifdef VK_NV_viewport_array2 |
| 20723 | #endif |
| 20724 | #ifdef VK_NVX_multiview_per_view_attributes |
| 20725 | #endif |
| 20726 | #ifdef VK_NV_viewport_swizzle |
| 20727 | #endif |
| 20728 | #ifdef VK_EXT_discard_rectangles |
| 20729 | void VkEncoder::vkCmdSetDiscardRectangleEXT( |
| 20730 | VkCommandBuffer commandBuffer, |
| 20731 | uint32_t firstDiscardRectangle, |
| 20732 | uint32_t discardRectangleCount, |
| 20733 | const VkRect2D* pDiscardRectangles) |
| 20734 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 20735 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 20736 | AEMU_SCOPED_TRACE("vkCmdSetDiscardRectangleEXT encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20737 | mImpl->log("start vkCmdSetDiscardRectangleEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20738 | auto stream = mImpl->stream(); |
| 20739 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20740 | auto resources = mImpl->resources(); |
| 20741 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20742 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20743 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20744 | uint32_t local_firstDiscardRectangle; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20745 | uint32_t local_discardRectangleCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20746 | VkRect2D* local_pDiscardRectangles; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 20747 | local_commandBuffer = commandBuffer; |
| 20748 | local_firstDiscardRectangle = firstDiscardRectangle; |
| 20749 | local_discardRectangleCount = discardRectangleCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20750 | local_pDiscardRectangles = nullptr; |
| 20751 | if (pDiscardRectangles) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20752 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20753 | local_pDiscardRectangles = (VkRect2D*)pool->alloc(((discardRectangleCount)) * sizeof(const VkRect2D)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20754 | for (uint32_t i = 0; i < (uint32_t)((discardRectangleCount)); ++i) |
| 20755 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20756 | deepcopy_VkRect2D(pool, pDiscardRectangles + i, (VkRect2D*)(local_pDiscardRectangles + i)); |
| 20757 | } |
| 20758 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 20759 | if (local_pDiscardRectangles) |
| 20760 | { |
| 20761 | for (uint32_t i = 0; i < (uint32_t)((discardRectangleCount)); ++i) |
| 20762 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 20763 | transform_tohost_VkRect2D(mImpl->resources(), (VkRect2D*)(local_pDiscardRectangles + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 20764 | } |
| 20765 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20766 | countingStream->rewind(); |
| 20767 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20768 | uint64_t cgen_var_1366; |
| 20769 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1366, 1); |
| 20770 | countingStream->write((uint64_t*)&cgen_var_1366, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20771 | countingStream->write((uint32_t*)&local_firstDiscardRectangle, sizeof(uint32_t)); |
| 20772 | countingStream->write((uint32_t*)&local_discardRectangleCount, sizeof(uint32_t)); |
| 20773 | for (uint32_t i = 0; i < (uint32_t)((discardRectangleCount)); ++i) |
| 20774 | { |
| 20775 | marshal_VkRect2D(countingStream, (VkRect2D*)(local_pDiscardRectangles + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20776 | } |
| 20777 | } |
| 20778 | uint32_t packetSize_vkCmdSetDiscardRectangleEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 20779 | countingStream->rewind(); |
| 20780 | uint32_t opcode_vkCmdSetDiscardRectangleEXT = OP_vkCmdSetDiscardRectangleEXT; |
| 20781 | stream->write(&opcode_vkCmdSetDiscardRectangleEXT, sizeof(uint32_t)); |
| 20782 | stream->write(&packetSize_vkCmdSetDiscardRectangleEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20783 | uint64_t cgen_var_1367; |
| 20784 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1367, 1); |
| 20785 | stream->write((uint64_t*)&cgen_var_1367, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20786 | stream->write((uint32_t*)&local_firstDiscardRectangle, sizeof(uint32_t)); |
| 20787 | stream->write((uint32_t*)&local_discardRectangleCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20788 | for (uint32_t i = 0; i < (uint32_t)((discardRectangleCount)); ++i) |
| 20789 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20790 | marshal_VkRect2D(stream, (VkRect2D*)(local_pDiscardRectangles + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20791 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 20792 | AEMU_SCOPED_TRACE("vkCmdSetDiscardRectangleEXT readParams"); |
| 20793 | AEMU_SCOPED_TRACE("vkCmdSetDiscardRectangleEXT returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20794 | mImpl->log("finish vkCmdSetDiscardRectangleEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20795 | } |
| 20796 | |
| 20797 | #endif |
| 20798 | #ifdef VK_EXT_conservative_rasterization |
| 20799 | #endif |
| 20800 | #ifdef VK_EXT_swapchain_colorspace |
| 20801 | #endif |
| 20802 | #ifdef VK_EXT_hdr_metadata |
| 20803 | void VkEncoder::vkSetHdrMetadataEXT( |
| 20804 | VkDevice device, |
| 20805 | uint32_t swapchainCount, |
| 20806 | const VkSwapchainKHR* pSwapchains, |
| 20807 | const VkHdrMetadataEXT* pMetadata) |
| 20808 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 20809 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 20810 | AEMU_SCOPED_TRACE("vkSetHdrMetadataEXT encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20811 | mImpl->log("start vkSetHdrMetadataEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20812 | auto stream = mImpl->stream(); |
| 20813 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20814 | auto resources = mImpl->resources(); |
| 20815 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20816 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20817 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20818 | uint32_t local_swapchainCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20819 | VkSwapchainKHR* local_pSwapchains; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 20820 | VkHdrMetadataEXT* local_pMetadata; |
| 20821 | local_device = device; |
| 20822 | local_swapchainCount = swapchainCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20823 | local_pSwapchains = nullptr; |
| 20824 | if (pSwapchains) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20825 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20826 | local_pSwapchains = (VkSwapchainKHR*)pool->dupArray(pSwapchains, ((swapchainCount)) * sizeof(const VkSwapchainKHR)); |
| 20827 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20828 | local_pMetadata = nullptr; |
| 20829 | if (pMetadata) |
| 20830 | { |
| 20831 | local_pMetadata = (VkHdrMetadataEXT*)pool->alloc(((swapchainCount)) * sizeof(const VkHdrMetadataEXT)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20832 | for (uint32_t i = 0; i < (uint32_t)((swapchainCount)); ++i) |
| 20833 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20834 | deepcopy_VkHdrMetadataEXT(pool, pMetadata + i, (VkHdrMetadataEXT*)(local_pMetadata + i)); |
| 20835 | } |
| 20836 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 20837 | if (local_pMetadata) |
| 20838 | { |
| 20839 | for (uint32_t i = 0; i < (uint32_t)((swapchainCount)); ++i) |
| 20840 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 20841 | transform_tohost_VkHdrMetadataEXT(mImpl->resources(), (VkHdrMetadataEXT*)(local_pMetadata + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 20842 | } |
| 20843 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20844 | countingStream->rewind(); |
| 20845 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20846 | uint64_t cgen_var_1368; |
| 20847 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1368, 1); |
| 20848 | countingStream->write((uint64_t*)&cgen_var_1368, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20849 | countingStream->write((uint32_t*)&local_swapchainCount, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 20850 | if (((swapchainCount))) |
| 20851 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20852 | uint64_t* cgen_var_1369; |
| 20853 | countingStream->alloc((void**)&cgen_var_1369, ((swapchainCount)) * 8); |
| 20854 | countingStream->handleMapping()->mapHandles_VkSwapchainKHR_u64(local_pSwapchains, cgen_var_1369, ((swapchainCount))); |
| 20855 | countingStream->write((uint64_t*)cgen_var_1369, ((swapchainCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 20856 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20857 | for (uint32_t i = 0; i < (uint32_t)((swapchainCount)); ++i) |
| 20858 | { |
| 20859 | marshal_VkHdrMetadataEXT(countingStream, (VkHdrMetadataEXT*)(local_pMetadata + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20860 | } |
| 20861 | } |
| 20862 | uint32_t packetSize_vkSetHdrMetadataEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 20863 | countingStream->rewind(); |
| 20864 | uint32_t opcode_vkSetHdrMetadataEXT = OP_vkSetHdrMetadataEXT; |
| 20865 | stream->write(&opcode_vkSetHdrMetadataEXT, sizeof(uint32_t)); |
| 20866 | stream->write(&packetSize_vkSetHdrMetadataEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20867 | uint64_t cgen_var_1370; |
| 20868 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1370, 1); |
| 20869 | stream->write((uint64_t*)&cgen_var_1370, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20870 | stream->write((uint32_t*)&local_swapchainCount, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 20871 | if (((swapchainCount))) |
| 20872 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20873 | uint64_t* cgen_var_1371; |
| 20874 | stream->alloc((void**)&cgen_var_1371, ((swapchainCount)) * 8); |
| 20875 | stream->handleMapping()->mapHandles_VkSwapchainKHR_u64(local_pSwapchains, cgen_var_1371, ((swapchainCount))); |
| 20876 | stream->write((uint64_t*)cgen_var_1371, ((swapchainCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 20877 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20878 | for (uint32_t i = 0; i < (uint32_t)((swapchainCount)); ++i) |
| 20879 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20880 | marshal_VkHdrMetadataEXT(stream, (VkHdrMetadataEXT*)(local_pMetadata + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20881 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 20882 | AEMU_SCOPED_TRACE("vkSetHdrMetadataEXT readParams"); |
| 20883 | AEMU_SCOPED_TRACE("vkSetHdrMetadataEXT returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20884 | mImpl->log("finish vkSetHdrMetadataEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20885 | } |
| 20886 | |
| 20887 | #endif |
| 20888 | #ifdef VK_MVK_ios_surface |
| 20889 | VkResult VkEncoder::vkCreateIOSSurfaceMVK( |
| 20890 | VkInstance instance, |
| 20891 | const VkIOSSurfaceCreateInfoMVK* pCreateInfo, |
| 20892 | const VkAllocationCallbacks* pAllocator, |
| 20893 | VkSurfaceKHR* pSurface) |
| 20894 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 20895 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 20896 | AEMU_SCOPED_TRACE("vkCreateIOSSurfaceMVK encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20897 | mImpl->log("start vkCreateIOSSurfaceMVK"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20898 | auto stream = mImpl->stream(); |
| 20899 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20900 | auto resources = mImpl->resources(); |
| 20901 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20902 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20903 | VkInstance local_instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20904 | VkIOSSurfaceCreateInfoMVK* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 20905 | VkAllocationCallbacks* local_pAllocator; |
| 20906 | local_instance = instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20907 | local_pCreateInfo = nullptr; |
| 20908 | if (pCreateInfo) |
| 20909 | { |
| 20910 | local_pCreateInfo = (VkIOSSurfaceCreateInfoMVK*)pool->alloc(sizeof(const VkIOSSurfaceCreateInfoMVK)); |
| 20911 | deepcopy_VkIOSSurfaceCreateInfoMVK(pool, pCreateInfo, (VkIOSSurfaceCreateInfoMVK*)(local_pCreateInfo)); |
| 20912 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20913 | local_pAllocator = nullptr; |
| 20914 | if (pAllocator) |
| 20915 | { |
| 20916 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 20917 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 20918 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 20919 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 20920 | if (local_pCreateInfo) |
| 20921 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 20922 | transform_tohost_VkIOSSurfaceCreateInfoMVK(mImpl->resources(), (VkIOSSurfaceCreateInfoMVK*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 20923 | } |
| 20924 | if (local_pAllocator) |
| 20925 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 20926 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 20927 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20928 | countingStream->rewind(); |
| 20929 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20930 | uint64_t cgen_var_1372; |
| 20931 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1372, 1); |
| 20932 | countingStream->write((uint64_t*)&cgen_var_1372, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20933 | marshal_VkIOSSurfaceCreateInfoMVK(countingStream, (VkIOSSurfaceCreateInfoMVK*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 20934 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20935 | uint64_t cgen_var_1373 = (uint64_t)(uintptr_t)local_pAllocator; |
| 20936 | countingStream->putBe64(cgen_var_1373); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20937 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20938 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20939 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20940 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20941 | uint64_t cgen_var_1374; |
| 20942 | countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_1374, 1); |
| 20943 | countingStream->write((uint64_t*)&cgen_var_1374, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20944 | } |
| 20945 | uint32_t packetSize_vkCreateIOSSurfaceMVK = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 20946 | countingStream->rewind(); |
| 20947 | uint32_t opcode_vkCreateIOSSurfaceMVK = OP_vkCreateIOSSurfaceMVK; |
| 20948 | stream->write(&opcode_vkCreateIOSSurfaceMVK, sizeof(uint32_t)); |
| 20949 | stream->write(&packetSize_vkCreateIOSSurfaceMVK, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20950 | uint64_t cgen_var_1375; |
| 20951 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1375, 1); |
| 20952 | stream->write((uint64_t*)&cgen_var_1375, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20953 | marshal_VkIOSSurfaceCreateInfoMVK(stream, (VkIOSSurfaceCreateInfoMVK*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 20954 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20955 | uint64_t cgen_var_1376 = (uint64_t)(uintptr_t)local_pAllocator; |
| 20956 | stream->putBe64(cgen_var_1376); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20957 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20958 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20959 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20960 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20961 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20962 | uint64_t cgen_var_1377; |
| 20963 | stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_1377, 1); |
| 20964 | stream->write((uint64_t*)&cgen_var_1377, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20965 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 20966 | AEMU_SCOPED_TRACE("vkCreateIOSSurfaceMVK readParams"); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20967 | uint64_t cgen_var_1378; |
| 20968 | stream->read((uint64_t*)&cgen_var_1378, 8); |
| 20969 | stream->handleMapping()->mapHandles_u64_VkSurfaceKHR(&cgen_var_1378, (VkSurfaceKHR*)pSurface, 1); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 20970 | AEMU_SCOPED_TRACE("vkCreateIOSSurfaceMVK returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20971 | VkResult vkCreateIOSSurfaceMVK_VkResult_return = (VkResult)0; |
| 20972 | stream->read(&vkCreateIOSSurfaceMVK_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 20973 | countingStream->clearPool(); |
| 20974 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20975 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20976 | mImpl->log("finish vkCreateIOSSurfaceMVK");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20977 | return vkCreateIOSSurfaceMVK_VkResult_return; |
| 20978 | } |
| 20979 | |
| 20980 | #endif |
| 20981 | #ifdef VK_MVK_macos_surface |
| 20982 | VkResult VkEncoder::vkCreateMacOSSurfaceMVK( |
| 20983 | VkInstance instance, |
| 20984 | const VkMacOSSurfaceCreateInfoMVK* pCreateInfo, |
| 20985 | const VkAllocationCallbacks* pAllocator, |
| 20986 | VkSurfaceKHR* pSurface) |
| 20987 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 20988 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 20989 | AEMU_SCOPED_TRACE("vkCreateMacOSSurfaceMVK encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20990 | mImpl->log("start vkCreateMacOSSurfaceMVK"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20991 | auto stream = mImpl->stream(); |
| 20992 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20993 | auto resources = mImpl->resources(); |
| 20994 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20995 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20996 | VkInstance local_instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20997 | VkMacOSSurfaceCreateInfoMVK* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 20998 | VkAllocationCallbacks* local_pAllocator; |
| 20999 | local_instance = instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21000 | local_pCreateInfo = nullptr; |
| 21001 | if (pCreateInfo) |
| 21002 | { |
| 21003 | local_pCreateInfo = (VkMacOSSurfaceCreateInfoMVK*)pool->alloc(sizeof(const VkMacOSSurfaceCreateInfoMVK)); |
| 21004 | deepcopy_VkMacOSSurfaceCreateInfoMVK(pool, pCreateInfo, (VkMacOSSurfaceCreateInfoMVK*)(local_pCreateInfo)); |
| 21005 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21006 | local_pAllocator = nullptr; |
| 21007 | if (pAllocator) |
| 21008 | { |
| 21009 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 21010 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 21011 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 21012 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 21013 | if (local_pCreateInfo) |
| 21014 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 21015 | transform_tohost_VkMacOSSurfaceCreateInfoMVK(mImpl->resources(), (VkMacOSSurfaceCreateInfoMVK*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 21016 | } |
| 21017 | if (local_pAllocator) |
| 21018 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 21019 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 21020 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21021 | countingStream->rewind(); |
| 21022 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21023 | uint64_t cgen_var_1379; |
| 21024 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1379, 1); |
| 21025 | countingStream->write((uint64_t*)&cgen_var_1379, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21026 | marshal_VkMacOSSurfaceCreateInfoMVK(countingStream, (VkMacOSSurfaceCreateInfoMVK*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 21027 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21028 | uint64_t cgen_var_1380 = (uint64_t)(uintptr_t)local_pAllocator; |
| 21029 | countingStream->putBe64(cgen_var_1380); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21030 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21031 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21032 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21033 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21034 | uint64_t cgen_var_1381; |
| 21035 | countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_1381, 1); |
| 21036 | countingStream->write((uint64_t*)&cgen_var_1381, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21037 | } |
| 21038 | uint32_t packetSize_vkCreateMacOSSurfaceMVK = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 21039 | countingStream->rewind(); |
| 21040 | uint32_t opcode_vkCreateMacOSSurfaceMVK = OP_vkCreateMacOSSurfaceMVK; |
| 21041 | stream->write(&opcode_vkCreateMacOSSurfaceMVK, sizeof(uint32_t)); |
| 21042 | stream->write(&packetSize_vkCreateMacOSSurfaceMVK, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21043 | uint64_t cgen_var_1382; |
| 21044 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1382, 1); |
| 21045 | stream->write((uint64_t*)&cgen_var_1382, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21046 | marshal_VkMacOSSurfaceCreateInfoMVK(stream, (VkMacOSSurfaceCreateInfoMVK*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 21047 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21048 | uint64_t cgen_var_1383 = (uint64_t)(uintptr_t)local_pAllocator; |
| 21049 | stream->putBe64(cgen_var_1383); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21050 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21051 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21052 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21053 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 21054 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21055 | uint64_t cgen_var_1384; |
| 21056 | stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_1384, 1); |
| 21057 | stream->write((uint64_t*)&cgen_var_1384, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 21058 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 21059 | AEMU_SCOPED_TRACE("vkCreateMacOSSurfaceMVK readParams"); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21060 | uint64_t cgen_var_1385; |
| 21061 | stream->read((uint64_t*)&cgen_var_1385, 8); |
| 21062 | stream->handleMapping()->mapHandles_u64_VkSurfaceKHR(&cgen_var_1385, (VkSurfaceKHR*)pSurface, 1); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 21063 | AEMU_SCOPED_TRACE("vkCreateMacOSSurfaceMVK returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21064 | VkResult vkCreateMacOSSurfaceMVK_VkResult_return = (VkResult)0; |
| 21065 | stream->read(&vkCreateMacOSSurfaceMVK_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 21066 | countingStream->clearPool(); |
| 21067 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 21068 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 21069 | mImpl->log("finish vkCreateMacOSSurfaceMVK");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21070 | return vkCreateMacOSSurfaceMVK_VkResult_return; |
| 21071 | } |
| 21072 | |
| 21073 | #endif |
| 21074 | #ifdef VK_EXT_external_memory_dma_buf |
| 21075 | #endif |
| 21076 | #ifdef VK_EXT_queue_family_foreign |
| 21077 | #endif |
| 21078 | #ifdef VK_EXT_debug_utils |
| 21079 | VkResult VkEncoder::vkSetDebugUtilsObjectNameEXT( |
| 21080 | VkDevice device, |
| 21081 | const VkDebugUtilsObjectNameInfoEXT* pNameInfo) |
| 21082 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 21083 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 21084 | AEMU_SCOPED_TRACE("vkSetDebugUtilsObjectNameEXT encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 21085 | mImpl->log("start vkSetDebugUtilsObjectNameEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21086 | auto stream = mImpl->stream(); |
| 21087 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21088 | auto resources = mImpl->resources(); |
| 21089 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 21090 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21091 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21092 | VkDebugUtilsObjectNameInfoEXT* local_pNameInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 21093 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21094 | local_pNameInfo = nullptr; |
| 21095 | if (pNameInfo) |
| 21096 | { |
| 21097 | local_pNameInfo = (VkDebugUtilsObjectNameInfoEXT*)pool->alloc(sizeof(const VkDebugUtilsObjectNameInfoEXT)); |
| 21098 | deepcopy_VkDebugUtilsObjectNameInfoEXT(pool, pNameInfo, (VkDebugUtilsObjectNameInfoEXT*)(local_pNameInfo)); |
| 21099 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 21100 | if (local_pNameInfo) |
| 21101 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 21102 | transform_tohost_VkDebugUtilsObjectNameInfoEXT(mImpl->resources(), (VkDebugUtilsObjectNameInfoEXT*)(local_pNameInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 21103 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21104 | countingStream->rewind(); |
| 21105 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21106 | uint64_t cgen_var_1386; |
| 21107 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1386, 1); |
| 21108 | countingStream->write((uint64_t*)&cgen_var_1386, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21109 | marshal_VkDebugUtilsObjectNameInfoEXT(countingStream, (VkDebugUtilsObjectNameInfoEXT*)(local_pNameInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21110 | } |
| 21111 | uint32_t packetSize_vkSetDebugUtilsObjectNameEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 21112 | countingStream->rewind(); |
| 21113 | uint32_t opcode_vkSetDebugUtilsObjectNameEXT = OP_vkSetDebugUtilsObjectNameEXT; |
| 21114 | stream->write(&opcode_vkSetDebugUtilsObjectNameEXT, sizeof(uint32_t)); |
| 21115 | stream->write(&packetSize_vkSetDebugUtilsObjectNameEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21116 | uint64_t cgen_var_1387; |
| 21117 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1387, 1); |
| 21118 | stream->write((uint64_t*)&cgen_var_1387, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21119 | marshal_VkDebugUtilsObjectNameInfoEXT(stream, (VkDebugUtilsObjectNameInfoEXT*)(local_pNameInfo)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 21120 | AEMU_SCOPED_TRACE("vkSetDebugUtilsObjectNameEXT readParams"); |
| 21121 | AEMU_SCOPED_TRACE("vkSetDebugUtilsObjectNameEXT returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21122 | VkResult vkSetDebugUtilsObjectNameEXT_VkResult_return = (VkResult)0; |
| 21123 | stream->read(&vkSetDebugUtilsObjectNameEXT_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 21124 | countingStream->clearPool(); |
| 21125 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 21126 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 21127 | mImpl->log("finish vkSetDebugUtilsObjectNameEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21128 | return vkSetDebugUtilsObjectNameEXT_VkResult_return; |
| 21129 | } |
| 21130 | |
| 21131 | VkResult VkEncoder::vkSetDebugUtilsObjectTagEXT( |
| 21132 | VkDevice device, |
| 21133 | const VkDebugUtilsObjectTagInfoEXT* pTagInfo) |
| 21134 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 21135 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 21136 | AEMU_SCOPED_TRACE("vkSetDebugUtilsObjectTagEXT encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 21137 | mImpl->log("start vkSetDebugUtilsObjectTagEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21138 | auto stream = mImpl->stream(); |
| 21139 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21140 | auto resources = mImpl->resources(); |
| 21141 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 21142 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21143 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21144 | VkDebugUtilsObjectTagInfoEXT* local_pTagInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 21145 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21146 | local_pTagInfo = nullptr; |
| 21147 | if (pTagInfo) |
| 21148 | { |
| 21149 | local_pTagInfo = (VkDebugUtilsObjectTagInfoEXT*)pool->alloc(sizeof(const VkDebugUtilsObjectTagInfoEXT)); |
| 21150 | deepcopy_VkDebugUtilsObjectTagInfoEXT(pool, pTagInfo, (VkDebugUtilsObjectTagInfoEXT*)(local_pTagInfo)); |
| 21151 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 21152 | if (local_pTagInfo) |
| 21153 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 21154 | transform_tohost_VkDebugUtilsObjectTagInfoEXT(mImpl->resources(), (VkDebugUtilsObjectTagInfoEXT*)(local_pTagInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 21155 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21156 | countingStream->rewind(); |
| 21157 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21158 | uint64_t cgen_var_1388; |
| 21159 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1388, 1); |
| 21160 | countingStream->write((uint64_t*)&cgen_var_1388, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21161 | marshal_VkDebugUtilsObjectTagInfoEXT(countingStream, (VkDebugUtilsObjectTagInfoEXT*)(local_pTagInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21162 | } |
| 21163 | uint32_t packetSize_vkSetDebugUtilsObjectTagEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 21164 | countingStream->rewind(); |
| 21165 | uint32_t opcode_vkSetDebugUtilsObjectTagEXT = OP_vkSetDebugUtilsObjectTagEXT; |
| 21166 | stream->write(&opcode_vkSetDebugUtilsObjectTagEXT, sizeof(uint32_t)); |
| 21167 | stream->write(&packetSize_vkSetDebugUtilsObjectTagEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21168 | uint64_t cgen_var_1389; |
| 21169 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1389, 1); |
| 21170 | stream->write((uint64_t*)&cgen_var_1389, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21171 | marshal_VkDebugUtilsObjectTagInfoEXT(stream, (VkDebugUtilsObjectTagInfoEXT*)(local_pTagInfo)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 21172 | AEMU_SCOPED_TRACE("vkSetDebugUtilsObjectTagEXT readParams"); |
| 21173 | AEMU_SCOPED_TRACE("vkSetDebugUtilsObjectTagEXT returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21174 | VkResult vkSetDebugUtilsObjectTagEXT_VkResult_return = (VkResult)0; |
| 21175 | stream->read(&vkSetDebugUtilsObjectTagEXT_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 21176 | countingStream->clearPool(); |
| 21177 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 21178 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 21179 | mImpl->log("finish vkSetDebugUtilsObjectTagEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21180 | return vkSetDebugUtilsObjectTagEXT_VkResult_return; |
| 21181 | } |
| 21182 | |
| 21183 | void VkEncoder::vkQueueBeginDebugUtilsLabelEXT( |
| 21184 | VkQueue queue, |
| 21185 | const VkDebugUtilsLabelEXT* pLabelInfo) |
| 21186 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 21187 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 21188 | AEMU_SCOPED_TRACE("vkQueueBeginDebugUtilsLabelEXT encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 21189 | mImpl->log("start vkQueueBeginDebugUtilsLabelEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21190 | auto stream = mImpl->stream(); |
| 21191 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21192 | auto resources = mImpl->resources(); |
| 21193 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 21194 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21195 | VkQueue local_queue; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21196 | VkDebugUtilsLabelEXT* local_pLabelInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 21197 | local_queue = queue; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21198 | local_pLabelInfo = nullptr; |
| 21199 | if (pLabelInfo) |
| 21200 | { |
| 21201 | local_pLabelInfo = (VkDebugUtilsLabelEXT*)pool->alloc(sizeof(const VkDebugUtilsLabelEXT)); |
| 21202 | deepcopy_VkDebugUtilsLabelEXT(pool, pLabelInfo, (VkDebugUtilsLabelEXT*)(local_pLabelInfo)); |
| 21203 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 21204 | if (local_pLabelInfo) |
| 21205 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 21206 | transform_tohost_VkDebugUtilsLabelEXT(mImpl->resources(), (VkDebugUtilsLabelEXT*)(local_pLabelInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 21207 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21208 | countingStream->rewind(); |
| 21209 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21210 | uint64_t cgen_var_1390; |
| 21211 | countingStream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_1390, 1); |
| 21212 | countingStream->write((uint64_t*)&cgen_var_1390, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21213 | marshal_VkDebugUtilsLabelEXT(countingStream, (VkDebugUtilsLabelEXT*)(local_pLabelInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21214 | } |
| 21215 | uint32_t packetSize_vkQueueBeginDebugUtilsLabelEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 21216 | countingStream->rewind(); |
| 21217 | uint32_t opcode_vkQueueBeginDebugUtilsLabelEXT = OP_vkQueueBeginDebugUtilsLabelEXT; |
| 21218 | stream->write(&opcode_vkQueueBeginDebugUtilsLabelEXT, sizeof(uint32_t)); |
| 21219 | stream->write(&packetSize_vkQueueBeginDebugUtilsLabelEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21220 | uint64_t cgen_var_1391; |
| 21221 | stream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_1391, 1); |
| 21222 | stream->write((uint64_t*)&cgen_var_1391, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21223 | marshal_VkDebugUtilsLabelEXT(stream, (VkDebugUtilsLabelEXT*)(local_pLabelInfo)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 21224 | AEMU_SCOPED_TRACE("vkQueueBeginDebugUtilsLabelEXT readParams"); |
| 21225 | AEMU_SCOPED_TRACE("vkQueueBeginDebugUtilsLabelEXT returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 21226 | mImpl->log("finish vkQueueBeginDebugUtilsLabelEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21227 | } |
| 21228 | |
| 21229 | void VkEncoder::vkQueueEndDebugUtilsLabelEXT( |
| 21230 | VkQueue queue) |
| 21231 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 21232 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 21233 | AEMU_SCOPED_TRACE("vkQueueEndDebugUtilsLabelEXT encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 21234 | mImpl->log("start vkQueueEndDebugUtilsLabelEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21235 | auto stream = mImpl->stream(); |
| 21236 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21237 | auto resources = mImpl->resources(); |
| 21238 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 21239 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21240 | VkQueue local_queue; |
| 21241 | local_queue = queue; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21242 | countingStream->rewind(); |
| 21243 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21244 | uint64_t cgen_var_1392; |
| 21245 | countingStream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_1392, 1); |
| 21246 | countingStream->write((uint64_t*)&cgen_var_1392, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21247 | } |
| 21248 | uint32_t packetSize_vkQueueEndDebugUtilsLabelEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 21249 | countingStream->rewind(); |
| 21250 | uint32_t opcode_vkQueueEndDebugUtilsLabelEXT = OP_vkQueueEndDebugUtilsLabelEXT; |
| 21251 | stream->write(&opcode_vkQueueEndDebugUtilsLabelEXT, sizeof(uint32_t)); |
| 21252 | stream->write(&packetSize_vkQueueEndDebugUtilsLabelEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21253 | uint64_t cgen_var_1393; |
| 21254 | stream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_1393, 1); |
| 21255 | stream->write((uint64_t*)&cgen_var_1393, 1 * 8); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 21256 | AEMU_SCOPED_TRACE("vkQueueEndDebugUtilsLabelEXT readParams"); |
| 21257 | AEMU_SCOPED_TRACE("vkQueueEndDebugUtilsLabelEXT returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 21258 | mImpl->log("finish vkQueueEndDebugUtilsLabelEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21259 | } |
| 21260 | |
| 21261 | void VkEncoder::vkQueueInsertDebugUtilsLabelEXT( |
| 21262 | VkQueue queue, |
| 21263 | const VkDebugUtilsLabelEXT* pLabelInfo) |
| 21264 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 21265 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 21266 | AEMU_SCOPED_TRACE("vkQueueInsertDebugUtilsLabelEXT encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 21267 | mImpl->log("start vkQueueInsertDebugUtilsLabelEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21268 | auto stream = mImpl->stream(); |
| 21269 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21270 | auto resources = mImpl->resources(); |
| 21271 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 21272 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21273 | VkQueue local_queue; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21274 | VkDebugUtilsLabelEXT* local_pLabelInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 21275 | local_queue = queue; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21276 | local_pLabelInfo = nullptr; |
| 21277 | if (pLabelInfo) |
| 21278 | { |
| 21279 | local_pLabelInfo = (VkDebugUtilsLabelEXT*)pool->alloc(sizeof(const VkDebugUtilsLabelEXT)); |
| 21280 | deepcopy_VkDebugUtilsLabelEXT(pool, pLabelInfo, (VkDebugUtilsLabelEXT*)(local_pLabelInfo)); |
| 21281 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 21282 | if (local_pLabelInfo) |
| 21283 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 21284 | transform_tohost_VkDebugUtilsLabelEXT(mImpl->resources(), (VkDebugUtilsLabelEXT*)(local_pLabelInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 21285 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21286 | countingStream->rewind(); |
| 21287 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21288 | uint64_t cgen_var_1394; |
| 21289 | countingStream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_1394, 1); |
| 21290 | countingStream->write((uint64_t*)&cgen_var_1394, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21291 | marshal_VkDebugUtilsLabelEXT(countingStream, (VkDebugUtilsLabelEXT*)(local_pLabelInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21292 | } |
| 21293 | uint32_t packetSize_vkQueueInsertDebugUtilsLabelEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 21294 | countingStream->rewind(); |
| 21295 | uint32_t opcode_vkQueueInsertDebugUtilsLabelEXT = OP_vkQueueInsertDebugUtilsLabelEXT; |
| 21296 | stream->write(&opcode_vkQueueInsertDebugUtilsLabelEXT, sizeof(uint32_t)); |
| 21297 | stream->write(&packetSize_vkQueueInsertDebugUtilsLabelEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21298 | uint64_t cgen_var_1395; |
| 21299 | stream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_1395, 1); |
| 21300 | stream->write((uint64_t*)&cgen_var_1395, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21301 | marshal_VkDebugUtilsLabelEXT(stream, (VkDebugUtilsLabelEXT*)(local_pLabelInfo)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 21302 | AEMU_SCOPED_TRACE("vkQueueInsertDebugUtilsLabelEXT readParams"); |
| 21303 | AEMU_SCOPED_TRACE("vkQueueInsertDebugUtilsLabelEXT returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 21304 | mImpl->log("finish vkQueueInsertDebugUtilsLabelEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21305 | } |
| 21306 | |
| 21307 | void VkEncoder::vkCmdBeginDebugUtilsLabelEXT( |
| 21308 | VkCommandBuffer commandBuffer, |
| 21309 | const VkDebugUtilsLabelEXT* pLabelInfo) |
| 21310 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 21311 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 21312 | AEMU_SCOPED_TRACE("vkCmdBeginDebugUtilsLabelEXT encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 21313 | mImpl->log("start vkCmdBeginDebugUtilsLabelEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21314 | auto stream = mImpl->stream(); |
| 21315 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21316 | auto resources = mImpl->resources(); |
| 21317 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 21318 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21319 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21320 | VkDebugUtilsLabelEXT* local_pLabelInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 21321 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21322 | local_pLabelInfo = nullptr; |
| 21323 | if (pLabelInfo) |
| 21324 | { |
| 21325 | local_pLabelInfo = (VkDebugUtilsLabelEXT*)pool->alloc(sizeof(const VkDebugUtilsLabelEXT)); |
| 21326 | deepcopy_VkDebugUtilsLabelEXT(pool, pLabelInfo, (VkDebugUtilsLabelEXT*)(local_pLabelInfo)); |
| 21327 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 21328 | if (local_pLabelInfo) |
| 21329 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 21330 | transform_tohost_VkDebugUtilsLabelEXT(mImpl->resources(), (VkDebugUtilsLabelEXT*)(local_pLabelInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 21331 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21332 | countingStream->rewind(); |
| 21333 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21334 | uint64_t cgen_var_1396; |
| 21335 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1396, 1); |
| 21336 | countingStream->write((uint64_t*)&cgen_var_1396, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21337 | marshal_VkDebugUtilsLabelEXT(countingStream, (VkDebugUtilsLabelEXT*)(local_pLabelInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21338 | } |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 21339 | uint32_t packetSize_vkCmdBeginDebugUtilsLabelEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 21340 | countingStream->rewind(); |
| 21341 | uint32_t opcode_vkCmdBeginDebugUtilsLabelEXT = OP_vkCmdBeginDebugUtilsLabelEXT; |
| 21342 | stream->write(&opcode_vkCmdBeginDebugUtilsLabelEXT, sizeof(uint32_t)); |
| 21343 | stream->write(&packetSize_vkCmdBeginDebugUtilsLabelEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21344 | uint64_t cgen_var_1397; |
| 21345 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1397, 1); |
| 21346 | stream->write((uint64_t*)&cgen_var_1397, 1 * 8); |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 21347 | marshal_VkDebugUtilsLabelEXT(stream, (VkDebugUtilsLabelEXT*)(local_pLabelInfo)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 21348 | AEMU_SCOPED_TRACE("vkCmdBeginDebugUtilsLabelEXT readParams"); |
| 21349 | AEMU_SCOPED_TRACE("vkCmdBeginDebugUtilsLabelEXT returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 21350 | mImpl->log("finish vkCmdBeginDebugUtilsLabelEXT");; |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 21351 | } |
| 21352 | |
| 21353 | void VkEncoder::vkCmdEndDebugUtilsLabelEXT( |
| 21354 | VkCommandBuffer commandBuffer) |
| 21355 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 21356 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 21357 | AEMU_SCOPED_TRACE("vkCmdEndDebugUtilsLabelEXT encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 21358 | mImpl->log("start vkCmdEndDebugUtilsLabelEXT"); |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 21359 | auto stream = mImpl->stream(); |
| 21360 | auto countingStream = mImpl->countingStream(); |
| 21361 | auto resources = mImpl->resources(); |
| 21362 | auto pool = mImpl->pool(); |
| 21363 | stream->setHandleMapping(resources->unwrapMapping()); |
| 21364 | VkCommandBuffer local_commandBuffer; |
| 21365 | local_commandBuffer = commandBuffer; |
| 21366 | countingStream->rewind(); |
| 21367 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21368 | uint64_t cgen_var_1398; |
| 21369 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1398, 1); |
| 21370 | countingStream->write((uint64_t*)&cgen_var_1398, 1 * 8); |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 21371 | } |
| 21372 | uint32_t packetSize_vkCmdEndDebugUtilsLabelEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 21373 | countingStream->rewind(); |
| 21374 | uint32_t opcode_vkCmdEndDebugUtilsLabelEXT = OP_vkCmdEndDebugUtilsLabelEXT; |
| 21375 | stream->write(&opcode_vkCmdEndDebugUtilsLabelEXT, sizeof(uint32_t)); |
| 21376 | stream->write(&packetSize_vkCmdEndDebugUtilsLabelEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21377 | uint64_t cgen_var_1399; |
| 21378 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1399, 1); |
| 21379 | stream->write((uint64_t*)&cgen_var_1399, 1 * 8); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 21380 | AEMU_SCOPED_TRACE("vkCmdEndDebugUtilsLabelEXT readParams"); |
| 21381 | AEMU_SCOPED_TRACE("vkCmdEndDebugUtilsLabelEXT returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 21382 | mImpl->log("finish vkCmdEndDebugUtilsLabelEXT");; |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 21383 | } |
| 21384 | |
| 21385 | void VkEncoder::vkCmdInsertDebugUtilsLabelEXT( |
| 21386 | VkCommandBuffer commandBuffer, |
| 21387 | const VkDebugUtilsLabelEXT* pLabelInfo) |
| 21388 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 21389 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 21390 | AEMU_SCOPED_TRACE("vkCmdInsertDebugUtilsLabelEXT encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 21391 | mImpl->log("start vkCmdInsertDebugUtilsLabelEXT"); |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 21392 | auto stream = mImpl->stream(); |
| 21393 | auto countingStream = mImpl->countingStream(); |
| 21394 | auto resources = mImpl->resources(); |
| 21395 | auto pool = mImpl->pool(); |
| 21396 | stream->setHandleMapping(resources->unwrapMapping()); |
| 21397 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 21398 | VkDebugUtilsLabelEXT* local_pLabelInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 21399 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 21400 | local_pLabelInfo = nullptr; |
| 21401 | if (pLabelInfo) |
| 21402 | { |
| 21403 | local_pLabelInfo = (VkDebugUtilsLabelEXT*)pool->alloc(sizeof(const VkDebugUtilsLabelEXT)); |
| 21404 | deepcopy_VkDebugUtilsLabelEXT(pool, pLabelInfo, (VkDebugUtilsLabelEXT*)(local_pLabelInfo)); |
| 21405 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 21406 | if (local_pLabelInfo) |
| 21407 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 21408 | transform_tohost_VkDebugUtilsLabelEXT(mImpl->resources(), (VkDebugUtilsLabelEXT*)(local_pLabelInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 21409 | } |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 21410 | countingStream->rewind(); |
| 21411 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21412 | uint64_t cgen_var_1400; |
| 21413 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1400, 1); |
| 21414 | countingStream->write((uint64_t*)&cgen_var_1400, 1 * 8); |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 21415 | marshal_VkDebugUtilsLabelEXT(countingStream, (VkDebugUtilsLabelEXT*)(local_pLabelInfo)); |
| 21416 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21417 | uint32_t packetSize_vkCmdInsertDebugUtilsLabelEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 21418 | countingStream->rewind(); |
| 21419 | uint32_t opcode_vkCmdInsertDebugUtilsLabelEXT = OP_vkCmdInsertDebugUtilsLabelEXT; |
| 21420 | stream->write(&opcode_vkCmdInsertDebugUtilsLabelEXT, sizeof(uint32_t)); |
| 21421 | stream->write(&packetSize_vkCmdInsertDebugUtilsLabelEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21422 | uint64_t cgen_var_1401; |
| 21423 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1401, 1); |
| 21424 | stream->write((uint64_t*)&cgen_var_1401, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21425 | marshal_VkDebugUtilsLabelEXT(stream, (VkDebugUtilsLabelEXT*)(local_pLabelInfo)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 21426 | AEMU_SCOPED_TRACE("vkCmdInsertDebugUtilsLabelEXT readParams"); |
| 21427 | AEMU_SCOPED_TRACE("vkCmdInsertDebugUtilsLabelEXT returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 21428 | mImpl->log("finish vkCmdInsertDebugUtilsLabelEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21429 | } |
| 21430 | |
| 21431 | VkResult VkEncoder::vkCreateDebugUtilsMessengerEXT( |
| 21432 | VkInstance instance, |
| 21433 | const VkDebugUtilsMessengerCreateInfoEXT* pCreateInfo, |
| 21434 | const VkAllocationCallbacks* pAllocator, |
| 21435 | VkDebugUtilsMessengerEXT* pMessenger) |
| 21436 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 21437 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 21438 | AEMU_SCOPED_TRACE("vkCreateDebugUtilsMessengerEXT encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 21439 | mImpl->log("start vkCreateDebugUtilsMessengerEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21440 | auto stream = mImpl->stream(); |
| 21441 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21442 | auto resources = mImpl->resources(); |
| 21443 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 21444 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21445 | VkInstance local_instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21446 | VkDebugUtilsMessengerCreateInfoEXT* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 21447 | VkAllocationCallbacks* local_pAllocator; |
| 21448 | local_instance = instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21449 | local_pCreateInfo = nullptr; |
| 21450 | if (pCreateInfo) |
| 21451 | { |
| 21452 | local_pCreateInfo = (VkDebugUtilsMessengerCreateInfoEXT*)pool->alloc(sizeof(const VkDebugUtilsMessengerCreateInfoEXT)); |
| 21453 | deepcopy_VkDebugUtilsMessengerCreateInfoEXT(pool, pCreateInfo, (VkDebugUtilsMessengerCreateInfoEXT*)(local_pCreateInfo)); |
| 21454 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21455 | local_pAllocator = nullptr; |
| 21456 | if (pAllocator) |
| 21457 | { |
| 21458 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 21459 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 21460 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 21461 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 21462 | if (local_pCreateInfo) |
| 21463 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 21464 | transform_tohost_VkDebugUtilsMessengerCreateInfoEXT(mImpl->resources(), (VkDebugUtilsMessengerCreateInfoEXT*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 21465 | } |
| 21466 | if (local_pAllocator) |
| 21467 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 21468 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 21469 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21470 | countingStream->rewind(); |
| 21471 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21472 | uint64_t cgen_var_1402; |
| 21473 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1402, 1); |
| 21474 | countingStream->write((uint64_t*)&cgen_var_1402, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21475 | marshal_VkDebugUtilsMessengerCreateInfoEXT(countingStream, (VkDebugUtilsMessengerCreateInfoEXT*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 21476 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21477 | uint64_t cgen_var_1403 = (uint64_t)(uintptr_t)local_pAllocator; |
| 21478 | countingStream->putBe64(cgen_var_1403); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21479 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21480 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21481 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21482 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21483 | uint64_t cgen_var_1404; |
| 21484 | countingStream->handleMapping()->mapHandles_VkDebugUtilsMessengerEXT_u64(pMessenger, &cgen_var_1404, 1); |
| 21485 | countingStream->write((uint64_t*)&cgen_var_1404, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21486 | } |
| 21487 | uint32_t packetSize_vkCreateDebugUtilsMessengerEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 21488 | countingStream->rewind(); |
| 21489 | uint32_t opcode_vkCreateDebugUtilsMessengerEXT = OP_vkCreateDebugUtilsMessengerEXT; |
| 21490 | stream->write(&opcode_vkCreateDebugUtilsMessengerEXT, sizeof(uint32_t)); |
| 21491 | stream->write(&packetSize_vkCreateDebugUtilsMessengerEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21492 | uint64_t cgen_var_1405; |
| 21493 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1405, 1); |
| 21494 | stream->write((uint64_t*)&cgen_var_1405, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21495 | marshal_VkDebugUtilsMessengerCreateInfoEXT(stream, (VkDebugUtilsMessengerCreateInfoEXT*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 21496 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21497 | uint64_t cgen_var_1406 = (uint64_t)(uintptr_t)local_pAllocator; |
| 21498 | stream->putBe64(cgen_var_1406); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21499 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21500 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21501 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21502 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 21503 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21504 | uint64_t cgen_var_1407; |
| 21505 | stream->handleMapping()->mapHandles_VkDebugUtilsMessengerEXT_u64(pMessenger, &cgen_var_1407, 1); |
| 21506 | stream->write((uint64_t*)&cgen_var_1407, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 21507 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 21508 | AEMU_SCOPED_TRACE("vkCreateDebugUtilsMessengerEXT readParams"); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 21509 | stream->setHandleMapping(resources->createMapping()); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21510 | uint64_t cgen_var_1408; |
| 21511 | stream->read((uint64_t*)&cgen_var_1408, 8); |
| 21512 | stream->handleMapping()->mapHandles_u64_VkDebugUtilsMessengerEXT(&cgen_var_1408, (VkDebugUtilsMessengerEXT*)pMessenger, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 21513 | stream->unsetHandleMapping(); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 21514 | AEMU_SCOPED_TRACE("vkCreateDebugUtilsMessengerEXT returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21515 | VkResult vkCreateDebugUtilsMessengerEXT_VkResult_return = (VkResult)0; |
| 21516 | stream->read(&vkCreateDebugUtilsMessengerEXT_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 21517 | countingStream->clearPool(); |
| 21518 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 21519 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 21520 | mImpl->log("finish vkCreateDebugUtilsMessengerEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21521 | return vkCreateDebugUtilsMessengerEXT_VkResult_return; |
| 21522 | } |
| 21523 | |
| 21524 | void VkEncoder::vkDestroyDebugUtilsMessengerEXT( |
| 21525 | VkInstance instance, |
| 21526 | VkDebugUtilsMessengerEXT messenger, |
| 21527 | const VkAllocationCallbacks* pAllocator) |
| 21528 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 21529 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 21530 | AEMU_SCOPED_TRACE("vkDestroyDebugUtilsMessengerEXT encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 21531 | mImpl->log("start vkDestroyDebugUtilsMessengerEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21532 | auto stream = mImpl->stream(); |
| 21533 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21534 | auto resources = mImpl->resources(); |
| 21535 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 21536 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21537 | VkInstance local_instance; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 21538 | VkDebugUtilsMessengerEXT local_messenger; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21539 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 21540 | local_instance = instance; |
| 21541 | local_messenger = messenger; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21542 | local_pAllocator = nullptr; |
| 21543 | if (pAllocator) |
| 21544 | { |
| 21545 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 21546 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 21547 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 21548 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 21549 | if (local_pAllocator) |
| 21550 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 21551 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 21552 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21553 | countingStream->rewind(); |
| 21554 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21555 | uint64_t cgen_var_1409; |
| 21556 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1409, 1); |
| 21557 | countingStream->write((uint64_t*)&cgen_var_1409, 1 * 8); |
| 21558 | uint64_t cgen_var_1410; |
| 21559 | countingStream->handleMapping()->mapHandles_VkDebugUtilsMessengerEXT_u64(&local_messenger, &cgen_var_1410, 1); |
| 21560 | countingStream->write((uint64_t*)&cgen_var_1410, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 21561 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21562 | uint64_t cgen_var_1411 = (uint64_t)(uintptr_t)local_pAllocator; |
| 21563 | countingStream->putBe64(cgen_var_1411); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21564 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21565 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21566 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21567 | } |
| 21568 | } |
| 21569 | uint32_t packetSize_vkDestroyDebugUtilsMessengerEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 21570 | countingStream->rewind(); |
| 21571 | uint32_t opcode_vkDestroyDebugUtilsMessengerEXT = OP_vkDestroyDebugUtilsMessengerEXT; |
| 21572 | stream->write(&opcode_vkDestroyDebugUtilsMessengerEXT, sizeof(uint32_t)); |
| 21573 | stream->write(&packetSize_vkDestroyDebugUtilsMessengerEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21574 | uint64_t cgen_var_1412; |
| 21575 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1412, 1); |
| 21576 | stream->write((uint64_t*)&cgen_var_1412, 1 * 8); |
| 21577 | uint64_t cgen_var_1413; |
| 21578 | stream->handleMapping()->mapHandles_VkDebugUtilsMessengerEXT_u64(&local_messenger, &cgen_var_1413, 1); |
| 21579 | stream->write((uint64_t*)&cgen_var_1413, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 21580 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21581 | uint64_t cgen_var_1414 = (uint64_t)(uintptr_t)local_pAllocator; |
| 21582 | stream->putBe64(cgen_var_1414); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21583 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21584 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21585 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21586 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 21587 | AEMU_SCOPED_TRACE("vkDestroyDebugUtilsMessengerEXT readParams"); |
| 21588 | AEMU_SCOPED_TRACE("vkDestroyDebugUtilsMessengerEXT returnUnmarshal"); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21589 | resources->destroyMapping()->mapHandles_VkDebugUtilsMessengerEXT((VkDebugUtilsMessengerEXT*)&messenger); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 21590 | mImpl->log("finish vkDestroyDebugUtilsMessengerEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21591 | } |
| 21592 | |
| 21593 | void VkEncoder::vkSubmitDebugUtilsMessageEXT( |
| 21594 | VkInstance instance, |
| 21595 | VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity, |
| 21596 | VkDebugUtilsMessageTypeFlagsEXT messageTypes, |
| 21597 | const VkDebugUtilsMessengerCallbackDataEXT* pCallbackData) |
| 21598 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 21599 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 21600 | AEMU_SCOPED_TRACE("vkSubmitDebugUtilsMessageEXT encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 21601 | mImpl->log("start vkSubmitDebugUtilsMessageEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21602 | auto stream = mImpl->stream(); |
| 21603 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21604 | auto resources = mImpl->resources(); |
| 21605 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 21606 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21607 | VkInstance local_instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21608 | VkDebugUtilsMessageSeverityFlagBitsEXT local_messageSeverity; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21609 | VkDebugUtilsMessageTypeFlagsEXT local_messageTypes; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21610 | VkDebugUtilsMessengerCallbackDataEXT* local_pCallbackData; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 21611 | local_instance = instance; |
| 21612 | local_messageSeverity = messageSeverity; |
| 21613 | local_messageTypes = messageTypes; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21614 | local_pCallbackData = nullptr; |
| 21615 | if (pCallbackData) |
| 21616 | { |
| 21617 | local_pCallbackData = (VkDebugUtilsMessengerCallbackDataEXT*)pool->alloc(sizeof(const VkDebugUtilsMessengerCallbackDataEXT)); |
| 21618 | deepcopy_VkDebugUtilsMessengerCallbackDataEXT(pool, pCallbackData, (VkDebugUtilsMessengerCallbackDataEXT*)(local_pCallbackData)); |
| 21619 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 21620 | if (local_pCallbackData) |
| 21621 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 21622 | transform_tohost_VkDebugUtilsMessengerCallbackDataEXT(mImpl->resources(), (VkDebugUtilsMessengerCallbackDataEXT*)(local_pCallbackData)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 21623 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21624 | countingStream->rewind(); |
| 21625 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21626 | uint64_t cgen_var_1415; |
| 21627 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1415, 1); |
| 21628 | countingStream->write((uint64_t*)&cgen_var_1415, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21629 | countingStream->write((VkDebugUtilsMessageSeverityFlagBitsEXT*)&local_messageSeverity, sizeof(VkDebugUtilsMessageSeverityFlagBitsEXT)); |
| 21630 | countingStream->write((VkDebugUtilsMessageTypeFlagsEXT*)&local_messageTypes, sizeof(VkDebugUtilsMessageTypeFlagsEXT)); |
| 21631 | marshal_VkDebugUtilsMessengerCallbackDataEXT(countingStream, (VkDebugUtilsMessengerCallbackDataEXT*)(local_pCallbackData)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21632 | } |
| 21633 | uint32_t packetSize_vkSubmitDebugUtilsMessageEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 21634 | countingStream->rewind(); |
| 21635 | uint32_t opcode_vkSubmitDebugUtilsMessageEXT = OP_vkSubmitDebugUtilsMessageEXT; |
| 21636 | stream->write(&opcode_vkSubmitDebugUtilsMessageEXT, sizeof(uint32_t)); |
| 21637 | stream->write(&packetSize_vkSubmitDebugUtilsMessageEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21638 | uint64_t cgen_var_1416; |
| 21639 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1416, 1); |
| 21640 | stream->write((uint64_t*)&cgen_var_1416, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21641 | stream->write((VkDebugUtilsMessageSeverityFlagBitsEXT*)&local_messageSeverity, sizeof(VkDebugUtilsMessageSeverityFlagBitsEXT)); |
| 21642 | stream->write((VkDebugUtilsMessageTypeFlagsEXT*)&local_messageTypes, sizeof(VkDebugUtilsMessageTypeFlagsEXT)); |
| 21643 | marshal_VkDebugUtilsMessengerCallbackDataEXT(stream, (VkDebugUtilsMessengerCallbackDataEXT*)(local_pCallbackData)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 21644 | AEMU_SCOPED_TRACE("vkSubmitDebugUtilsMessageEXT readParams"); |
| 21645 | AEMU_SCOPED_TRACE("vkSubmitDebugUtilsMessageEXT returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 21646 | mImpl->log("finish vkSubmitDebugUtilsMessageEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21647 | } |
| 21648 | |
| 21649 | #endif |
| 21650 | #ifdef VK_ANDROID_external_memory_android_hardware_buffer |
| 21651 | VkResult VkEncoder::vkGetAndroidHardwareBufferPropertiesANDROID( |
| 21652 | VkDevice device, |
| 21653 | const AHardwareBuffer* buffer, |
| 21654 | VkAndroidHardwareBufferPropertiesANDROID* pProperties) |
| 21655 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 21656 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 21657 | AEMU_SCOPED_TRACE("vkGetAndroidHardwareBufferPropertiesANDROID encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 21658 | mImpl->log("start vkGetAndroidHardwareBufferPropertiesANDROID"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21659 | auto stream = mImpl->stream(); |
| 21660 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21661 | auto resources = mImpl->resources(); |
| 21662 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 21663 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21664 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21665 | AHardwareBuffer* local_buffer; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 21666 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21667 | local_buffer = nullptr; |
| 21668 | if (buffer) |
| 21669 | { |
| 21670 | local_buffer = (AHardwareBuffer*)pool->dupArray(buffer, sizeof(const AHardwareBuffer)); |
| 21671 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21672 | countingStream->rewind(); |
| 21673 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21674 | uint64_t cgen_var_1417; |
| 21675 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1417, 1); |
| 21676 | countingStream->write((uint64_t*)&cgen_var_1417, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21677 | countingStream->write((AHardwareBuffer*)local_buffer, sizeof(AHardwareBuffer)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21678 | marshal_VkAndroidHardwareBufferPropertiesANDROID(countingStream, (VkAndroidHardwareBufferPropertiesANDROID*)(pProperties)); |
| 21679 | } |
| 21680 | uint32_t packetSize_vkGetAndroidHardwareBufferPropertiesANDROID = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 21681 | countingStream->rewind(); |
| 21682 | uint32_t opcode_vkGetAndroidHardwareBufferPropertiesANDROID = OP_vkGetAndroidHardwareBufferPropertiesANDROID; |
| 21683 | stream->write(&opcode_vkGetAndroidHardwareBufferPropertiesANDROID, sizeof(uint32_t)); |
| 21684 | stream->write(&packetSize_vkGetAndroidHardwareBufferPropertiesANDROID, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21685 | uint64_t cgen_var_1418; |
| 21686 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1418, 1); |
| 21687 | stream->write((uint64_t*)&cgen_var_1418, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21688 | stream->write((AHardwareBuffer*)local_buffer, sizeof(AHardwareBuffer)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21689 | marshal_VkAndroidHardwareBufferPropertiesANDROID(stream, (VkAndroidHardwareBufferPropertiesANDROID*)(pProperties)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 21690 | AEMU_SCOPED_TRACE("vkGetAndroidHardwareBufferPropertiesANDROID readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21691 | unmarshal_VkAndroidHardwareBufferPropertiesANDROID(stream, (VkAndroidHardwareBufferPropertiesANDROID*)(pProperties)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 21692 | if (pProperties) |
| 21693 | { |
| 21694 | transform_fromhost_VkAndroidHardwareBufferPropertiesANDROID(mImpl->resources(), (VkAndroidHardwareBufferPropertiesANDROID*)(pProperties)); |
| 21695 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 21696 | AEMU_SCOPED_TRACE("vkGetAndroidHardwareBufferPropertiesANDROID returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21697 | VkResult vkGetAndroidHardwareBufferPropertiesANDROID_VkResult_return = (VkResult)0; |
| 21698 | stream->read(&vkGetAndroidHardwareBufferPropertiesANDROID_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 21699 | countingStream->clearPool(); |
| 21700 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 21701 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 21702 | mImpl->log("finish vkGetAndroidHardwareBufferPropertiesANDROID");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21703 | return vkGetAndroidHardwareBufferPropertiesANDROID_VkResult_return; |
| 21704 | } |
| 21705 | |
| 21706 | VkResult VkEncoder::vkGetMemoryAndroidHardwareBufferANDROID( |
| 21707 | VkDevice device, |
| 21708 | const VkMemoryGetAndroidHardwareBufferInfoANDROID* pInfo, |
| 21709 | AHardwareBuffer** pBuffer) |
| 21710 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 21711 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 21712 | AEMU_SCOPED_TRACE("vkGetMemoryAndroidHardwareBufferANDROID encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 21713 | mImpl->log("start vkGetMemoryAndroidHardwareBufferANDROID"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21714 | auto stream = mImpl->stream(); |
| 21715 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21716 | auto resources = mImpl->resources(); |
| 21717 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 21718 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21719 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21720 | VkMemoryGetAndroidHardwareBufferInfoANDROID* local_pInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 21721 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21722 | local_pInfo = nullptr; |
| 21723 | if (pInfo) |
| 21724 | { |
| 21725 | local_pInfo = (VkMemoryGetAndroidHardwareBufferInfoANDROID*)pool->alloc(sizeof(const VkMemoryGetAndroidHardwareBufferInfoANDROID)); |
| 21726 | deepcopy_VkMemoryGetAndroidHardwareBufferInfoANDROID(pool, pInfo, (VkMemoryGetAndroidHardwareBufferInfoANDROID*)(local_pInfo)); |
| 21727 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 21728 | if (local_pInfo) |
| 21729 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 21730 | transform_tohost_VkMemoryGetAndroidHardwareBufferInfoANDROID(mImpl->resources(), (VkMemoryGetAndroidHardwareBufferInfoANDROID*)(local_pInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 21731 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21732 | countingStream->rewind(); |
| 21733 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21734 | uint64_t cgen_var_1419; |
| 21735 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1419, 1); |
| 21736 | countingStream->write((uint64_t*)&cgen_var_1419, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21737 | marshal_VkMemoryGetAndroidHardwareBufferInfoANDROID(countingStream, (VkMemoryGetAndroidHardwareBufferInfoANDROID*)(local_pInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21738 | countingStream->write((AHardwareBuffer**)pBuffer, sizeof(AHardwareBuffer*)); |
| 21739 | } |
| 21740 | uint32_t packetSize_vkGetMemoryAndroidHardwareBufferANDROID = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 21741 | countingStream->rewind(); |
| 21742 | uint32_t opcode_vkGetMemoryAndroidHardwareBufferANDROID = OP_vkGetMemoryAndroidHardwareBufferANDROID; |
| 21743 | stream->write(&opcode_vkGetMemoryAndroidHardwareBufferANDROID, sizeof(uint32_t)); |
| 21744 | stream->write(&packetSize_vkGetMemoryAndroidHardwareBufferANDROID, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21745 | uint64_t cgen_var_1420; |
| 21746 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1420, 1); |
| 21747 | stream->write((uint64_t*)&cgen_var_1420, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21748 | marshal_VkMemoryGetAndroidHardwareBufferInfoANDROID(stream, (VkMemoryGetAndroidHardwareBufferInfoANDROID*)(local_pInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21749 | stream->write((AHardwareBuffer**)pBuffer, sizeof(AHardwareBuffer*)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 21750 | AEMU_SCOPED_TRACE("vkGetMemoryAndroidHardwareBufferANDROID readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21751 | stream->read((AHardwareBuffer**)pBuffer, sizeof(AHardwareBuffer*)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 21752 | AEMU_SCOPED_TRACE("vkGetMemoryAndroidHardwareBufferANDROID returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21753 | VkResult vkGetMemoryAndroidHardwareBufferANDROID_VkResult_return = (VkResult)0; |
| 21754 | stream->read(&vkGetMemoryAndroidHardwareBufferANDROID_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 21755 | countingStream->clearPool(); |
| 21756 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 21757 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 21758 | mImpl->log("finish vkGetMemoryAndroidHardwareBufferANDROID");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21759 | return vkGetMemoryAndroidHardwareBufferANDROID_VkResult_return; |
| 21760 | } |
| 21761 | |
| 21762 | #endif |
| 21763 | #ifdef VK_EXT_sampler_filter_minmax |
| 21764 | #endif |
| 21765 | #ifdef VK_AMD_gpu_shader_int16 |
| 21766 | #endif |
| 21767 | #ifdef VK_AMD_mixed_attachment_samples |
| 21768 | #endif |
| 21769 | #ifdef VK_AMD_shader_fragment_mask |
| 21770 | #endif |
| 21771 | #ifdef VK_EXT_shader_stencil_export |
| 21772 | #endif |
| 21773 | #ifdef VK_EXT_sample_locations |
| 21774 | void VkEncoder::vkCmdSetSampleLocationsEXT( |
| 21775 | VkCommandBuffer commandBuffer, |
| 21776 | const VkSampleLocationsInfoEXT* pSampleLocationsInfo) |
| 21777 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 21778 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 21779 | AEMU_SCOPED_TRACE("vkCmdSetSampleLocationsEXT encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 21780 | mImpl->log("start vkCmdSetSampleLocationsEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21781 | auto stream = mImpl->stream(); |
| 21782 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21783 | auto resources = mImpl->resources(); |
| 21784 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 21785 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21786 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21787 | VkSampleLocationsInfoEXT* local_pSampleLocationsInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 21788 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21789 | local_pSampleLocationsInfo = nullptr; |
| 21790 | if (pSampleLocationsInfo) |
| 21791 | { |
| 21792 | local_pSampleLocationsInfo = (VkSampleLocationsInfoEXT*)pool->alloc(sizeof(const VkSampleLocationsInfoEXT)); |
| 21793 | deepcopy_VkSampleLocationsInfoEXT(pool, pSampleLocationsInfo, (VkSampleLocationsInfoEXT*)(local_pSampleLocationsInfo)); |
| 21794 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 21795 | if (local_pSampleLocationsInfo) |
| 21796 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 21797 | transform_tohost_VkSampleLocationsInfoEXT(mImpl->resources(), (VkSampleLocationsInfoEXT*)(local_pSampleLocationsInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 21798 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21799 | countingStream->rewind(); |
| 21800 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21801 | uint64_t cgen_var_1421; |
| 21802 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1421, 1); |
| 21803 | countingStream->write((uint64_t*)&cgen_var_1421, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21804 | marshal_VkSampleLocationsInfoEXT(countingStream, (VkSampleLocationsInfoEXT*)(local_pSampleLocationsInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21805 | } |
| 21806 | uint32_t packetSize_vkCmdSetSampleLocationsEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 21807 | countingStream->rewind(); |
| 21808 | uint32_t opcode_vkCmdSetSampleLocationsEXT = OP_vkCmdSetSampleLocationsEXT; |
| 21809 | stream->write(&opcode_vkCmdSetSampleLocationsEXT, sizeof(uint32_t)); |
| 21810 | stream->write(&packetSize_vkCmdSetSampleLocationsEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21811 | uint64_t cgen_var_1422; |
| 21812 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1422, 1); |
| 21813 | stream->write((uint64_t*)&cgen_var_1422, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21814 | marshal_VkSampleLocationsInfoEXT(stream, (VkSampleLocationsInfoEXT*)(local_pSampleLocationsInfo)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 21815 | AEMU_SCOPED_TRACE("vkCmdSetSampleLocationsEXT readParams"); |
| 21816 | AEMU_SCOPED_TRACE("vkCmdSetSampleLocationsEXT returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 21817 | mImpl->log("finish vkCmdSetSampleLocationsEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21818 | } |
| 21819 | |
| 21820 | void VkEncoder::vkGetPhysicalDeviceMultisamplePropertiesEXT( |
| 21821 | VkPhysicalDevice physicalDevice, |
| 21822 | VkSampleCountFlagBits samples, |
| 21823 | VkMultisamplePropertiesEXT* pMultisampleProperties) |
| 21824 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 21825 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 21826 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceMultisamplePropertiesEXT encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 21827 | mImpl->log("start vkGetPhysicalDeviceMultisamplePropertiesEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21828 | auto stream = mImpl->stream(); |
| 21829 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21830 | auto resources = mImpl->resources(); |
| 21831 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 21832 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21833 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21834 | VkSampleCountFlagBits local_samples; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 21835 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21836 | local_samples = samples; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21837 | countingStream->rewind(); |
| 21838 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21839 | uint64_t cgen_var_1423; |
| 21840 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1423, 1); |
| 21841 | countingStream->write((uint64_t*)&cgen_var_1423, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21842 | countingStream->write((VkSampleCountFlagBits*)&local_samples, sizeof(VkSampleCountFlagBits)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21843 | marshal_VkMultisamplePropertiesEXT(countingStream, (VkMultisamplePropertiesEXT*)(pMultisampleProperties)); |
| 21844 | } |
| 21845 | uint32_t packetSize_vkGetPhysicalDeviceMultisamplePropertiesEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 21846 | countingStream->rewind(); |
| 21847 | uint32_t opcode_vkGetPhysicalDeviceMultisamplePropertiesEXT = OP_vkGetPhysicalDeviceMultisamplePropertiesEXT; |
| 21848 | stream->write(&opcode_vkGetPhysicalDeviceMultisamplePropertiesEXT, sizeof(uint32_t)); |
| 21849 | stream->write(&packetSize_vkGetPhysicalDeviceMultisamplePropertiesEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21850 | uint64_t cgen_var_1424; |
| 21851 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1424, 1); |
| 21852 | stream->write((uint64_t*)&cgen_var_1424, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21853 | stream->write((VkSampleCountFlagBits*)&local_samples, sizeof(VkSampleCountFlagBits)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21854 | marshal_VkMultisamplePropertiesEXT(stream, (VkMultisamplePropertiesEXT*)(pMultisampleProperties)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 21855 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceMultisamplePropertiesEXT readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21856 | unmarshal_VkMultisamplePropertiesEXT(stream, (VkMultisamplePropertiesEXT*)(pMultisampleProperties)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 21857 | if (pMultisampleProperties) |
| 21858 | { |
| 21859 | transform_fromhost_VkMultisamplePropertiesEXT(mImpl->resources(), (VkMultisamplePropertiesEXT*)(pMultisampleProperties)); |
| 21860 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 21861 | AEMU_SCOPED_TRACE("vkGetPhysicalDeviceMultisamplePropertiesEXT returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 21862 | mImpl->log("finish vkGetPhysicalDeviceMultisamplePropertiesEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21863 | } |
| 21864 | |
| 21865 | #endif |
| 21866 | #ifdef VK_EXT_blend_operation_advanced |
| 21867 | #endif |
| 21868 | #ifdef VK_NV_fragment_coverage_to_color |
| 21869 | #endif |
| 21870 | #ifdef VK_NV_framebuffer_mixed_samples |
| 21871 | #endif |
| 21872 | #ifdef VK_NV_fill_rectangle |
| 21873 | #endif |
| 21874 | #ifdef VK_EXT_post_depth_coverage |
| 21875 | #endif |
| 21876 | #ifdef VK_EXT_validation_cache |
| 21877 | VkResult VkEncoder::vkCreateValidationCacheEXT( |
| 21878 | VkDevice device, |
| 21879 | const VkValidationCacheCreateInfoEXT* pCreateInfo, |
| 21880 | const VkAllocationCallbacks* pAllocator, |
| 21881 | VkValidationCacheEXT* pValidationCache) |
| 21882 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 21883 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 21884 | AEMU_SCOPED_TRACE("vkCreateValidationCacheEXT encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 21885 | mImpl->log("start vkCreateValidationCacheEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21886 | auto stream = mImpl->stream(); |
| 21887 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21888 | auto resources = mImpl->resources(); |
| 21889 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 21890 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21891 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21892 | VkValidationCacheCreateInfoEXT* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 21893 | VkAllocationCallbacks* local_pAllocator; |
| 21894 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21895 | local_pCreateInfo = nullptr; |
| 21896 | if (pCreateInfo) |
| 21897 | { |
| 21898 | local_pCreateInfo = (VkValidationCacheCreateInfoEXT*)pool->alloc(sizeof(const VkValidationCacheCreateInfoEXT)); |
| 21899 | deepcopy_VkValidationCacheCreateInfoEXT(pool, pCreateInfo, (VkValidationCacheCreateInfoEXT*)(local_pCreateInfo)); |
| 21900 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21901 | local_pAllocator = nullptr; |
| 21902 | if (pAllocator) |
| 21903 | { |
| 21904 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 21905 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 21906 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 21907 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 21908 | if (local_pCreateInfo) |
| 21909 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 21910 | transform_tohost_VkValidationCacheCreateInfoEXT(mImpl->resources(), (VkValidationCacheCreateInfoEXT*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 21911 | } |
| 21912 | if (local_pAllocator) |
| 21913 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 21914 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 21915 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21916 | countingStream->rewind(); |
| 21917 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21918 | uint64_t cgen_var_1425; |
| 21919 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1425, 1); |
| 21920 | countingStream->write((uint64_t*)&cgen_var_1425, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21921 | marshal_VkValidationCacheCreateInfoEXT(countingStream, (VkValidationCacheCreateInfoEXT*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 21922 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21923 | uint64_t cgen_var_1426 = (uint64_t)(uintptr_t)local_pAllocator; |
| 21924 | countingStream->putBe64(cgen_var_1426); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21925 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21926 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21927 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21928 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21929 | uint64_t cgen_var_1427; |
| 21930 | countingStream->handleMapping()->mapHandles_VkValidationCacheEXT_u64(pValidationCache, &cgen_var_1427, 1); |
| 21931 | countingStream->write((uint64_t*)&cgen_var_1427, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21932 | } |
| 21933 | uint32_t packetSize_vkCreateValidationCacheEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 21934 | countingStream->rewind(); |
| 21935 | uint32_t opcode_vkCreateValidationCacheEXT = OP_vkCreateValidationCacheEXT; |
| 21936 | stream->write(&opcode_vkCreateValidationCacheEXT, sizeof(uint32_t)); |
| 21937 | stream->write(&packetSize_vkCreateValidationCacheEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21938 | uint64_t cgen_var_1428; |
| 21939 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1428, 1); |
| 21940 | stream->write((uint64_t*)&cgen_var_1428, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21941 | marshal_VkValidationCacheCreateInfoEXT(stream, (VkValidationCacheCreateInfoEXT*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 21942 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21943 | uint64_t cgen_var_1429 = (uint64_t)(uintptr_t)local_pAllocator; |
| 21944 | stream->putBe64(cgen_var_1429); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21945 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21946 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21947 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21948 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 21949 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21950 | uint64_t cgen_var_1430; |
| 21951 | stream->handleMapping()->mapHandles_VkValidationCacheEXT_u64(pValidationCache, &cgen_var_1430, 1); |
| 21952 | stream->write((uint64_t*)&cgen_var_1430, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 21953 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 21954 | AEMU_SCOPED_TRACE("vkCreateValidationCacheEXT readParams"); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 21955 | stream->setHandleMapping(resources->createMapping()); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21956 | uint64_t cgen_var_1431; |
| 21957 | stream->read((uint64_t*)&cgen_var_1431, 8); |
| 21958 | stream->handleMapping()->mapHandles_u64_VkValidationCacheEXT(&cgen_var_1431, (VkValidationCacheEXT*)pValidationCache, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 21959 | stream->unsetHandleMapping(); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 21960 | AEMU_SCOPED_TRACE("vkCreateValidationCacheEXT returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21961 | VkResult vkCreateValidationCacheEXT_VkResult_return = (VkResult)0; |
| 21962 | stream->read(&vkCreateValidationCacheEXT_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 21963 | countingStream->clearPool(); |
| 21964 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 21965 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 21966 | mImpl->log("finish vkCreateValidationCacheEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21967 | return vkCreateValidationCacheEXT_VkResult_return; |
| 21968 | } |
| 21969 | |
| 21970 | void VkEncoder::vkDestroyValidationCacheEXT( |
| 21971 | VkDevice device, |
| 21972 | VkValidationCacheEXT validationCache, |
| 21973 | const VkAllocationCallbacks* pAllocator) |
| 21974 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 21975 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 21976 | AEMU_SCOPED_TRACE("vkDestroyValidationCacheEXT encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 21977 | mImpl->log("start vkDestroyValidationCacheEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21978 | auto stream = mImpl->stream(); |
| 21979 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21980 | auto resources = mImpl->resources(); |
| 21981 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 21982 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21983 | VkDevice local_device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 21984 | VkValidationCacheEXT local_validationCache; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21985 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 21986 | local_device = device; |
| 21987 | local_validationCache = validationCache; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21988 | local_pAllocator = nullptr; |
| 21989 | if (pAllocator) |
| 21990 | { |
| 21991 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 21992 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 21993 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 21994 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 21995 | if (local_pAllocator) |
| 21996 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 21997 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 21998 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21999 | countingStream->rewind(); |
| 22000 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22001 | uint64_t cgen_var_1432; |
| 22002 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1432, 1); |
| 22003 | countingStream->write((uint64_t*)&cgen_var_1432, 1 * 8); |
| 22004 | uint64_t cgen_var_1433; |
| 22005 | countingStream->handleMapping()->mapHandles_VkValidationCacheEXT_u64(&local_validationCache, &cgen_var_1433, 1); |
| 22006 | countingStream->write((uint64_t*)&cgen_var_1433, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 22007 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22008 | uint64_t cgen_var_1434 = (uint64_t)(uintptr_t)local_pAllocator; |
| 22009 | countingStream->putBe64(cgen_var_1434); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 22010 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22011 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 22012 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22013 | } |
| 22014 | } |
| 22015 | uint32_t packetSize_vkDestroyValidationCacheEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 22016 | countingStream->rewind(); |
| 22017 | uint32_t opcode_vkDestroyValidationCacheEXT = OP_vkDestroyValidationCacheEXT; |
| 22018 | stream->write(&opcode_vkDestroyValidationCacheEXT, sizeof(uint32_t)); |
| 22019 | stream->write(&packetSize_vkDestroyValidationCacheEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22020 | uint64_t cgen_var_1435; |
| 22021 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1435, 1); |
| 22022 | stream->write((uint64_t*)&cgen_var_1435, 1 * 8); |
| 22023 | uint64_t cgen_var_1436; |
| 22024 | stream->handleMapping()->mapHandles_VkValidationCacheEXT_u64(&local_validationCache, &cgen_var_1436, 1); |
| 22025 | stream->write((uint64_t*)&cgen_var_1436, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 22026 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22027 | uint64_t cgen_var_1437 = (uint64_t)(uintptr_t)local_pAllocator; |
| 22028 | stream->putBe64(cgen_var_1437); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 22029 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22030 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 22031 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22032 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 22033 | AEMU_SCOPED_TRACE("vkDestroyValidationCacheEXT readParams"); |
| 22034 | AEMU_SCOPED_TRACE("vkDestroyValidationCacheEXT returnUnmarshal"); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 22035 | resources->destroyMapping()->mapHandles_VkValidationCacheEXT((VkValidationCacheEXT*)&validationCache); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 22036 | mImpl->log("finish vkDestroyValidationCacheEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22037 | } |
| 22038 | |
| 22039 | VkResult VkEncoder::vkMergeValidationCachesEXT( |
| 22040 | VkDevice device, |
| 22041 | VkValidationCacheEXT dstCache, |
| 22042 | uint32_t srcCacheCount, |
| 22043 | const VkValidationCacheEXT* pSrcCaches) |
| 22044 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 22045 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 22046 | AEMU_SCOPED_TRACE("vkMergeValidationCachesEXT encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 22047 | mImpl->log("start vkMergeValidationCachesEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22048 | auto stream = mImpl->stream(); |
| 22049 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 22050 | auto resources = mImpl->resources(); |
| 22051 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 22052 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 22053 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 22054 | VkValidationCacheEXT local_dstCache; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 22055 | uint32_t local_srcCacheCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 22056 | VkValidationCacheEXT* local_pSrcCaches; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 22057 | local_device = device; |
| 22058 | local_dstCache = dstCache; |
| 22059 | local_srcCacheCount = srcCacheCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 22060 | local_pSrcCaches = nullptr; |
| 22061 | if (pSrcCaches) |
| 22062 | { |
| 22063 | local_pSrcCaches = (VkValidationCacheEXT*)pool->dupArray(pSrcCaches, ((srcCacheCount)) * sizeof(const VkValidationCacheEXT)); |
| 22064 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22065 | countingStream->rewind(); |
| 22066 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22067 | uint64_t cgen_var_1438; |
| 22068 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1438, 1); |
| 22069 | countingStream->write((uint64_t*)&cgen_var_1438, 1 * 8); |
| 22070 | uint64_t cgen_var_1439; |
| 22071 | countingStream->handleMapping()->mapHandles_VkValidationCacheEXT_u64(&local_dstCache, &cgen_var_1439, 1); |
| 22072 | countingStream->write((uint64_t*)&cgen_var_1439, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 22073 | countingStream->write((uint32_t*)&local_srcCacheCount, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 22074 | if (((srcCacheCount))) |
| 22075 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22076 | uint64_t* cgen_var_1440; |
| 22077 | countingStream->alloc((void**)&cgen_var_1440, ((srcCacheCount)) * 8); |
| 22078 | countingStream->handleMapping()->mapHandles_VkValidationCacheEXT_u64(local_pSrcCaches, cgen_var_1440, ((srcCacheCount))); |
| 22079 | countingStream->write((uint64_t*)cgen_var_1440, ((srcCacheCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 22080 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22081 | } |
| 22082 | uint32_t packetSize_vkMergeValidationCachesEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 22083 | countingStream->rewind(); |
| 22084 | uint32_t opcode_vkMergeValidationCachesEXT = OP_vkMergeValidationCachesEXT; |
| 22085 | stream->write(&opcode_vkMergeValidationCachesEXT, sizeof(uint32_t)); |
| 22086 | stream->write(&packetSize_vkMergeValidationCachesEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22087 | uint64_t cgen_var_1441; |
| 22088 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1441, 1); |
| 22089 | stream->write((uint64_t*)&cgen_var_1441, 1 * 8); |
| 22090 | uint64_t cgen_var_1442; |
| 22091 | stream->handleMapping()->mapHandles_VkValidationCacheEXT_u64(&local_dstCache, &cgen_var_1442, 1); |
| 22092 | stream->write((uint64_t*)&cgen_var_1442, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 22093 | stream->write((uint32_t*)&local_srcCacheCount, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 22094 | if (((srcCacheCount))) |
| 22095 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22096 | uint64_t* cgen_var_1443; |
| 22097 | stream->alloc((void**)&cgen_var_1443, ((srcCacheCount)) * 8); |
| 22098 | stream->handleMapping()->mapHandles_VkValidationCacheEXT_u64(local_pSrcCaches, cgen_var_1443, ((srcCacheCount))); |
| 22099 | stream->write((uint64_t*)cgen_var_1443, ((srcCacheCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 22100 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 22101 | AEMU_SCOPED_TRACE("vkMergeValidationCachesEXT readParams"); |
| 22102 | AEMU_SCOPED_TRACE("vkMergeValidationCachesEXT returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22103 | VkResult vkMergeValidationCachesEXT_VkResult_return = (VkResult)0; |
| 22104 | stream->read(&vkMergeValidationCachesEXT_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 22105 | countingStream->clearPool(); |
| 22106 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 22107 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 22108 | mImpl->log("finish vkMergeValidationCachesEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22109 | return vkMergeValidationCachesEXT_VkResult_return; |
| 22110 | } |
| 22111 | |
| 22112 | VkResult VkEncoder::vkGetValidationCacheDataEXT( |
| 22113 | VkDevice device, |
| 22114 | VkValidationCacheEXT validationCache, |
| 22115 | size_t* pDataSize, |
| 22116 | void* pData) |
| 22117 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 22118 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 22119 | AEMU_SCOPED_TRACE("vkGetValidationCacheDataEXT encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 22120 | mImpl->log("start vkGetValidationCacheDataEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22121 | auto stream = mImpl->stream(); |
| 22122 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 22123 | auto resources = mImpl->resources(); |
| 22124 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 22125 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 22126 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 22127 | VkValidationCacheEXT local_validationCache; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 22128 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 22129 | local_validationCache = validationCache; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22130 | countingStream->rewind(); |
| 22131 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22132 | uint64_t cgen_var_1444; |
| 22133 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1444, 1); |
| 22134 | countingStream->write((uint64_t*)&cgen_var_1444, 1 * 8); |
| 22135 | uint64_t cgen_var_1445; |
| 22136 | countingStream->handleMapping()->mapHandles_VkValidationCacheEXT_u64(&local_validationCache, &cgen_var_1445, 1); |
| 22137 | countingStream->write((uint64_t*)&cgen_var_1445, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 22138 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22139 | uint64_t cgen_var_1446 = (uint64_t)(uintptr_t)pDataSize; |
| 22140 | countingStream->putBe64(cgen_var_1446); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22141 | if (pDataSize) |
| 22142 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22143 | uint64_t cgen_var_1447 = (uint64_t)(*pDataSize); |
| 22144 | countingStream->putBe64(cgen_var_1447); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22145 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 22146 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22147 | uint64_t cgen_var_1448 = (uint64_t)(uintptr_t)pData; |
| 22148 | countingStream->putBe64(cgen_var_1448); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22149 | if (pData) |
| 22150 | { |
| 22151 | countingStream->write((void*)pData, (*(pDataSize)) * sizeof(uint8_t)); |
| 22152 | } |
| 22153 | } |
| 22154 | uint32_t packetSize_vkGetValidationCacheDataEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 22155 | countingStream->rewind(); |
| 22156 | uint32_t opcode_vkGetValidationCacheDataEXT = OP_vkGetValidationCacheDataEXT; |
| 22157 | stream->write(&opcode_vkGetValidationCacheDataEXT, sizeof(uint32_t)); |
| 22158 | stream->write(&packetSize_vkGetValidationCacheDataEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22159 | uint64_t cgen_var_1449; |
| 22160 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1449, 1); |
| 22161 | stream->write((uint64_t*)&cgen_var_1449, 1 * 8); |
| 22162 | uint64_t cgen_var_1450; |
| 22163 | stream->handleMapping()->mapHandles_VkValidationCacheEXT_u64(&local_validationCache, &cgen_var_1450, 1); |
| 22164 | stream->write((uint64_t*)&cgen_var_1450, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 22165 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22166 | uint64_t cgen_var_1451 = (uint64_t)(uintptr_t)pDataSize; |
| 22167 | stream->putBe64(cgen_var_1451); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22168 | if (pDataSize) |
| 22169 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22170 | uint64_t cgen_var_1452 = (uint64_t)(*pDataSize); |
| 22171 | stream->putBe64(cgen_var_1452); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22172 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 22173 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22174 | uint64_t cgen_var_1453 = (uint64_t)(uintptr_t)pData; |
| 22175 | stream->putBe64(cgen_var_1453); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22176 | if (pData) |
| 22177 | { |
| 22178 | stream->write((void*)pData, (*(pDataSize)) * sizeof(uint8_t)); |
| 22179 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 22180 | AEMU_SCOPED_TRACE("vkGetValidationCacheDataEXT readParams"); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 22181 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22182 | size_t* check_pDataSize; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 22183 | check_pDataSize = (size_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22184 | if (pDataSize) |
| 22185 | { |
| 22186 | if (!(check_pDataSize)) |
| 22187 | { |
| 22188 | fprintf(stderr, "fatal: pDataSize inconsistent between guest and host\n"); |
| 22189 | } |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 22190 | (*pDataSize) = (size_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22191 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 22192 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22193 | void* check_pData; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 22194 | check_pData = (void*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22195 | if (pData) |
| 22196 | { |
| 22197 | if (!(check_pData)) |
| 22198 | { |
| 22199 | fprintf(stderr, "fatal: pData inconsistent between guest and host\n"); |
| 22200 | } |
| 22201 | stream->read((void*)pData, (*(pDataSize)) * sizeof(uint8_t)); |
| 22202 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 22203 | AEMU_SCOPED_TRACE("vkGetValidationCacheDataEXT returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22204 | VkResult vkGetValidationCacheDataEXT_VkResult_return = (VkResult)0; |
| 22205 | stream->read(&vkGetValidationCacheDataEXT_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 22206 | countingStream->clearPool(); |
| 22207 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 22208 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 22209 | mImpl->log("finish vkGetValidationCacheDataEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22210 | return vkGetValidationCacheDataEXT_VkResult_return; |
| 22211 | } |
| 22212 | |
| 22213 | #endif |
| 22214 | #ifdef VK_EXT_descriptor_indexing |
| 22215 | #endif |
| 22216 | #ifdef VK_EXT_shader_viewport_index_layer |
| 22217 | #endif |
| 22218 | #ifdef VK_EXT_global_priority |
| 22219 | #endif |
| 22220 | #ifdef VK_EXT_external_memory_host |
| 22221 | VkResult VkEncoder::vkGetMemoryHostPointerPropertiesEXT( |
| 22222 | VkDevice device, |
| 22223 | VkExternalMemoryHandleTypeFlagBits handleType, |
| 22224 | const void* pHostPointer, |
| 22225 | VkMemoryHostPointerPropertiesEXT* pMemoryHostPointerProperties) |
| 22226 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 22227 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 22228 | AEMU_SCOPED_TRACE("vkGetMemoryHostPointerPropertiesEXT encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 22229 | mImpl->log("start vkGetMemoryHostPointerPropertiesEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22230 | auto stream = mImpl->stream(); |
| 22231 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 22232 | auto resources = mImpl->resources(); |
| 22233 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 22234 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 22235 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 22236 | VkExternalMemoryHandleTypeFlagBits local_handleType; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 22237 | void* local_pHostPointer; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 22238 | local_device = device; |
| 22239 | local_handleType = handleType; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 22240 | local_pHostPointer = nullptr; |
| 22241 | if (pHostPointer) |
| 22242 | { |
| 22243 | local_pHostPointer = (void*)pool->dupArray(pHostPointer, sizeof(const uint8_t)); |
| 22244 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22245 | countingStream->rewind(); |
| 22246 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22247 | uint64_t cgen_var_1457; |
| 22248 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1457, 1); |
| 22249 | countingStream->write((uint64_t*)&cgen_var_1457, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 22250 | countingStream->write((VkExternalMemoryHandleTypeFlagBits*)&local_handleType, sizeof(VkExternalMemoryHandleTypeFlagBits)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 22251 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22252 | uint64_t cgen_var_1458 = (uint64_t)(uintptr_t)local_pHostPointer; |
| 22253 | countingStream->putBe64(cgen_var_1458); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 22254 | if (local_pHostPointer) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22255 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 22256 | countingStream->write((void*)local_pHostPointer, sizeof(uint8_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22257 | } |
| 22258 | marshal_VkMemoryHostPointerPropertiesEXT(countingStream, (VkMemoryHostPointerPropertiesEXT*)(pMemoryHostPointerProperties)); |
| 22259 | } |
| 22260 | uint32_t packetSize_vkGetMemoryHostPointerPropertiesEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 22261 | countingStream->rewind(); |
| 22262 | uint32_t opcode_vkGetMemoryHostPointerPropertiesEXT = OP_vkGetMemoryHostPointerPropertiesEXT; |
| 22263 | stream->write(&opcode_vkGetMemoryHostPointerPropertiesEXT, sizeof(uint32_t)); |
| 22264 | stream->write(&packetSize_vkGetMemoryHostPointerPropertiesEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22265 | uint64_t cgen_var_1459; |
| 22266 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1459, 1); |
| 22267 | stream->write((uint64_t*)&cgen_var_1459, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 22268 | stream->write((VkExternalMemoryHandleTypeFlagBits*)&local_handleType, sizeof(VkExternalMemoryHandleTypeFlagBits)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 22269 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22270 | uint64_t cgen_var_1460 = (uint64_t)(uintptr_t)local_pHostPointer; |
| 22271 | stream->putBe64(cgen_var_1460); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 22272 | if (local_pHostPointer) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22273 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 22274 | stream->write((void*)local_pHostPointer, sizeof(uint8_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22275 | } |
| 22276 | marshal_VkMemoryHostPointerPropertiesEXT(stream, (VkMemoryHostPointerPropertiesEXT*)(pMemoryHostPointerProperties)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 22277 | AEMU_SCOPED_TRACE("vkGetMemoryHostPointerPropertiesEXT readParams"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22278 | unmarshal_VkMemoryHostPointerPropertiesEXT(stream, (VkMemoryHostPointerPropertiesEXT*)(pMemoryHostPointerProperties)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 22279 | if (pMemoryHostPointerProperties) |
| 22280 | { |
| 22281 | transform_fromhost_VkMemoryHostPointerPropertiesEXT(mImpl->resources(), (VkMemoryHostPointerPropertiesEXT*)(pMemoryHostPointerProperties)); |
| 22282 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 22283 | AEMU_SCOPED_TRACE("vkGetMemoryHostPointerPropertiesEXT returnUnmarshal"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22284 | VkResult vkGetMemoryHostPointerPropertiesEXT_VkResult_return = (VkResult)0; |
| 22285 | stream->read(&vkGetMemoryHostPointerPropertiesEXT_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 22286 | countingStream->clearPool(); |
| 22287 | stream->clearPool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 22288 | pool->freeAll(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 22289 | mImpl->log("finish vkGetMemoryHostPointerPropertiesEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22290 | return vkGetMemoryHostPointerPropertiesEXT_VkResult_return; |
| 22291 | } |
| 22292 | |
| 22293 | #endif |
| 22294 | #ifdef VK_AMD_buffer_marker |
| 22295 | void VkEncoder::vkCmdWriteBufferMarkerAMD( |
| 22296 | VkCommandBuffer commandBuffer, |
| 22297 | VkPipelineStageFlagBits pipelineStage, |
| 22298 | VkBuffer dstBuffer, |
| 22299 | VkDeviceSize dstOffset, |
| 22300 | uint32_t marker) |
| 22301 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 22302 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 22303 | AEMU_SCOPED_TRACE("vkCmdWriteBufferMarkerAMD encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 22304 | mImpl->log("start vkCmdWriteBufferMarkerAMD"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22305 | auto stream = mImpl->stream(); |
| 22306 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 22307 | auto resources = mImpl->resources(); |
| 22308 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 22309 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 22310 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 22311 | VkPipelineStageFlagBits local_pipelineStage; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 22312 | VkBuffer local_dstBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 22313 | VkDeviceSize local_dstOffset; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 22314 | uint32_t local_marker; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 22315 | local_commandBuffer = commandBuffer; |
| 22316 | local_pipelineStage = pipelineStage; |
| 22317 | local_dstBuffer = dstBuffer; |
| 22318 | local_dstOffset = dstOffset; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 22319 | local_marker = marker; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22320 | countingStream->rewind(); |
| 22321 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22322 | uint64_t cgen_var_1461; |
| 22323 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1461, 1); |
| 22324 | countingStream->write((uint64_t*)&cgen_var_1461, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 22325 | countingStream->write((VkPipelineStageFlagBits*)&local_pipelineStage, sizeof(VkPipelineStageFlagBits)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22326 | uint64_t cgen_var_1462; |
| 22327 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_dstBuffer, &cgen_var_1462, 1); |
| 22328 | countingStream->write((uint64_t*)&cgen_var_1462, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 22329 | countingStream->write((VkDeviceSize*)&local_dstOffset, sizeof(VkDeviceSize)); |
| 22330 | countingStream->write((uint32_t*)&local_marker, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22331 | } |
| 22332 | uint32_t packetSize_vkCmdWriteBufferMarkerAMD = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 22333 | countingStream->rewind(); |
| 22334 | uint32_t opcode_vkCmdWriteBufferMarkerAMD = OP_vkCmdWriteBufferMarkerAMD; |
| 22335 | stream->write(&opcode_vkCmdWriteBufferMarkerAMD, sizeof(uint32_t)); |
| 22336 | stream->write(&packetSize_vkCmdWriteBufferMarkerAMD, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22337 | uint64_t cgen_var_1463; |
| 22338 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1463, 1); |
| 22339 | stream->write((uint64_t*)&cgen_var_1463, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 22340 | stream->write((VkPipelineStageFlagBits*)&local_pipelineStage, sizeof(VkPipelineStageFlagBits)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22341 | uint64_t cgen_var_1464; |
| 22342 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_dstBuffer, &cgen_var_1464, 1); |
| 22343 | stream->write((uint64_t*)&cgen_var_1464, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 22344 | stream->write((VkDeviceSize*)&local_dstOffset, sizeof(VkDeviceSize)); |
| 22345 | stream->write((uint32_t*)&local_marker, sizeof(uint32_t)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 22346 | AEMU_SCOPED_TRACE("vkCmdWriteBufferMarkerAMD readParams"); |
| 22347 | AEMU_SCOPED_TRACE("vkCmdWriteBufferMarkerAMD returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 22348 | mImpl->log("finish vkCmdWriteBufferMarkerAMD");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22349 | } |
| 22350 | |
| 22351 | #endif |
| 22352 | #ifdef VK_AMD_shader_core_properties |
| 22353 | #endif |
| 22354 | #ifdef VK_EXT_vertex_attribute_divisor |
| 22355 | #endif |
| 22356 | #ifdef VK_NV_shader_subgroup_partitioned |
| 22357 | #endif |
| 22358 | #ifdef VK_NV_device_diagnostic_checkpoints |
| 22359 | void VkEncoder::vkCmdSetCheckpointNV( |
| 22360 | VkCommandBuffer commandBuffer, |
| 22361 | const void* pCheckpointMarker) |
| 22362 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 22363 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 22364 | AEMU_SCOPED_TRACE("vkCmdSetCheckpointNV encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 22365 | mImpl->log("start vkCmdSetCheckpointNV"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22366 | auto stream = mImpl->stream(); |
| 22367 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 22368 | auto resources = mImpl->resources(); |
| 22369 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 22370 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 22371 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 22372 | void* local_pCheckpointMarker; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 22373 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 22374 | local_pCheckpointMarker = nullptr; |
| 22375 | if (pCheckpointMarker) |
| 22376 | { |
| 22377 | local_pCheckpointMarker = (void*)pool->dupArray(pCheckpointMarker, sizeof(const uint8_t)); |
| 22378 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22379 | countingStream->rewind(); |
| 22380 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22381 | uint64_t cgen_var_1465; |
| 22382 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1465, 1); |
| 22383 | countingStream->write((uint64_t*)&cgen_var_1465, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 22384 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22385 | uint64_t cgen_var_1466 = (uint64_t)(uintptr_t)local_pCheckpointMarker; |
| 22386 | countingStream->putBe64(cgen_var_1466); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 22387 | if (local_pCheckpointMarker) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22388 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 22389 | countingStream->write((void*)local_pCheckpointMarker, sizeof(uint8_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22390 | } |
| 22391 | } |
| 22392 | uint32_t packetSize_vkCmdSetCheckpointNV = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 22393 | countingStream->rewind(); |
| 22394 | uint32_t opcode_vkCmdSetCheckpointNV = OP_vkCmdSetCheckpointNV; |
| 22395 | stream->write(&opcode_vkCmdSetCheckpointNV, sizeof(uint32_t)); |
| 22396 | stream->write(&packetSize_vkCmdSetCheckpointNV, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22397 | uint64_t cgen_var_1467; |
| 22398 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1467, 1); |
| 22399 | stream->write((uint64_t*)&cgen_var_1467, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 22400 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22401 | uint64_t cgen_var_1468 = (uint64_t)(uintptr_t)local_pCheckpointMarker; |
| 22402 | stream->putBe64(cgen_var_1468); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 22403 | if (local_pCheckpointMarker) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22404 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 22405 | stream->write((void*)local_pCheckpointMarker, sizeof(uint8_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22406 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 22407 | AEMU_SCOPED_TRACE("vkCmdSetCheckpointNV readParams"); |
| 22408 | AEMU_SCOPED_TRACE("vkCmdSetCheckpointNV returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 22409 | mImpl->log("finish vkCmdSetCheckpointNV");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22410 | } |
| 22411 | |
| 22412 | void VkEncoder::vkGetQueueCheckpointDataNV( |
| 22413 | VkQueue queue, |
| 22414 | uint32_t* pCheckpointDataCount, |
| 22415 | VkCheckpointDataNV* pCheckpointData) |
| 22416 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 22417 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 22418 | AEMU_SCOPED_TRACE("vkGetQueueCheckpointDataNV encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 22419 | mImpl->log("start vkGetQueueCheckpointDataNV"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22420 | auto stream = mImpl->stream(); |
| 22421 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 22422 | auto resources = mImpl->resources(); |
| 22423 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 22424 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 22425 | VkQueue local_queue; |
| 22426 | local_queue = queue; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22427 | countingStream->rewind(); |
| 22428 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22429 | uint64_t cgen_var_1469; |
| 22430 | countingStream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_1469, 1); |
| 22431 | countingStream->write((uint64_t*)&cgen_var_1469, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 22432 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22433 | uint64_t cgen_var_1470 = (uint64_t)(uintptr_t)pCheckpointDataCount; |
| 22434 | countingStream->putBe64(cgen_var_1470); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22435 | if (pCheckpointDataCount) |
| 22436 | { |
| 22437 | countingStream->write((uint32_t*)pCheckpointDataCount, sizeof(uint32_t)); |
| 22438 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 22439 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22440 | uint64_t cgen_var_1471 = (uint64_t)(uintptr_t)pCheckpointData; |
| 22441 | countingStream->putBe64(cgen_var_1471); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22442 | if (pCheckpointData) |
| 22443 | { |
| 22444 | for (uint32_t i = 0; i < (uint32_t)(*(pCheckpointDataCount)); ++i) |
| 22445 | { |
| 22446 | marshal_VkCheckpointDataNV(countingStream, (VkCheckpointDataNV*)(pCheckpointData + i)); |
| 22447 | } |
| 22448 | } |
| 22449 | } |
| 22450 | uint32_t packetSize_vkGetQueueCheckpointDataNV = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 22451 | countingStream->rewind(); |
| 22452 | uint32_t opcode_vkGetQueueCheckpointDataNV = OP_vkGetQueueCheckpointDataNV; |
| 22453 | stream->write(&opcode_vkGetQueueCheckpointDataNV, sizeof(uint32_t)); |
| 22454 | stream->write(&packetSize_vkGetQueueCheckpointDataNV, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22455 | uint64_t cgen_var_1472; |
| 22456 | stream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_1472, 1); |
| 22457 | stream->write((uint64_t*)&cgen_var_1472, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 22458 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22459 | uint64_t cgen_var_1473 = (uint64_t)(uintptr_t)pCheckpointDataCount; |
| 22460 | stream->putBe64(cgen_var_1473); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22461 | if (pCheckpointDataCount) |
| 22462 | { |
| 22463 | stream->write((uint32_t*)pCheckpointDataCount, sizeof(uint32_t)); |
| 22464 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 22465 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22466 | uint64_t cgen_var_1474 = (uint64_t)(uintptr_t)pCheckpointData; |
| 22467 | stream->putBe64(cgen_var_1474); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22468 | if (pCheckpointData) |
| 22469 | { |
| 22470 | for (uint32_t i = 0; i < (uint32_t)(*(pCheckpointDataCount)); ++i) |
| 22471 | { |
| 22472 | marshal_VkCheckpointDataNV(stream, (VkCheckpointDataNV*)(pCheckpointData + i)); |
| 22473 | } |
| 22474 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 22475 | AEMU_SCOPED_TRACE("vkGetQueueCheckpointDataNV readParams"); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 22476 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22477 | uint32_t* check_pCheckpointDataCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 22478 | check_pCheckpointDataCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22479 | if (pCheckpointDataCount) |
| 22480 | { |
| 22481 | if (!(check_pCheckpointDataCount)) |
| 22482 | { |
| 22483 | fprintf(stderr, "fatal: pCheckpointDataCount inconsistent between guest and host\n"); |
| 22484 | } |
| 22485 | stream->read((uint32_t*)pCheckpointDataCount, sizeof(uint32_t)); |
| 22486 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 22487 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22488 | VkCheckpointDataNV* check_pCheckpointData; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 22489 | check_pCheckpointData = (VkCheckpointDataNV*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22490 | if (pCheckpointData) |
| 22491 | { |
| 22492 | if (!(check_pCheckpointData)) |
| 22493 | { |
| 22494 | fprintf(stderr, "fatal: pCheckpointData inconsistent between guest and host\n"); |
| 22495 | } |
| 22496 | for (uint32_t i = 0; i < (uint32_t)(*(pCheckpointDataCount)); ++i) |
| 22497 | { |
| 22498 | unmarshal_VkCheckpointDataNV(stream, (VkCheckpointDataNV*)(pCheckpointData + i)); |
| 22499 | } |
| 22500 | } |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 22501 | if (pCheckpointData) |
| 22502 | { |
| 22503 | for (uint32_t i = 0; i < (uint32_t)(*(pCheckpointDataCount)); ++i) |
| 22504 | { |
| 22505 | transform_fromhost_VkCheckpointDataNV(mImpl->resources(), (VkCheckpointDataNV*)(pCheckpointData + i)); |
| 22506 | } |
| 22507 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 22508 | AEMU_SCOPED_TRACE("vkGetQueueCheckpointDataNV returnUnmarshal"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 22509 | mImpl->log("finish vkGetQueueCheckpointDataNV");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 22510 | } |
| 22511 | |
| 22512 | #endif |
| Lingfeng Yang | 5c63afd | 2018-12-22 01:21:14 -0800 | [diff] [blame] | 22513 | #ifdef VK_GOOGLE_address_space |
| 22514 | VkResult VkEncoder::vkMapMemoryIntoAddressSpaceGOOGLE( |
| 22515 | VkDevice device, |
| 22516 | VkDeviceMemory memory, |
| 22517 | uint64_t* pAddress) |
| 22518 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 22519 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 22520 | AEMU_SCOPED_TRACE("vkMapMemoryIntoAddressSpaceGOOGLE encode"); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 22521 | mImpl->log("start vkMapMemoryIntoAddressSpaceGOOGLE"); |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 22522 | encoderLock.unlock(); |
| Lingfeng Yang | 5c63afd | 2018-12-22 01:21:14 -0800 | [diff] [blame] | 22523 | mImpl->resources()->on_vkMapMemoryIntoAddressSpaceGOOGLE_pre(this, VK_SUCCESS, device, memory, pAddress); |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 22524 | encoderLock.lock(); |
| Lingfeng Yang | 5c63afd | 2018-12-22 01:21:14 -0800 | [diff] [blame] | 22525 | auto stream = mImpl->stream(); |
| 22526 | auto countingStream = mImpl->countingStream(); |
| 22527 | auto resources = mImpl->resources(); |
| 22528 | auto pool = mImpl->pool(); |
| 22529 | stream->setHandleMapping(resources->unwrapMapping()); |
| 22530 | VkDevice local_device; |
| 22531 | VkDeviceMemory local_memory; |
| 22532 | local_device = device; |
| 22533 | local_memory = memory; |
| Lingfeng Yang | 2b1b8cf | 2019-02-08 09:53:36 -0800 | [diff] [blame] | 22534 | 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] | 22535 | countingStream->rewind(); |
| 22536 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22537 | uint64_t cgen_var_1477; |
| 22538 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1477, 1); |
| 22539 | countingStream->write((uint64_t*)&cgen_var_1477, 1 * 8); |
| 22540 | uint64_t cgen_var_1478; |
| 22541 | countingStream->handleMapping()->mapHandles_VkDeviceMemory_u64(&local_memory, &cgen_var_1478, 1); |
| 22542 | countingStream->write((uint64_t*)&cgen_var_1478, 1 * 8); |
| Lingfeng Yang | 5c63afd | 2018-12-22 01:21:14 -0800 | [diff] [blame] | 22543 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22544 | uint64_t cgen_var_1479 = (uint64_t)(uintptr_t)pAddress; |
| 22545 | countingStream->putBe64(cgen_var_1479); |
| Lingfeng Yang | 5c63afd | 2018-12-22 01:21:14 -0800 | [diff] [blame] | 22546 | if (pAddress) |
| 22547 | { |
| 22548 | countingStream->write((uint64_t*)pAddress, sizeof(uint64_t)); |
| 22549 | } |
| 22550 | } |
| 22551 | uint32_t packetSize_vkMapMemoryIntoAddressSpaceGOOGLE = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 22552 | countingStream->rewind(); |
| 22553 | uint32_t opcode_vkMapMemoryIntoAddressSpaceGOOGLE = OP_vkMapMemoryIntoAddressSpaceGOOGLE; |
| 22554 | stream->write(&opcode_vkMapMemoryIntoAddressSpaceGOOGLE, sizeof(uint32_t)); |
| 22555 | stream->write(&packetSize_vkMapMemoryIntoAddressSpaceGOOGLE, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22556 | uint64_t cgen_var_1480; |
| 22557 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1480, 1); |
| 22558 | stream->write((uint64_t*)&cgen_var_1480, 1 * 8); |
| 22559 | uint64_t cgen_var_1481; |
| 22560 | stream->handleMapping()->mapHandles_VkDeviceMemory_u64(&local_memory, &cgen_var_1481, 1); |
| 22561 | stream->write((uint64_t*)&cgen_var_1481, 1 * 8); |
| Lingfeng Yang | 5c63afd | 2018-12-22 01:21:14 -0800 | [diff] [blame] | 22562 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22563 | uint64_t cgen_var_1482 = (uint64_t)(uintptr_t)pAddress; |
| 22564 | stream->putBe64(cgen_var_1482); |
| Lingfeng Yang | 5c63afd | 2018-12-22 01:21:14 -0800 | [diff] [blame] | 22565 | if (pAddress) |
| 22566 | { |
| 22567 | stream->write((uint64_t*)pAddress, sizeof(uint64_t)); |
| 22568 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 22569 | AEMU_SCOPED_TRACE("vkMapMemoryIntoAddressSpaceGOOGLE readParams"); |
| Lingfeng Yang | 5c63afd | 2018-12-22 01:21:14 -0800 | [diff] [blame] | 22570 | // WARNING PTR CHECK |
| 22571 | uint64_t* check_pAddress; |
| 22572 | check_pAddress = (uint64_t*)(uintptr_t)stream->getBe64(); |
| 22573 | if (pAddress) |
| 22574 | { |
| 22575 | if (!(check_pAddress)) |
| 22576 | { |
| 22577 | fprintf(stderr, "fatal: pAddress inconsistent between guest and host\n"); |
| 22578 | } |
| 22579 | stream->read((uint64_t*)pAddress, sizeof(uint64_t)); |
| 22580 | } |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 22581 | AEMU_SCOPED_TRACE("vkMapMemoryIntoAddressSpaceGOOGLE returnUnmarshal"); |
| Lingfeng Yang | 5c63afd | 2018-12-22 01:21:14 -0800 | [diff] [blame] | 22582 | VkResult vkMapMemoryIntoAddressSpaceGOOGLE_VkResult_return = (VkResult)0; |
| 22583 | stream->read(&vkMapMemoryIntoAddressSpaceGOOGLE_VkResult_return, sizeof(VkResult)); |
| 22584 | countingStream->clearPool(); |
| 22585 | stream->clearPool(); |
| 22586 | pool->freeAll(); |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 22587 | encoderLock.unlock(); |
| Lingfeng Yang | 5c63afd | 2018-12-22 01:21:14 -0800 | [diff] [blame] | 22588 | mImpl->resources()->on_vkMapMemoryIntoAddressSpaceGOOGLE(this, vkMapMemoryIntoAddressSpaceGOOGLE_VkResult_return, device, memory, pAddress); |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 22589 | encoderLock.lock(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 22590 | mImpl->log("finish vkMapMemoryIntoAddressSpaceGOOGLE");; |
| Lingfeng Yang | 5c63afd | 2018-12-22 01:21:14 -0800 | [diff] [blame] | 22591 | return vkMapMemoryIntoAddressSpaceGOOGLE_VkResult_return; |
| 22592 | } |
| 22593 | |
| 22594 | #endif |
| Lingfeng Yang | ae7e1b3 | 2019-02-19 14:07:39 -0800 | [diff] [blame] | 22595 | #ifdef VK_GOOGLE_color_buffer |
| 22596 | VkResult VkEncoder::vkRegisterImageColorBufferGOOGLE( |
| 22597 | VkDevice device, |
| 22598 | VkImage image, |
| 22599 | uint32_t colorBuffer) |
| 22600 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 22601 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 22602 | AEMU_SCOPED_TRACE("vkRegisterImageColorBufferGOOGLE encode"); |
| Lingfeng Yang | ae7e1b3 | 2019-02-19 14:07:39 -0800 | [diff] [blame] | 22603 | mImpl->log("start vkRegisterImageColorBufferGOOGLE"); |
| 22604 | auto stream = mImpl->stream(); |
| 22605 | auto countingStream = mImpl->countingStream(); |
| 22606 | auto resources = mImpl->resources(); |
| 22607 | auto pool = mImpl->pool(); |
| 22608 | stream->setHandleMapping(resources->unwrapMapping()); |
| 22609 | VkDevice local_device; |
| 22610 | VkImage local_image; |
| 22611 | uint32_t local_colorBuffer; |
| 22612 | local_device = device; |
| 22613 | local_image = image; |
| 22614 | local_colorBuffer = colorBuffer; |
| 22615 | countingStream->rewind(); |
| 22616 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22617 | uint64_t cgen_var_1484; |
| 22618 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1484, 1); |
| 22619 | countingStream->write((uint64_t*)&cgen_var_1484, 1 * 8); |
| 22620 | uint64_t cgen_var_1485; |
| 22621 | countingStream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_1485, 1); |
| 22622 | countingStream->write((uint64_t*)&cgen_var_1485, 1 * 8); |
| Lingfeng Yang | ae7e1b3 | 2019-02-19 14:07:39 -0800 | [diff] [blame] | 22623 | countingStream->write((uint32_t*)&local_colorBuffer, sizeof(uint32_t)); |
| 22624 | } |
| 22625 | uint32_t packetSize_vkRegisterImageColorBufferGOOGLE = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 22626 | countingStream->rewind(); |
| 22627 | uint32_t opcode_vkRegisterImageColorBufferGOOGLE = OP_vkRegisterImageColorBufferGOOGLE; |
| 22628 | stream->write(&opcode_vkRegisterImageColorBufferGOOGLE, sizeof(uint32_t)); |
| 22629 | stream->write(&packetSize_vkRegisterImageColorBufferGOOGLE, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22630 | uint64_t cgen_var_1486; |
| 22631 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1486, 1); |
| 22632 | stream->write((uint64_t*)&cgen_var_1486, 1 * 8); |
| 22633 | uint64_t cgen_var_1487; |
| 22634 | stream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_1487, 1); |
| 22635 | stream->write((uint64_t*)&cgen_var_1487, 1 * 8); |
| Lingfeng Yang | ae7e1b3 | 2019-02-19 14:07:39 -0800 | [diff] [blame] | 22636 | stream->write((uint32_t*)&local_colorBuffer, sizeof(uint32_t)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 22637 | AEMU_SCOPED_TRACE("vkRegisterImageColorBufferGOOGLE readParams"); |
| 22638 | AEMU_SCOPED_TRACE("vkRegisterImageColorBufferGOOGLE returnUnmarshal"); |
| Lingfeng Yang | ae7e1b3 | 2019-02-19 14:07:39 -0800 | [diff] [blame] | 22639 | VkResult vkRegisterImageColorBufferGOOGLE_VkResult_return = (VkResult)0; |
| 22640 | stream->read(&vkRegisterImageColorBufferGOOGLE_VkResult_return, sizeof(VkResult)); |
| 22641 | countingStream->clearPool(); |
| 22642 | stream->clearPool(); |
| 22643 | pool->freeAll(); |
| 22644 | mImpl->log("finish vkRegisterImageColorBufferGOOGLE");; |
| 22645 | return vkRegisterImageColorBufferGOOGLE_VkResult_return; |
| 22646 | } |
| 22647 | |
| 22648 | VkResult VkEncoder::vkRegisterBufferColorBufferGOOGLE( |
| 22649 | VkDevice device, |
| 22650 | VkBuffer buffer, |
| 22651 | uint32_t colorBuffer) |
| 22652 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 22653 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 22654 | AEMU_SCOPED_TRACE("vkRegisterBufferColorBufferGOOGLE encode"); |
| Lingfeng Yang | ae7e1b3 | 2019-02-19 14:07:39 -0800 | [diff] [blame] | 22655 | mImpl->log("start vkRegisterBufferColorBufferGOOGLE"); |
| 22656 | auto stream = mImpl->stream(); |
| 22657 | auto countingStream = mImpl->countingStream(); |
| 22658 | auto resources = mImpl->resources(); |
| 22659 | auto pool = mImpl->pool(); |
| 22660 | stream->setHandleMapping(resources->unwrapMapping()); |
| 22661 | VkDevice local_device; |
| 22662 | VkBuffer local_buffer; |
| 22663 | uint32_t local_colorBuffer; |
| 22664 | local_device = device; |
| 22665 | local_buffer = buffer; |
| 22666 | local_colorBuffer = colorBuffer; |
| 22667 | countingStream->rewind(); |
| 22668 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22669 | uint64_t cgen_var_1488; |
| 22670 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1488, 1); |
| 22671 | countingStream->write((uint64_t*)&cgen_var_1488, 1 * 8); |
| 22672 | uint64_t cgen_var_1489; |
| 22673 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_1489, 1); |
| 22674 | countingStream->write((uint64_t*)&cgen_var_1489, 1 * 8); |
| Lingfeng Yang | ae7e1b3 | 2019-02-19 14:07:39 -0800 | [diff] [blame] | 22675 | countingStream->write((uint32_t*)&local_colorBuffer, sizeof(uint32_t)); |
| 22676 | } |
| 22677 | uint32_t packetSize_vkRegisterBufferColorBufferGOOGLE = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 22678 | countingStream->rewind(); |
| 22679 | uint32_t opcode_vkRegisterBufferColorBufferGOOGLE = OP_vkRegisterBufferColorBufferGOOGLE; |
| 22680 | stream->write(&opcode_vkRegisterBufferColorBufferGOOGLE, sizeof(uint32_t)); |
| 22681 | stream->write(&packetSize_vkRegisterBufferColorBufferGOOGLE, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22682 | uint64_t cgen_var_1490; |
| 22683 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1490, 1); |
| 22684 | stream->write((uint64_t*)&cgen_var_1490, 1 * 8); |
| 22685 | uint64_t cgen_var_1491; |
| 22686 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_1491, 1); |
| 22687 | stream->write((uint64_t*)&cgen_var_1491, 1 * 8); |
| Lingfeng Yang | ae7e1b3 | 2019-02-19 14:07:39 -0800 | [diff] [blame] | 22688 | stream->write((uint32_t*)&local_colorBuffer, sizeof(uint32_t)); |
| Lingfeng Yang | 42ac179 | 2019-02-22 20:13:44 -0800 | [diff] [blame] | 22689 | AEMU_SCOPED_TRACE("vkRegisterBufferColorBufferGOOGLE readParams"); |
| 22690 | AEMU_SCOPED_TRACE("vkRegisterBufferColorBufferGOOGLE returnUnmarshal"); |
| Lingfeng Yang | ae7e1b3 | 2019-02-19 14:07:39 -0800 | [diff] [blame] | 22691 | VkResult vkRegisterBufferColorBufferGOOGLE_VkResult_return = (VkResult)0; |
| 22692 | stream->read(&vkRegisterBufferColorBufferGOOGLE_VkResult_return, sizeof(VkResult)); |
| 22693 | countingStream->clearPool(); |
| 22694 | stream->clearPool(); |
| 22695 | pool->freeAll(); |
| 22696 | mImpl->log("finish vkRegisterBufferColorBufferGOOGLE");; |
| 22697 | return vkRegisterBufferColorBufferGOOGLE_VkResult_return; |
| 22698 | } |
| 22699 | |
| 22700 | #endif |
| Lingfeng Yang | 05d5ea3 | 2019-03-23 00:12:39 -0700 | [diff] [blame] | 22701 | #ifdef VK_GOOGLE_sized_descriptor_update_template |
| 22702 | void VkEncoder::vkUpdateDescriptorSetWithTemplateSizedGOOGLE( |
| 22703 | VkDevice device, |
| 22704 | VkDescriptorSet descriptorSet, |
| 22705 | VkDescriptorUpdateTemplate descriptorUpdateTemplate, |
| 22706 | uint32_t imageInfoCount, |
| 22707 | uint32_t bufferInfoCount, |
| 22708 | uint32_t bufferViewCount, |
| 22709 | const uint32_t* pImageInfoEntryIndices, |
| 22710 | const uint32_t* pBufferInfoEntryIndices, |
| 22711 | const uint32_t* pBufferViewEntryIndices, |
| 22712 | const VkDescriptorImageInfo* pImageInfos, |
| 22713 | const VkDescriptorBufferInfo* pBufferInfos, |
| 22714 | const VkBufferView* pBufferViews) |
| 22715 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 22716 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | 05d5ea3 | 2019-03-23 00:12:39 -0700 | [diff] [blame] | 22717 | AEMU_SCOPED_TRACE("vkUpdateDescriptorSetWithTemplateSizedGOOGLE encode"); |
| 22718 | mImpl->log("start vkUpdateDescriptorSetWithTemplateSizedGOOGLE"); |
| 22719 | auto stream = mImpl->stream(); |
| 22720 | auto countingStream = mImpl->countingStream(); |
| 22721 | auto resources = mImpl->resources(); |
| 22722 | auto pool = mImpl->pool(); |
| 22723 | stream->setHandleMapping(resources->unwrapMapping()); |
| 22724 | VkDevice local_device; |
| 22725 | VkDescriptorSet local_descriptorSet; |
| 22726 | VkDescriptorUpdateTemplate local_descriptorUpdateTemplate; |
| 22727 | uint32_t local_imageInfoCount; |
| 22728 | uint32_t local_bufferInfoCount; |
| 22729 | uint32_t local_bufferViewCount; |
| 22730 | uint32_t* local_pImageInfoEntryIndices; |
| 22731 | uint32_t* local_pBufferInfoEntryIndices; |
| 22732 | uint32_t* local_pBufferViewEntryIndices; |
| 22733 | VkDescriptorImageInfo* local_pImageInfos; |
| 22734 | VkDescriptorBufferInfo* local_pBufferInfos; |
| 22735 | VkBufferView* local_pBufferViews; |
| 22736 | local_device = device; |
| 22737 | local_descriptorSet = descriptorSet; |
| 22738 | local_descriptorUpdateTemplate = descriptorUpdateTemplate; |
| 22739 | local_imageInfoCount = imageInfoCount; |
| 22740 | local_bufferInfoCount = bufferInfoCount; |
| 22741 | local_bufferViewCount = bufferViewCount; |
| 22742 | local_pImageInfoEntryIndices = nullptr; |
| 22743 | if (pImageInfoEntryIndices) |
| 22744 | { |
| 22745 | local_pImageInfoEntryIndices = (uint32_t*)pool->dupArray(pImageInfoEntryIndices, ((imageInfoCount)) * sizeof(const uint32_t)); |
| 22746 | } |
| 22747 | local_pBufferInfoEntryIndices = nullptr; |
| 22748 | if (pBufferInfoEntryIndices) |
| 22749 | { |
| 22750 | local_pBufferInfoEntryIndices = (uint32_t*)pool->dupArray(pBufferInfoEntryIndices, ((bufferInfoCount)) * sizeof(const uint32_t)); |
| 22751 | } |
| 22752 | local_pBufferViewEntryIndices = nullptr; |
| 22753 | if (pBufferViewEntryIndices) |
| 22754 | { |
| 22755 | local_pBufferViewEntryIndices = (uint32_t*)pool->dupArray(pBufferViewEntryIndices, ((bufferViewCount)) * sizeof(const uint32_t)); |
| 22756 | } |
| 22757 | local_pImageInfos = nullptr; |
| 22758 | if (pImageInfos) |
| 22759 | { |
| 22760 | local_pImageInfos = (VkDescriptorImageInfo*)pool->alloc(((imageInfoCount)) * sizeof(const VkDescriptorImageInfo)); |
| 22761 | for (uint32_t i = 0; i < (uint32_t)((imageInfoCount)); ++i) |
| 22762 | { |
| 22763 | deepcopy_VkDescriptorImageInfo(pool, pImageInfos + i, (VkDescriptorImageInfo*)(local_pImageInfos + i)); |
| 22764 | } |
| 22765 | } |
| 22766 | local_pBufferInfos = nullptr; |
| 22767 | if (pBufferInfos) |
| 22768 | { |
| 22769 | local_pBufferInfos = (VkDescriptorBufferInfo*)pool->alloc(((bufferInfoCount)) * sizeof(const VkDescriptorBufferInfo)); |
| 22770 | for (uint32_t i = 0; i < (uint32_t)((bufferInfoCount)); ++i) |
| 22771 | { |
| 22772 | deepcopy_VkDescriptorBufferInfo(pool, pBufferInfos + i, (VkDescriptorBufferInfo*)(local_pBufferInfos + i)); |
| 22773 | } |
| 22774 | } |
| 22775 | local_pBufferViews = nullptr; |
| 22776 | if (pBufferViews) |
| 22777 | { |
| 22778 | local_pBufferViews = (VkBufferView*)pool->dupArray(pBufferViews, ((bufferViewCount)) * sizeof(const VkBufferView)); |
| 22779 | } |
| 22780 | if (local_pImageInfos) |
| 22781 | { |
| 22782 | for (uint32_t i = 0; i < (uint32_t)((imageInfoCount)); ++i) |
| 22783 | { |
| 22784 | transform_tohost_VkDescriptorImageInfo(mImpl->resources(), (VkDescriptorImageInfo*)(local_pImageInfos + i)); |
| 22785 | } |
| 22786 | } |
| 22787 | if (local_pBufferInfos) |
| 22788 | { |
| 22789 | for (uint32_t i = 0; i < (uint32_t)((bufferInfoCount)); ++i) |
| 22790 | { |
| 22791 | transform_tohost_VkDescriptorBufferInfo(mImpl->resources(), (VkDescriptorBufferInfo*)(local_pBufferInfos + i)); |
| 22792 | } |
| 22793 | } |
| 22794 | countingStream->rewind(); |
| 22795 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22796 | uint64_t cgen_var_1492; |
| 22797 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1492, 1); |
| 22798 | countingStream->write((uint64_t*)&cgen_var_1492, 1 * 8); |
| 22799 | uint64_t cgen_var_1493; |
| 22800 | countingStream->handleMapping()->mapHandles_VkDescriptorSet_u64(&local_descriptorSet, &cgen_var_1493, 1); |
| 22801 | countingStream->write((uint64_t*)&cgen_var_1493, 1 * 8); |
| 22802 | uint64_t cgen_var_1494; |
| 22803 | countingStream->handleMapping()->mapHandles_VkDescriptorUpdateTemplate_u64(&local_descriptorUpdateTemplate, &cgen_var_1494, 1); |
| 22804 | countingStream->write((uint64_t*)&cgen_var_1494, 1 * 8); |
| Lingfeng Yang | 05d5ea3 | 2019-03-23 00:12:39 -0700 | [diff] [blame] | 22805 | countingStream->write((uint32_t*)&local_imageInfoCount, sizeof(uint32_t)); |
| 22806 | countingStream->write((uint32_t*)&local_bufferInfoCount, sizeof(uint32_t)); |
| 22807 | countingStream->write((uint32_t*)&local_bufferViewCount, sizeof(uint32_t)); |
| 22808 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22809 | uint64_t cgen_var_1495 = (uint64_t)(uintptr_t)local_pImageInfoEntryIndices; |
| 22810 | countingStream->putBe64(cgen_var_1495); |
| Lingfeng Yang | 05d5ea3 | 2019-03-23 00:12:39 -0700 | [diff] [blame] | 22811 | if (local_pImageInfoEntryIndices) |
| 22812 | { |
| 22813 | countingStream->write((uint32_t*)local_pImageInfoEntryIndices, ((imageInfoCount)) * sizeof(uint32_t)); |
| 22814 | } |
| 22815 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22816 | uint64_t cgen_var_1496 = (uint64_t)(uintptr_t)local_pBufferInfoEntryIndices; |
| 22817 | countingStream->putBe64(cgen_var_1496); |
| Lingfeng Yang | 05d5ea3 | 2019-03-23 00:12:39 -0700 | [diff] [blame] | 22818 | if (local_pBufferInfoEntryIndices) |
| 22819 | { |
| 22820 | countingStream->write((uint32_t*)local_pBufferInfoEntryIndices, ((bufferInfoCount)) * sizeof(uint32_t)); |
| 22821 | } |
| 22822 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22823 | uint64_t cgen_var_1497 = (uint64_t)(uintptr_t)local_pBufferViewEntryIndices; |
| 22824 | countingStream->putBe64(cgen_var_1497); |
| Lingfeng Yang | 05d5ea3 | 2019-03-23 00:12:39 -0700 | [diff] [blame] | 22825 | if (local_pBufferViewEntryIndices) |
| 22826 | { |
| 22827 | countingStream->write((uint32_t*)local_pBufferViewEntryIndices, ((bufferViewCount)) * sizeof(uint32_t)); |
| 22828 | } |
| 22829 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22830 | uint64_t cgen_var_1498 = (uint64_t)(uintptr_t)local_pImageInfos; |
| 22831 | countingStream->putBe64(cgen_var_1498); |
| Lingfeng Yang | 05d5ea3 | 2019-03-23 00:12:39 -0700 | [diff] [blame] | 22832 | if (local_pImageInfos) |
| 22833 | { |
| 22834 | for (uint32_t i = 0; i < (uint32_t)((imageInfoCount)); ++i) |
| 22835 | { |
| 22836 | marshal_VkDescriptorImageInfo(countingStream, (VkDescriptorImageInfo*)(local_pImageInfos + i)); |
| 22837 | } |
| 22838 | } |
| 22839 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22840 | uint64_t cgen_var_1499 = (uint64_t)(uintptr_t)local_pBufferInfos; |
| 22841 | countingStream->putBe64(cgen_var_1499); |
| Lingfeng Yang | 05d5ea3 | 2019-03-23 00:12:39 -0700 | [diff] [blame] | 22842 | if (local_pBufferInfos) |
| 22843 | { |
| 22844 | for (uint32_t i = 0; i < (uint32_t)((bufferInfoCount)); ++i) |
| 22845 | { |
| 22846 | marshal_VkDescriptorBufferInfo(countingStream, (VkDescriptorBufferInfo*)(local_pBufferInfos + i)); |
| 22847 | } |
| 22848 | } |
| 22849 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22850 | uint64_t cgen_var_1500 = (uint64_t)(uintptr_t)local_pBufferViews; |
| 22851 | countingStream->putBe64(cgen_var_1500); |
| Lingfeng Yang | 05d5ea3 | 2019-03-23 00:12:39 -0700 | [diff] [blame] | 22852 | if (local_pBufferViews) |
| 22853 | { |
| 22854 | if (((bufferViewCount))) |
| 22855 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22856 | uint64_t* cgen_var_1501; |
| 22857 | countingStream->alloc((void**)&cgen_var_1501, ((bufferViewCount)) * 8); |
| 22858 | countingStream->handleMapping()->mapHandles_VkBufferView_u64(local_pBufferViews, cgen_var_1501, ((bufferViewCount))); |
| 22859 | countingStream->write((uint64_t*)cgen_var_1501, ((bufferViewCount)) * 8); |
| Lingfeng Yang | 05d5ea3 | 2019-03-23 00:12:39 -0700 | [diff] [blame] | 22860 | } |
| 22861 | } |
| 22862 | } |
| 22863 | uint32_t packetSize_vkUpdateDescriptorSetWithTemplateSizedGOOGLE = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 22864 | countingStream->rewind(); |
| 22865 | uint32_t opcode_vkUpdateDescriptorSetWithTemplateSizedGOOGLE = OP_vkUpdateDescriptorSetWithTemplateSizedGOOGLE; |
| 22866 | stream->write(&opcode_vkUpdateDescriptorSetWithTemplateSizedGOOGLE, sizeof(uint32_t)); |
| 22867 | stream->write(&packetSize_vkUpdateDescriptorSetWithTemplateSizedGOOGLE, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22868 | uint64_t cgen_var_1502; |
| 22869 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1502, 1); |
| 22870 | stream->write((uint64_t*)&cgen_var_1502, 1 * 8); |
| 22871 | uint64_t cgen_var_1503; |
| 22872 | stream->handleMapping()->mapHandles_VkDescriptorSet_u64(&local_descriptorSet, &cgen_var_1503, 1); |
| 22873 | stream->write((uint64_t*)&cgen_var_1503, 1 * 8); |
| 22874 | uint64_t cgen_var_1504; |
| 22875 | stream->handleMapping()->mapHandles_VkDescriptorUpdateTemplate_u64(&local_descriptorUpdateTemplate, &cgen_var_1504, 1); |
| 22876 | stream->write((uint64_t*)&cgen_var_1504, 1 * 8); |
| Lingfeng Yang | 05d5ea3 | 2019-03-23 00:12:39 -0700 | [diff] [blame] | 22877 | stream->write((uint32_t*)&local_imageInfoCount, sizeof(uint32_t)); |
| 22878 | stream->write((uint32_t*)&local_bufferInfoCount, sizeof(uint32_t)); |
| 22879 | stream->write((uint32_t*)&local_bufferViewCount, sizeof(uint32_t)); |
| 22880 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22881 | uint64_t cgen_var_1505 = (uint64_t)(uintptr_t)local_pImageInfoEntryIndices; |
| 22882 | stream->putBe64(cgen_var_1505); |
| Lingfeng Yang | 05d5ea3 | 2019-03-23 00:12:39 -0700 | [diff] [blame] | 22883 | if (local_pImageInfoEntryIndices) |
| 22884 | { |
| 22885 | stream->write((uint32_t*)local_pImageInfoEntryIndices, ((imageInfoCount)) * sizeof(uint32_t)); |
| 22886 | } |
| 22887 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22888 | uint64_t cgen_var_1506 = (uint64_t)(uintptr_t)local_pBufferInfoEntryIndices; |
| 22889 | stream->putBe64(cgen_var_1506); |
| Lingfeng Yang | 05d5ea3 | 2019-03-23 00:12:39 -0700 | [diff] [blame] | 22890 | if (local_pBufferInfoEntryIndices) |
| 22891 | { |
| 22892 | stream->write((uint32_t*)local_pBufferInfoEntryIndices, ((bufferInfoCount)) * sizeof(uint32_t)); |
| 22893 | } |
| 22894 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22895 | uint64_t cgen_var_1507 = (uint64_t)(uintptr_t)local_pBufferViewEntryIndices; |
| 22896 | stream->putBe64(cgen_var_1507); |
| Lingfeng Yang | 05d5ea3 | 2019-03-23 00:12:39 -0700 | [diff] [blame] | 22897 | if (local_pBufferViewEntryIndices) |
| 22898 | { |
| 22899 | stream->write((uint32_t*)local_pBufferViewEntryIndices, ((bufferViewCount)) * sizeof(uint32_t)); |
| 22900 | } |
| 22901 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22902 | uint64_t cgen_var_1508 = (uint64_t)(uintptr_t)local_pImageInfos; |
| 22903 | stream->putBe64(cgen_var_1508); |
| Lingfeng Yang | 05d5ea3 | 2019-03-23 00:12:39 -0700 | [diff] [blame] | 22904 | if (local_pImageInfos) |
| 22905 | { |
| 22906 | for (uint32_t i = 0; i < (uint32_t)((imageInfoCount)); ++i) |
| 22907 | { |
| 22908 | marshal_VkDescriptorImageInfo(stream, (VkDescriptorImageInfo*)(local_pImageInfos + i)); |
| 22909 | } |
| 22910 | } |
| 22911 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22912 | uint64_t cgen_var_1509 = (uint64_t)(uintptr_t)local_pBufferInfos; |
| 22913 | stream->putBe64(cgen_var_1509); |
| Lingfeng Yang | 05d5ea3 | 2019-03-23 00:12:39 -0700 | [diff] [blame] | 22914 | if (local_pBufferInfos) |
| 22915 | { |
| 22916 | for (uint32_t i = 0; i < (uint32_t)((bufferInfoCount)); ++i) |
| 22917 | { |
| 22918 | marshal_VkDescriptorBufferInfo(stream, (VkDescriptorBufferInfo*)(local_pBufferInfos + i)); |
| 22919 | } |
| 22920 | } |
| 22921 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22922 | uint64_t cgen_var_1510 = (uint64_t)(uintptr_t)local_pBufferViews; |
| 22923 | stream->putBe64(cgen_var_1510); |
| Lingfeng Yang | 05d5ea3 | 2019-03-23 00:12:39 -0700 | [diff] [blame] | 22924 | if (local_pBufferViews) |
| 22925 | { |
| 22926 | if (((bufferViewCount))) |
| 22927 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22928 | uint64_t* cgen_var_1511; |
| 22929 | stream->alloc((void**)&cgen_var_1511, ((bufferViewCount)) * 8); |
| 22930 | stream->handleMapping()->mapHandles_VkBufferView_u64(local_pBufferViews, cgen_var_1511, ((bufferViewCount))); |
| 22931 | stream->write((uint64_t*)cgen_var_1511, ((bufferViewCount)) * 8); |
| Lingfeng Yang | 05d5ea3 | 2019-03-23 00:12:39 -0700 | [diff] [blame] | 22932 | } |
| 22933 | } |
| 22934 | AEMU_SCOPED_TRACE("vkUpdateDescriptorSetWithTemplateSizedGOOGLE readParams"); |
| 22935 | AEMU_SCOPED_TRACE("vkUpdateDescriptorSetWithTemplateSizedGOOGLE returnUnmarshal"); |
| 22936 | mImpl->log("finish vkUpdateDescriptorSetWithTemplateSizedGOOGLE");; |
| 22937 | } |
| 22938 | |
| 22939 | #endif |
| Lingfeng Yang | c53e747 | 2019-03-27 08:50:55 -0700 | [diff] [blame] | 22940 | #ifdef VK_GOOGLE_async_command_buffers |
| 22941 | void VkEncoder::vkBeginCommandBufferAsyncGOOGLE( |
| 22942 | VkCommandBuffer commandBuffer, |
| 22943 | const VkCommandBufferBeginInfo* pBeginInfo) |
| 22944 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 22945 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | c53e747 | 2019-03-27 08:50:55 -0700 | [diff] [blame] | 22946 | AEMU_SCOPED_TRACE("vkBeginCommandBufferAsyncGOOGLE encode"); |
| 22947 | mImpl->log("start vkBeginCommandBufferAsyncGOOGLE"); |
| 22948 | auto stream = mImpl->stream(); |
| 22949 | auto countingStream = mImpl->countingStream(); |
| 22950 | auto resources = mImpl->resources(); |
| 22951 | auto pool = mImpl->pool(); |
| 22952 | stream->setHandleMapping(resources->unwrapMapping()); |
| 22953 | VkCommandBuffer local_commandBuffer; |
| 22954 | VkCommandBufferBeginInfo* local_pBeginInfo; |
| 22955 | local_commandBuffer = commandBuffer; |
| 22956 | local_pBeginInfo = nullptr; |
| 22957 | if (pBeginInfo) |
| 22958 | { |
| 22959 | local_pBeginInfo = (VkCommandBufferBeginInfo*)pool->alloc(sizeof(const VkCommandBufferBeginInfo)); |
| 22960 | deepcopy_VkCommandBufferBeginInfo(pool, pBeginInfo, (VkCommandBufferBeginInfo*)(local_pBeginInfo)); |
| 22961 | } |
| 22962 | if (local_pBeginInfo) |
| 22963 | { |
| 22964 | transform_tohost_VkCommandBufferBeginInfo(mImpl->resources(), (VkCommandBufferBeginInfo*)(local_pBeginInfo)); |
| 22965 | } |
| 22966 | countingStream->rewind(); |
| 22967 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22968 | uint64_t cgen_var_1512; |
| 22969 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1512, 1); |
| 22970 | countingStream->write((uint64_t*)&cgen_var_1512, 1 * 8); |
| Lingfeng Yang | c53e747 | 2019-03-27 08:50:55 -0700 | [diff] [blame] | 22971 | marshal_VkCommandBufferBeginInfo(countingStream, (VkCommandBufferBeginInfo*)(local_pBeginInfo)); |
| 22972 | } |
| 22973 | uint32_t packetSize_vkBeginCommandBufferAsyncGOOGLE = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 22974 | countingStream->rewind(); |
| 22975 | uint32_t opcode_vkBeginCommandBufferAsyncGOOGLE = OP_vkBeginCommandBufferAsyncGOOGLE; |
| 22976 | stream->write(&opcode_vkBeginCommandBufferAsyncGOOGLE, sizeof(uint32_t)); |
| 22977 | stream->write(&packetSize_vkBeginCommandBufferAsyncGOOGLE, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22978 | uint64_t cgen_var_1513; |
| 22979 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1513, 1); |
| 22980 | stream->write((uint64_t*)&cgen_var_1513, 1 * 8); |
| Lingfeng Yang | c53e747 | 2019-03-27 08:50:55 -0700 | [diff] [blame] | 22981 | marshal_VkCommandBufferBeginInfo(stream, (VkCommandBufferBeginInfo*)(local_pBeginInfo)); |
| 22982 | AEMU_SCOPED_TRACE("vkBeginCommandBufferAsyncGOOGLE readParams"); |
| 22983 | AEMU_SCOPED_TRACE("vkBeginCommandBufferAsyncGOOGLE returnUnmarshal"); |
| 22984 | mImpl->log("finish vkBeginCommandBufferAsyncGOOGLE");; |
| 22985 | } |
| 22986 | |
| 22987 | void VkEncoder::vkEndCommandBufferAsyncGOOGLE( |
| 22988 | VkCommandBuffer commandBuffer) |
| 22989 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 22990 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | c53e747 | 2019-03-27 08:50:55 -0700 | [diff] [blame] | 22991 | AEMU_SCOPED_TRACE("vkEndCommandBufferAsyncGOOGLE encode"); |
| 22992 | mImpl->log("start vkEndCommandBufferAsyncGOOGLE"); |
| 22993 | auto stream = mImpl->stream(); |
| 22994 | auto countingStream = mImpl->countingStream(); |
| 22995 | auto resources = mImpl->resources(); |
| 22996 | auto pool = mImpl->pool(); |
| 22997 | stream->setHandleMapping(resources->unwrapMapping()); |
| 22998 | VkCommandBuffer local_commandBuffer; |
| 22999 | local_commandBuffer = commandBuffer; |
| 23000 | countingStream->rewind(); |
| 23001 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 23002 | uint64_t cgen_var_1514; |
| 23003 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1514, 1); |
| 23004 | countingStream->write((uint64_t*)&cgen_var_1514, 1 * 8); |
| Lingfeng Yang | c53e747 | 2019-03-27 08:50:55 -0700 | [diff] [blame] | 23005 | } |
| 23006 | uint32_t packetSize_vkEndCommandBufferAsyncGOOGLE = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 23007 | countingStream->rewind(); |
| 23008 | uint32_t opcode_vkEndCommandBufferAsyncGOOGLE = OP_vkEndCommandBufferAsyncGOOGLE; |
| 23009 | stream->write(&opcode_vkEndCommandBufferAsyncGOOGLE, sizeof(uint32_t)); |
| 23010 | stream->write(&packetSize_vkEndCommandBufferAsyncGOOGLE, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 23011 | uint64_t cgen_var_1515; |
| 23012 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1515, 1); |
| 23013 | stream->write((uint64_t*)&cgen_var_1515, 1 * 8); |
| Lingfeng Yang | c53e747 | 2019-03-27 08:50:55 -0700 | [diff] [blame] | 23014 | AEMU_SCOPED_TRACE("vkEndCommandBufferAsyncGOOGLE readParams"); |
| 23015 | AEMU_SCOPED_TRACE("vkEndCommandBufferAsyncGOOGLE returnUnmarshal"); |
| 23016 | mImpl->log("finish vkEndCommandBufferAsyncGOOGLE");; |
| 23017 | } |
| 23018 | |
| 23019 | void VkEncoder::vkResetCommandBufferAsyncGOOGLE( |
| 23020 | VkCommandBuffer commandBuffer, |
| 23021 | VkCommandBufferResetFlags flags) |
| 23022 | { |
| Lingfeng Yang | 3cfb1a2 | 2019-06-17 13:22:30 -0700 | [diff] [blame] | 23023 | AutoLock encoderLock(mImpl->lock); |
| Lingfeng Yang | c53e747 | 2019-03-27 08:50:55 -0700 | [diff] [blame] | 23024 | AEMU_SCOPED_TRACE("vkResetCommandBufferAsyncGOOGLE encode"); |
| 23025 | mImpl->log("start vkResetCommandBufferAsyncGOOGLE"); |
| 23026 | auto stream = mImpl->stream(); |
| 23027 | auto countingStream = mImpl->countingStream(); |
| 23028 | auto resources = mImpl->resources(); |
| 23029 | auto pool = mImpl->pool(); |
| 23030 | stream->setHandleMapping(resources->unwrapMapping()); |
| 23031 | VkCommandBuffer local_commandBuffer; |
| 23032 | VkCommandBufferResetFlags local_flags; |
| 23033 | local_commandBuffer = commandBuffer; |
| 23034 | local_flags = flags; |
| 23035 | countingStream->rewind(); |
| 23036 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 23037 | uint64_t cgen_var_1516; |
| 23038 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1516, 1); |
| 23039 | countingStream->write((uint64_t*)&cgen_var_1516, 1 * 8); |
| Lingfeng Yang | c53e747 | 2019-03-27 08:50:55 -0700 | [diff] [blame] | 23040 | countingStream->write((VkCommandBufferResetFlags*)&local_flags, sizeof(VkCommandBufferResetFlags)); |
| 23041 | } |
| 23042 | uint32_t packetSize_vkResetCommandBufferAsyncGOOGLE = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 23043 | countingStream->rewind(); |
| 23044 | uint32_t opcode_vkResetCommandBufferAsyncGOOGLE = OP_vkResetCommandBufferAsyncGOOGLE; |
| 23045 | stream->write(&opcode_vkResetCommandBufferAsyncGOOGLE, sizeof(uint32_t)); |
| 23046 | stream->write(&packetSize_vkResetCommandBufferAsyncGOOGLE, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 23047 | uint64_t cgen_var_1517; |
| 23048 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1517, 1); |
| 23049 | stream->write((uint64_t*)&cgen_var_1517, 1 * 8); |
| Lingfeng Yang | c53e747 | 2019-03-27 08:50:55 -0700 | [diff] [blame] | 23050 | stream->write((VkCommandBufferResetFlags*)&local_flags, sizeof(VkCommandBufferResetFlags)); |
| 23051 | AEMU_SCOPED_TRACE("vkResetCommandBufferAsyncGOOGLE readParams"); |
| 23052 | AEMU_SCOPED_TRACE("vkResetCommandBufferAsyncGOOGLE returnUnmarshal"); |
| 23053 | mImpl->log("finish vkResetCommandBufferAsyncGOOGLE");; |
| 23054 | } |
| 23055 | |
| Lingfeng Yang | 39a276e | 2019-06-17 13:27:22 -0700 | [diff] [blame^] | 23056 | void VkEncoder::vkCommandBufferHostSyncGOOGLE( |
| 23057 | VkCommandBuffer commandBuffer, |
| 23058 | uint32_t needHostSync, |
| 23059 | uint32_t sequenceNumber) |
| 23060 | { |
| 23061 | AutoLock encoderLock(mImpl->lock); |
| 23062 | AEMU_SCOPED_TRACE("vkCommandBufferHostSyncGOOGLE encode"); |
| 23063 | mImpl->log("start vkCommandBufferHostSyncGOOGLE"); |
| 23064 | auto stream = mImpl->stream(); |
| 23065 | auto countingStream = mImpl->countingStream(); |
| 23066 | auto resources = mImpl->resources(); |
| 23067 | auto pool = mImpl->pool(); |
| 23068 | stream->setHandleMapping(resources->unwrapMapping()); |
| 23069 | VkCommandBuffer local_commandBuffer; |
| 23070 | uint32_t local_needHostSync; |
| 23071 | uint32_t local_sequenceNumber; |
| 23072 | local_commandBuffer = commandBuffer; |
| 23073 | local_needHostSync = needHostSync; |
| 23074 | local_sequenceNumber = sequenceNumber; |
| 23075 | countingStream->rewind(); |
| 23076 | { |
| 23077 | uint64_t cgen_var_1518; |
| 23078 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1518, 1); |
| 23079 | countingStream->write((uint64_t*)&cgen_var_1518, 1 * 8); |
| 23080 | countingStream->write((uint32_t*)&local_needHostSync, sizeof(uint32_t)); |
| 23081 | countingStream->write((uint32_t*)&local_sequenceNumber, sizeof(uint32_t)); |
| 23082 | } |
| 23083 | uint32_t packetSize_vkCommandBufferHostSyncGOOGLE = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 23084 | countingStream->rewind(); |
| 23085 | uint32_t opcode_vkCommandBufferHostSyncGOOGLE = OP_vkCommandBufferHostSyncGOOGLE; |
| 23086 | stream->write(&opcode_vkCommandBufferHostSyncGOOGLE, sizeof(uint32_t)); |
| 23087 | stream->write(&packetSize_vkCommandBufferHostSyncGOOGLE, sizeof(uint32_t)); |
| 23088 | uint64_t cgen_var_1519; |
| 23089 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1519, 1); |
| 23090 | stream->write((uint64_t*)&cgen_var_1519, 1 * 8); |
| 23091 | stream->write((uint32_t*)&local_needHostSync, sizeof(uint32_t)); |
| 23092 | stream->write((uint32_t*)&local_sequenceNumber, sizeof(uint32_t)); |
| 23093 | AEMU_SCOPED_TRACE("vkCommandBufferHostSyncGOOGLE readParams"); |
| 23094 | AEMU_SCOPED_TRACE("vkCommandBufferHostSyncGOOGLE returnUnmarshal"); |
| 23095 | mImpl->log("finish vkCommandBufferHostSyncGOOGLE");; |
| 23096 | } |
| 23097 | |
| Lingfeng Yang | c53e747 | 2019-03-27 08:50:55 -0700 | [diff] [blame] | 23098 | #endif |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 23099 | |
| Lingfeng Yang | b1d9010 | 2018-11-29 16:10:36 -0800 | [diff] [blame] | 23100 | } // namespace goldfish_vk |