| 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 | dcac401 | 2020-09-16 23:50:03 -0700 | [diff] [blame^] | 62 | #include "VkEncoder.cpp.inl" |
| Lingfeng Yang | fa7efc3 | 2020-08-27 09:10:42 -0700 | [diff] [blame] | 63 | |
| Lingfeng Yang | 60b411d | 2018-11-29 00:26:45 -0800 | [diff] [blame] | 64 | #define VALIDATE_RET(retType, success, validate) \ |
| 65 | retType goldfish_vk_validateResult = validate; \ |
| 66 | if (goldfish_vk_validateResult != success) return goldfish_vk_validateResult; \ |
| 67 | |
| 68 | #define VALIDATE_VOID(validate) \ |
| 69 | VkResult goldfish_vk_validateResult = validate; \ |
| 70 | if (goldfish_vk_validateResult != VK_SUCCESS) return; \ |
| 71 | |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 72 | #ifdef VK_VERSION_1_0 |
| 73 | VkResult VkEncoder::vkCreateInstance( |
| 74 | const VkInstanceCreateInfo* pCreateInfo, |
| 75 | const VkAllocationCallbacks* pAllocator, |
| 76 | VkInstance* pInstance) |
| 77 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 78 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 79 | mImpl->log("start vkCreateInstance"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 80 | auto stream = mImpl->stream(); |
| 81 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 82 | auto resources = mImpl->resources(); |
| 83 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 84 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 85 | VkInstanceCreateInfo* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 86 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 87 | local_pCreateInfo = nullptr; |
| 88 | if (pCreateInfo) |
| 89 | { |
| 90 | local_pCreateInfo = (VkInstanceCreateInfo*)pool->alloc(sizeof(const VkInstanceCreateInfo)); |
| 91 | deepcopy_VkInstanceCreateInfo(pool, pCreateInfo, (VkInstanceCreateInfo*)(local_pCreateInfo)); |
| 92 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 93 | local_pAllocator = nullptr; |
| 94 | if (pAllocator) |
| 95 | { |
| 96 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 97 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 98 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 99 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 100 | if (local_pCreateInfo) |
| 101 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 102 | transform_tohost_VkInstanceCreateInfo(mImpl->resources(), (VkInstanceCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 103 | } |
| 104 | if (local_pAllocator) |
| 105 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 106 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 107 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 108 | countingStream->rewind(); |
| 109 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 110 | marshal_VkInstanceCreateInfo(countingStream, (VkInstanceCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 111 | // WARNING PTR CHECK |
| 112 | uint64_t cgen_var_0 = (uint64_t)(uintptr_t)local_pAllocator; |
| 113 | countingStream->putBe64(cgen_var_0); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 114 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 115 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 116 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 117 | } |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 118 | uint64_t cgen_var_1; |
| 119 | countingStream->handleMapping()->mapHandles_VkInstance_u64(pInstance, &cgen_var_1, 1); |
| 120 | countingStream->write((uint64_t*)&cgen_var_1, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 121 | } |
| 122 | uint32_t packetSize_vkCreateInstance = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 123 | countingStream->rewind(); |
| 124 | uint32_t opcode_vkCreateInstance = OP_vkCreateInstance; |
| 125 | stream->write(&opcode_vkCreateInstance, sizeof(uint32_t)); |
| 126 | stream->write(&packetSize_vkCreateInstance, sizeof(uint32_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 127 | marshal_VkInstanceCreateInfo(stream, (VkInstanceCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 128 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 129 | uint64_t cgen_var_2 = (uint64_t)(uintptr_t)local_pAllocator; |
| 130 | stream->putBe64(cgen_var_2); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 131 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 132 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 133 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 134 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 135 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 136 | uint64_t cgen_var_3; |
| 137 | stream->handleMapping()->mapHandles_VkInstance_u64(pInstance, &cgen_var_3, 1); |
| 138 | stream->write((uint64_t*)&cgen_var_3, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 139 | stream->setHandleMapping(resources->unwrapMapping()); |
| 140 | stream->setHandleMapping(resources->createMapping()); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 141 | uint64_t cgen_var_4; |
| 142 | stream->read((uint64_t*)&cgen_var_4, 8); |
| 143 | stream->handleMapping()->mapHandles_u64_VkInstance(&cgen_var_4, (VkInstance*)pInstance, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 144 | stream->unsetHandleMapping(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 145 | VkResult vkCreateInstance_VkResult_return = (VkResult)0; |
| 146 | stream->read(&vkCreateInstance_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 147 | mImpl->resources()->on_vkCreateInstance(this, vkCreateInstance_VkResult_return, pCreateInfo, pAllocator, pInstance); |
| 148 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 149 | countingStream->clearPool(); |
| 150 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 151 | mImpl->log("finish vkCreateInstance");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 152 | return vkCreateInstance_VkResult_return; |
| 153 | } |
| 154 | |
| 155 | void VkEncoder::vkDestroyInstance( |
| 156 | VkInstance instance, |
| 157 | const VkAllocationCallbacks* pAllocator) |
| 158 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 159 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 160 | mImpl->log("start vkDestroyInstance"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 161 | auto stream = mImpl->stream(); |
| 162 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 163 | auto resources = mImpl->resources(); |
| 164 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 165 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 166 | VkInstance local_instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 167 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 168 | local_instance = instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 169 | local_pAllocator = nullptr; |
| 170 | if (pAllocator) |
| 171 | { |
| 172 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 173 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 174 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 175 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 176 | if (local_pAllocator) |
| 177 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 178 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 179 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 180 | countingStream->rewind(); |
| 181 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 182 | uint64_t cgen_var_5; |
| 183 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_5, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 184 | countingStream->write((uint64_t*)&cgen_var_5, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 185 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 186 | uint64_t cgen_var_6 = (uint64_t)(uintptr_t)local_pAllocator; |
| 187 | countingStream->putBe64(cgen_var_6); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 188 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 189 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 190 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 191 | } |
| 192 | } |
| 193 | uint32_t packetSize_vkDestroyInstance = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 194 | countingStream->rewind(); |
| 195 | uint32_t opcode_vkDestroyInstance = OP_vkDestroyInstance; |
| 196 | stream->write(&opcode_vkDestroyInstance, sizeof(uint32_t)); |
| 197 | stream->write(&packetSize_vkDestroyInstance, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 198 | uint64_t cgen_var_7; |
| 199 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_7, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 200 | stream->write((uint64_t*)&cgen_var_7, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 201 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 202 | uint64_t cgen_var_8 = (uint64_t)(uintptr_t)local_pAllocator; |
| 203 | stream->putBe64(cgen_var_8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 204 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 205 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 206 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 207 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 208 | resources->destroyMapping()->mapHandles_VkInstance((VkInstance*)&instance); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 209 | pool->freeAll(); |
| 210 | countingStream->clearPool(); |
| 211 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 212 | mImpl->log("finish vkDestroyInstance");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 213 | } |
| 214 | |
| 215 | VkResult VkEncoder::vkEnumeratePhysicalDevices( |
| 216 | VkInstance instance, |
| 217 | uint32_t* pPhysicalDeviceCount, |
| 218 | VkPhysicalDevice* pPhysicalDevices) |
| 219 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 220 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 221 | mImpl->log("start vkEnumeratePhysicalDevices"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 222 | auto stream = mImpl->stream(); |
| 223 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 224 | auto resources = mImpl->resources(); |
| 225 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 226 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 227 | VkInstance local_instance; |
| 228 | local_instance = instance; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 229 | countingStream->rewind(); |
| 230 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 231 | uint64_t cgen_var_9; |
| 232 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_9, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 233 | countingStream->write((uint64_t*)&cgen_var_9, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 234 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 235 | uint64_t cgen_var_10 = (uint64_t)(uintptr_t)pPhysicalDeviceCount; |
| 236 | countingStream->putBe64(cgen_var_10); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 237 | if (pPhysicalDeviceCount) |
| 238 | { |
| 239 | countingStream->write((uint32_t*)pPhysicalDeviceCount, sizeof(uint32_t)); |
| 240 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 241 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 242 | uint64_t cgen_var_11 = (uint64_t)(uintptr_t)pPhysicalDevices; |
| 243 | countingStream->putBe64(cgen_var_11); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 244 | if (pPhysicalDevices) |
| 245 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 246 | if ((*(pPhysicalDeviceCount))) |
| 247 | { |
| 248 | uint64_t* cgen_var_12; |
| 249 | countingStream->alloc((void**)&cgen_var_12, (*(pPhysicalDeviceCount)) * 8); |
| 250 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(pPhysicalDevices, cgen_var_12, (*(pPhysicalDeviceCount))); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 251 | countingStream->write((uint64_t*)cgen_var_12, (*(pPhysicalDeviceCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 252 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 253 | } |
| 254 | } |
| 255 | uint32_t packetSize_vkEnumeratePhysicalDevices = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 256 | countingStream->rewind(); |
| 257 | uint32_t opcode_vkEnumeratePhysicalDevices = OP_vkEnumeratePhysicalDevices; |
| 258 | stream->write(&opcode_vkEnumeratePhysicalDevices, sizeof(uint32_t)); |
| 259 | stream->write(&packetSize_vkEnumeratePhysicalDevices, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 260 | uint64_t cgen_var_13; |
| 261 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_13, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 262 | stream->write((uint64_t*)&cgen_var_13, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 263 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 264 | uint64_t cgen_var_14 = (uint64_t)(uintptr_t)pPhysicalDeviceCount; |
| 265 | stream->putBe64(cgen_var_14); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 266 | if (pPhysicalDeviceCount) |
| 267 | { |
| 268 | stream->write((uint32_t*)pPhysicalDeviceCount, sizeof(uint32_t)); |
| 269 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 270 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 271 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 272 | uint64_t cgen_var_15 = (uint64_t)(uintptr_t)pPhysicalDevices; |
| 273 | stream->putBe64(cgen_var_15); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 274 | if (pPhysicalDevices) |
| 275 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 276 | if ((*(pPhysicalDeviceCount))) |
| 277 | { |
| 278 | uint64_t* cgen_var_16; |
| 279 | stream->alloc((void**)&cgen_var_16, (*(pPhysicalDeviceCount)) * 8); |
| 280 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(pPhysicalDevices, cgen_var_16, (*(pPhysicalDeviceCount))); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 281 | stream->write((uint64_t*)cgen_var_16, (*(pPhysicalDeviceCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 282 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 283 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 284 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 285 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 286 | uint32_t* check_pPhysicalDeviceCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 287 | check_pPhysicalDeviceCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 288 | if (pPhysicalDeviceCount) |
| 289 | { |
| 290 | if (!(check_pPhysicalDeviceCount)) |
| 291 | { |
| 292 | fprintf(stderr, "fatal: pPhysicalDeviceCount inconsistent between guest and host\n"); |
| 293 | } |
| 294 | stream->read((uint32_t*)pPhysicalDeviceCount, sizeof(uint32_t)); |
| 295 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 296 | stream->setHandleMapping(resources->createMapping()); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 297 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 298 | VkPhysicalDevice* check_pPhysicalDevices; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 299 | check_pPhysicalDevices = (VkPhysicalDevice*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 300 | if (pPhysicalDevices) |
| 301 | { |
| 302 | if (!(check_pPhysicalDevices)) |
| 303 | { |
| 304 | fprintf(stderr, "fatal: pPhysicalDevices inconsistent between guest and host\n"); |
| 305 | } |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 306 | if ((*(pPhysicalDeviceCount))) |
| 307 | { |
| 308 | uint64_t* cgen_var_19; |
| 309 | stream->alloc((void**)&cgen_var_19, (*(pPhysicalDeviceCount)) * 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 310 | stream->read((uint64_t*)cgen_var_19, (*(pPhysicalDeviceCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 311 | stream->handleMapping()->mapHandles_u64_VkPhysicalDevice(cgen_var_19, (VkPhysicalDevice*)pPhysicalDevices, (*(pPhysicalDeviceCount))); |
| 312 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 313 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 314 | stream->unsetHandleMapping(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 315 | VkResult vkEnumeratePhysicalDevices_VkResult_return = (VkResult)0; |
| 316 | stream->read(&vkEnumeratePhysicalDevices_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 317 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 318 | countingStream->clearPool(); |
| 319 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 320 | mImpl->log("finish vkEnumeratePhysicalDevices");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 321 | return vkEnumeratePhysicalDevices_VkResult_return; |
| 322 | } |
| 323 | |
| 324 | void VkEncoder::vkGetPhysicalDeviceFeatures( |
| 325 | VkPhysicalDevice physicalDevice, |
| 326 | VkPhysicalDeviceFeatures* pFeatures) |
| 327 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 328 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 329 | mImpl->log("start vkGetPhysicalDeviceFeatures"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 330 | auto stream = mImpl->stream(); |
| 331 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 332 | auto resources = mImpl->resources(); |
| 333 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 334 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 335 | VkPhysicalDevice local_physicalDevice; |
| 336 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 337 | countingStream->rewind(); |
| 338 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 339 | uint64_t cgen_var_20; |
| 340 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_20, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 341 | countingStream->write((uint64_t*)&cgen_var_20, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 342 | marshal_VkPhysicalDeviceFeatures(countingStream, (VkPhysicalDeviceFeatures*)(pFeatures)); |
| 343 | } |
| 344 | uint32_t packetSize_vkGetPhysicalDeviceFeatures = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 345 | countingStream->rewind(); |
| 346 | uint32_t opcode_vkGetPhysicalDeviceFeatures = OP_vkGetPhysicalDeviceFeatures; |
| 347 | stream->write(&opcode_vkGetPhysicalDeviceFeatures, sizeof(uint32_t)); |
| 348 | stream->write(&packetSize_vkGetPhysicalDeviceFeatures, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 349 | uint64_t cgen_var_21; |
| 350 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_21, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 351 | stream->write((uint64_t*)&cgen_var_21, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 352 | marshal_VkPhysicalDeviceFeatures(stream, (VkPhysicalDeviceFeatures*)(pFeatures)); |
| 353 | unmarshal_VkPhysicalDeviceFeatures(stream, (VkPhysicalDeviceFeatures*)(pFeatures)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 354 | if (pFeatures) |
| 355 | { |
| 356 | transform_fromhost_VkPhysicalDeviceFeatures(mImpl->resources(), (VkPhysicalDeviceFeatures*)(pFeatures)); |
| 357 | } |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 358 | pool->freeAll(); |
| 359 | countingStream->clearPool(); |
| 360 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 361 | mImpl->log("finish vkGetPhysicalDeviceFeatures");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 362 | } |
| 363 | |
| 364 | void VkEncoder::vkGetPhysicalDeviceFormatProperties( |
| 365 | VkPhysicalDevice physicalDevice, |
| 366 | VkFormat format, |
| 367 | VkFormatProperties* pFormatProperties) |
| 368 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 369 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 370 | mImpl->log("start vkGetPhysicalDeviceFormatProperties"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 371 | auto stream = mImpl->stream(); |
| 372 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 373 | auto resources = mImpl->resources(); |
| 374 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 375 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 376 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 377 | VkFormat local_format; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 378 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 379 | local_format = format; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 380 | countingStream->rewind(); |
| 381 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 382 | uint64_t cgen_var_22; |
| 383 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_22, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 384 | countingStream->write((uint64_t*)&cgen_var_22, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 385 | countingStream->write((VkFormat*)&local_format, sizeof(VkFormat)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 386 | marshal_VkFormatProperties(countingStream, (VkFormatProperties*)(pFormatProperties)); |
| 387 | } |
| 388 | uint32_t packetSize_vkGetPhysicalDeviceFormatProperties = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 389 | countingStream->rewind(); |
| 390 | uint32_t opcode_vkGetPhysicalDeviceFormatProperties = OP_vkGetPhysicalDeviceFormatProperties; |
| 391 | stream->write(&opcode_vkGetPhysicalDeviceFormatProperties, sizeof(uint32_t)); |
| 392 | stream->write(&packetSize_vkGetPhysicalDeviceFormatProperties, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 393 | uint64_t cgen_var_23; |
| 394 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_23, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 395 | stream->write((uint64_t*)&cgen_var_23, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 396 | stream->write((VkFormat*)&local_format, sizeof(VkFormat)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 397 | marshal_VkFormatProperties(stream, (VkFormatProperties*)(pFormatProperties)); |
| 398 | unmarshal_VkFormatProperties(stream, (VkFormatProperties*)(pFormatProperties)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 399 | if (pFormatProperties) |
| 400 | { |
| 401 | transform_fromhost_VkFormatProperties(mImpl->resources(), (VkFormatProperties*)(pFormatProperties)); |
| 402 | } |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 403 | pool->freeAll(); |
| 404 | countingStream->clearPool(); |
| 405 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 406 | mImpl->log("finish vkGetPhysicalDeviceFormatProperties");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 407 | } |
| 408 | |
| 409 | VkResult VkEncoder::vkGetPhysicalDeviceImageFormatProperties( |
| 410 | VkPhysicalDevice physicalDevice, |
| 411 | VkFormat format, |
| 412 | VkImageType type, |
| 413 | VkImageTiling tiling, |
| 414 | VkImageUsageFlags usage, |
| 415 | VkImageCreateFlags flags, |
| 416 | VkImageFormatProperties* pImageFormatProperties) |
| 417 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 418 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 419 | mImpl->log("start vkGetPhysicalDeviceImageFormatProperties"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 420 | auto stream = mImpl->stream(); |
| 421 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 422 | auto resources = mImpl->resources(); |
| 423 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 424 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 425 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 426 | VkFormat local_format; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 427 | VkImageType local_type; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 428 | VkImageTiling local_tiling; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 429 | VkImageUsageFlags local_usage; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 430 | VkImageCreateFlags local_flags; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 431 | local_physicalDevice = physicalDevice; |
| 432 | local_format = format; |
| 433 | local_type = type; |
| 434 | local_tiling = tiling; |
| 435 | local_usage = usage; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 436 | local_flags = flags; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 437 | countingStream->rewind(); |
| 438 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 439 | uint64_t cgen_var_24; |
| 440 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_24, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 441 | countingStream->write((uint64_t*)&cgen_var_24, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 442 | countingStream->write((VkFormat*)&local_format, sizeof(VkFormat)); |
| 443 | countingStream->write((VkImageType*)&local_type, sizeof(VkImageType)); |
| 444 | countingStream->write((VkImageTiling*)&local_tiling, sizeof(VkImageTiling)); |
| 445 | countingStream->write((VkImageUsageFlags*)&local_usage, sizeof(VkImageUsageFlags)); |
| 446 | countingStream->write((VkImageCreateFlags*)&local_flags, sizeof(VkImageCreateFlags)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 447 | marshal_VkImageFormatProperties(countingStream, (VkImageFormatProperties*)(pImageFormatProperties)); |
| 448 | } |
| 449 | uint32_t packetSize_vkGetPhysicalDeviceImageFormatProperties = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 450 | countingStream->rewind(); |
| 451 | uint32_t opcode_vkGetPhysicalDeviceImageFormatProperties = OP_vkGetPhysicalDeviceImageFormatProperties; |
| 452 | stream->write(&opcode_vkGetPhysicalDeviceImageFormatProperties, sizeof(uint32_t)); |
| 453 | stream->write(&packetSize_vkGetPhysicalDeviceImageFormatProperties, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 454 | uint64_t cgen_var_25; |
| 455 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_25, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 456 | stream->write((uint64_t*)&cgen_var_25, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 457 | stream->write((VkFormat*)&local_format, sizeof(VkFormat)); |
| 458 | stream->write((VkImageType*)&local_type, sizeof(VkImageType)); |
| 459 | stream->write((VkImageTiling*)&local_tiling, sizeof(VkImageTiling)); |
| 460 | stream->write((VkImageUsageFlags*)&local_usage, sizeof(VkImageUsageFlags)); |
| 461 | stream->write((VkImageCreateFlags*)&local_flags, sizeof(VkImageCreateFlags)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 462 | marshal_VkImageFormatProperties(stream, (VkImageFormatProperties*)(pImageFormatProperties)); |
| 463 | unmarshal_VkImageFormatProperties(stream, (VkImageFormatProperties*)(pImageFormatProperties)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 464 | if (pImageFormatProperties) |
| 465 | { |
| 466 | transform_fromhost_VkImageFormatProperties(mImpl->resources(), (VkImageFormatProperties*)(pImageFormatProperties)); |
| 467 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 468 | VkResult vkGetPhysicalDeviceImageFormatProperties_VkResult_return = (VkResult)0; |
| 469 | stream->read(&vkGetPhysicalDeviceImageFormatProperties_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 470 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 471 | countingStream->clearPool(); |
| 472 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 473 | mImpl->log("finish vkGetPhysicalDeviceImageFormatProperties");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 474 | return vkGetPhysicalDeviceImageFormatProperties_VkResult_return; |
| 475 | } |
| 476 | |
| 477 | void VkEncoder::vkGetPhysicalDeviceProperties( |
| 478 | VkPhysicalDevice physicalDevice, |
| 479 | VkPhysicalDeviceProperties* pProperties) |
| 480 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 481 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 482 | mImpl->log("start vkGetPhysicalDeviceProperties"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 483 | auto stream = mImpl->stream(); |
| 484 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 485 | auto resources = mImpl->resources(); |
| 486 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 487 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 488 | VkPhysicalDevice local_physicalDevice; |
| 489 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 490 | countingStream->rewind(); |
| 491 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 492 | uint64_t cgen_var_26; |
| 493 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_26, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 494 | countingStream->write((uint64_t*)&cgen_var_26, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 495 | marshal_VkPhysicalDeviceProperties(countingStream, (VkPhysicalDeviceProperties*)(pProperties)); |
| 496 | } |
| 497 | uint32_t packetSize_vkGetPhysicalDeviceProperties = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 498 | countingStream->rewind(); |
| 499 | uint32_t opcode_vkGetPhysicalDeviceProperties = OP_vkGetPhysicalDeviceProperties; |
| 500 | stream->write(&opcode_vkGetPhysicalDeviceProperties, sizeof(uint32_t)); |
| 501 | stream->write(&packetSize_vkGetPhysicalDeviceProperties, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 502 | uint64_t cgen_var_27; |
| 503 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_27, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 504 | stream->write((uint64_t*)&cgen_var_27, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 505 | marshal_VkPhysicalDeviceProperties(stream, (VkPhysicalDeviceProperties*)(pProperties)); |
| 506 | unmarshal_VkPhysicalDeviceProperties(stream, (VkPhysicalDeviceProperties*)(pProperties)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 507 | if (pProperties) |
| 508 | { |
| 509 | transform_fromhost_VkPhysicalDeviceProperties(mImpl->resources(), (VkPhysicalDeviceProperties*)(pProperties)); |
| 510 | } |
| Yilong Li | f336908 | 2020-06-25 03:39:24 -0700 | [diff] [blame] | 511 | mImpl->resources()->on_vkGetPhysicalDeviceProperties(this, physicalDevice, pProperties); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 512 | pool->freeAll(); |
| 513 | countingStream->clearPool(); |
| 514 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 515 | mImpl->log("finish vkGetPhysicalDeviceProperties");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 516 | } |
| 517 | |
| 518 | void VkEncoder::vkGetPhysicalDeviceQueueFamilyProperties( |
| 519 | VkPhysicalDevice physicalDevice, |
| 520 | uint32_t* pQueueFamilyPropertyCount, |
| 521 | VkQueueFamilyProperties* pQueueFamilyProperties) |
| 522 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 523 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 524 | mImpl->log("start vkGetPhysicalDeviceQueueFamilyProperties"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 525 | auto stream = mImpl->stream(); |
| 526 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 527 | auto resources = mImpl->resources(); |
| 528 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 529 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 530 | VkPhysicalDevice local_physicalDevice; |
| 531 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 532 | countingStream->rewind(); |
| 533 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 534 | uint64_t cgen_var_28; |
| 535 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_28, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 536 | countingStream->write((uint64_t*)&cgen_var_28, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 537 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 538 | uint64_t cgen_var_29 = (uint64_t)(uintptr_t)pQueueFamilyPropertyCount; |
| 539 | countingStream->putBe64(cgen_var_29); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 540 | if (pQueueFamilyPropertyCount) |
| 541 | { |
| 542 | countingStream->write((uint32_t*)pQueueFamilyPropertyCount, sizeof(uint32_t)); |
| 543 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 544 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 545 | uint64_t cgen_var_30 = (uint64_t)(uintptr_t)pQueueFamilyProperties; |
| 546 | countingStream->putBe64(cgen_var_30); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 547 | if (pQueueFamilyProperties) |
| 548 | { |
| 549 | for (uint32_t i = 0; i < (uint32_t)(*(pQueueFamilyPropertyCount)); ++i) |
| 550 | { |
| 551 | marshal_VkQueueFamilyProperties(countingStream, (VkQueueFamilyProperties*)(pQueueFamilyProperties + i)); |
| 552 | } |
| 553 | } |
| 554 | } |
| 555 | uint32_t packetSize_vkGetPhysicalDeviceQueueFamilyProperties = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 556 | countingStream->rewind(); |
| 557 | uint32_t opcode_vkGetPhysicalDeviceQueueFamilyProperties = OP_vkGetPhysicalDeviceQueueFamilyProperties; |
| 558 | stream->write(&opcode_vkGetPhysicalDeviceQueueFamilyProperties, sizeof(uint32_t)); |
| 559 | stream->write(&packetSize_vkGetPhysicalDeviceQueueFamilyProperties, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 560 | uint64_t cgen_var_31; |
| 561 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_31, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 562 | stream->write((uint64_t*)&cgen_var_31, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 563 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 564 | uint64_t cgen_var_32 = (uint64_t)(uintptr_t)pQueueFamilyPropertyCount; |
| 565 | stream->putBe64(cgen_var_32); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 566 | if (pQueueFamilyPropertyCount) |
| 567 | { |
| 568 | stream->write((uint32_t*)pQueueFamilyPropertyCount, sizeof(uint32_t)); |
| 569 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 570 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 571 | uint64_t cgen_var_33 = (uint64_t)(uintptr_t)pQueueFamilyProperties; |
| 572 | stream->putBe64(cgen_var_33); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 573 | if (pQueueFamilyProperties) |
| 574 | { |
| 575 | for (uint32_t i = 0; i < (uint32_t)(*(pQueueFamilyPropertyCount)); ++i) |
| 576 | { |
| 577 | marshal_VkQueueFamilyProperties(stream, (VkQueueFamilyProperties*)(pQueueFamilyProperties + i)); |
| 578 | } |
| 579 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 580 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 581 | uint32_t* check_pQueueFamilyPropertyCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 582 | check_pQueueFamilyPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 583 | if (pQueueFamilyPropertyCount) |
| 584 | { |
| 585 | if (!(check_pQueueFamilyPropertyCount)) |
| 586 | { |
| 587 | fprintf(stderr, "fatal: pQueueFamilyPropertyCount inconsistent between guest and host\n"); |
| 588 | } |
| 589 | stream->read((uint32_t*)pQueueFamilyPropertyCount, sizeof(uint32_t)); |
| 590 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 591 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 592 | VkQueueFamilyProperties* check_pQueueFamilyProperties; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 593 | check_pQueueFamilyProperties = (VkQueueFamilyProperties*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 594 | if (pQueueFamilyProperties) |
| 595 | { |
| 596 | if (!(check_pQueueFamilyProperties)) |
| 597 | { |
| 598 | fprintf(stderr, "fatal: pQueueFamilyProperties inconsistent between guest and host\n"); |
| 599 | } |
| 600 | for (uint32_t i = 0; i < (uint32_t)(*(pQueueFamilyPropertyCount)); ++i) |
| 601 | { |
| 602 | unmarshal_VkQueueFamilyProperties(stream, (VkQueueFamilyProperties*)(pQueueFamilyProperties + i)); |
| 603 | } |
| 604 | } |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 605 | if (pQueueFamilyProperties) |
| 606 | { |
| 607 | for (uint32_t i = 0; i < (uint32_t)(*(pQueueFamilyPropertyCount)); ++i) |
| 608 | { |
| 609 | transform_fromhost_VkQueueFamilyProperties(mImpl->resources(), (VkQueueFamilyProperties*)(pQueueFamilyProperties + i)); |
| 610 | } |
| 611 | } |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 612 | pool->freeAll(); |
| 613 | countingStream->clearPool(); |
| 614 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 615 | mImpl->log("finish vkGetPhysicalDeviceQueueFamilyProperties");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 616 | } |
| 617 | |
| 618 | void VkEncoder::vkGetPhysicalDeviceMemoryProperties( |
| 619 | VkPhysicalDevice physicalDevice, |
| 620 | VkPhysicalDeviceMemoryProperties* pMemoryProperties) |
| 621 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 622 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 623 | mImpl->log("start vkGetPhysicalDeviceMemoryProperties"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 624 | auto stream = mImpl->stream(); |
| 625 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 626 | auto resources = mImpl->resources(); |
| 627 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 628 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 629 | VkPhysicalDevice local_physicalDevice; |
| 630 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 631 | countingStream->rewind(); |
| 632 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 633 | uint64_t cgen_var_36; |
| 634 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_36, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 635 | countingStream->write((uint64_t*)&cgen_var_36, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 636 | marshal_VkPhysicalDeviceMemoryProperties(countingStream, (VkPhysicalDeviceMemoryProperties*)(pMemoryProperties)); |
| 637 | } |
| 638 | uint32_t packetSize_vkGetPhysicalDeviceMemoryProperties = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 639 | countingStream->rewind(); |
| 640 | uint32_t opcode_vkGetPhysicalDeviceMemoryProperties = OP_vkGetPhysicalDeviceMemoryProperties; |
| 641 | stream->write(&opcode_vkGetPhysicalDeviceMemoryProperties, sizeof(uint32_t)); |
| 642 | stream->write(&packetSize_vkGetPhysicalDeviceMemoryProperties, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 643 | uint64_t cgen_var_37; |
| 644 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_37, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 645 | stream->write((uint64_t*)&cgen_var_37, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 646 | marshal_VkPhysicalDeviceMemoryProperties(stream, (VkPhysicalDeviceMemoryProperties*)(pMemoryProperties)); |
| 647 | unmarshal_VkPhysicalDeviceMemoryProperties(stream, (VkPhysicalDeviceMemoryProperties*)(pMemoryProperties)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 648 | if (pMemoryProperties) |
| 649 | { |
| 650 | transform_fromhost_VkPhysicalDeviceMemoryProperties(mImpl->resources(), (VkPhysicalDeviceMemoryProperties*)(pMemoryProperties)); |
| 651 | } |
| 652 | mImpl->resources()->on_vkGetPhysicalDeviceMemoryProperties(this, physicalDevice, pMemoryProperties); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 653 | pool->freeAll(); |
| 654 | countingStream->clearPool(); |
| 655 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 656 | mImpl->log("finish vkGetPhysicalDeviceMemoryProperties");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 657 | } |
| 658 | |
| 659 | PFN_vkVoidFunction VkEncoder::vkGetInstanceProcAddr( |
| 660 | VkInstance instance, |
| 661 | const char* pName) |
| 662 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 663 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 664 | mImpl->log("start vkGetInstanceProcAddr"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 665 | auto stream = mImpl->stream(); |
| 666 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 667 | auto resources = mImpl->resources(); |
| 668 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 669 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 670 | VkInstance local_instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 671 | char* local_pName; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 672 | local_instance = instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 673 | local_pName = nullptr; |
| 674 | if (pName) |
| 675 | { |
| 676 | local_pName = pool->strDup(pName); |
| 677 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 678 | countingStream->rewind(); |
| 679 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 680 | uint64_t cgen_var_38; |
| 681 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_38, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 682 | countingStream->write((uint64_t*)&cgen_var_38, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 683 | countingStream->putString(local_pName); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 684 | } |
| 685 | uint32_t packetSize_vkGetInstanceProcAddr = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 686 | countingStream->rewind(); |
| 687 | uint32_t opcode_vkGetInstanceProcAddr = OP_vkGetInstanceProcAddr; |
| 688 | stream->write(&opcode_vkGetInstanceProcAddr, sizeof(uint32_t)); |
| 689 | stream->write(&packetSize_vkGetInstanceProcAddr, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 690 | uint64_t cgen_var_39; |
| 691 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_39, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 692 | stream->write((uint64_t*)&cgen_var_39, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 693 | stream->putString(local_pName); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 694 | PFN_vkVoidFunction vkGetInstanceProcAddr_PFN_vkVoidFunction_return = (PFN_vkVoidFunction)0; |
| 695 | stream->read(&vkGetInstanceProcAddr_PFN_vkVoidFunction_return, sizeof(PFN_vkVoidFunction)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 696 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 697 | countingStream->clearPool(); |
| 698 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 699 | mImpl->log("finish vkGetInstanceProcAddr");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 700 | return vkGetInstanceProcAddr_PFN_vkVoidFunction_return; |
| 701 | } |
| 702 | |
| 703 | PFN_vkVoidFunction VkEncoder::vkGetDeviceProcAddr( |
| 704 | VkDevice device, |
| 705 | const char* pName) |
| 706 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 707 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 708 | mImpl->log("start vkGetDeviceProcAddr"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 709 | auto stream = mImpl->stream(); |
| 710 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 711 | auto resources = mImpl->resources(); |
| 712 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 713 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 714 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 715 | char* local_pName; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 716 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 717 | local_pName = nullptr; |
| 718 | if (pName) |
| 719 | { |
| 720 | local_pName = pool->strDup(pName); |
| 721 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 722 | countingStream->rewind(); |
| 723 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 724 | uint64_t cgen_var_40; |
| 725 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_40, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 726 | countingStream->write((uint64_t*)&cgen_var_40, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 727 | countingStream->putString(local_pName); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 728 | } |
| 729 | uint32_t packetSize_vkGetDeviceProcAddr = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 730 | countingStream->rewind(); |
| 731 | uint32_t opcode_vkGetDeviceProcAddr = OP_vkGetDeviceProcAddr; |
| 732 | stream->write(&opcode_vkGetDeviceProcAddr, sizeof(uint32_t)); |
| 733 | stream->write(&packetSize_vkGetDeviceProcAddr, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 734 | uint64_t cgen_var_41; |
| 735 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_41, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 736 | stream->write((uint64_t*)&cgen_var_41, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 737 | stream->putString(local_pName); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 738 | PFN_vkVoidFunction vkGetDeviceProcAddr_PFN_vkVoidFunction_return = (PFN_vkVoidFunction)0; |
| 739 | stream->read(&vkGetDeviceProcAddr_PFN_vkVoidFunction_return, sizeof(PFN_vkVoidFunction)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 740 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 741 | countingStream->clearPool(); |
| 742 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 743 | mImpl->log("finish vkGetDeviceProcAddr");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 744 | return vkGetDeviceProcAddr_PFN_vkVoidFunction_return; |
| 745 | } |
| 746 | |
| 747 | VkResult VkEncoder::vkCreateDevice( |
| 748 | VkPhysicalDevice physicalDevice, |
| 749 | const VkDeviceCreateInfo* pCreateInfo, |
| 750 | const VkAllocationCallbacks* pAllocator, |
| 751 | VkDevice* pDevice) |
| 752 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 753 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 754 | mImpl->log("start vkCreateDevice"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 755 | auto stream = mImpl->stream(); |
| 756 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 757 | auto resources = mImpl->resources(); |
| 758 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 759 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 760 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 761 | VkDeviceCreateInfo* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 762 | VkAllocationCallbacks* local_pAllocator; |
| 763 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 764 | local_pCreateInfo = nullptr; |
| 765 | if (pCreateInfo) |
| 766 | { |
| 767 | local_pCreateInfo = (VkDeviceCreateInfo*)pool->alloc(sizeof(const VkDeviceCreateInfo)); |
| 768 | deepcopy_VkDeviceCreateInfo(pool, pCreateInfo, (VkDeviceCreateInfo*)(local_pCreateInfo)); |
| 769 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 770 | local_pAllocator = nullptr; |
| 771 | if (pAllocator) |
| 772 | { |
| 773 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 774 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 775 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 776 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 777 | if (local_pCreateInfo) |
| 778 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 779 | transform_tohost_VkDeviceCreateInfo(mImpl->resources(), (VkDeviceCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 780 | } |
| 781 | if (local_pAllocator) |
| 782 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 783 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 784 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 785 | countingStream->rewind(); |
| 786 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 787 | uint64_t cgen_var_42; |
| 788 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_42, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 789 | countingStream->write((uint64_t*)&cgen_var_42, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 790 | marshal_VkDeviceCreateInfo(countingStream, (VkDeviceCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 791 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 792 | uint64_t cgen_var_43 = (uint64_t)(uintptr_t)local_pAllocator; |
| 793 | countingStream->putBe64(cgen_var_43); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 794 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 795 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 796 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 797 | } |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 798 | uint64_t cgen_var_44; |
| 799 | countingStream->handleMapping()->mapHandles_VkDevice_u64(pDevice, &cgen_var_44, 1); |
| 800 | countingStream->write((uint64_t*)&cgen_var_44, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 801 | } |
| 802 | uint32_t packetSize_vkCreateDevice = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 803 | countingStream->rewind(); |
| 804 | uint32_t opcode_vkCreateDevice = OP_vkCreateDevice; |
| 805 | stream->write(&opcode_vkCreateDevice, sizeof(uint32_t)); |
| 806 | stream->write(&packetSize_vkCreateDevice, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 807 | uint64_t cgen_var_45; |
| 808 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_45, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 809 | stream->write((uint64_t*)&cgen_var_45, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 810 | marshal_VkDeviceCreateInfo(stream, (VkDeviceCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 811 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 812 | uint64_t cgen_var_46 = (uint64_t)(uintptr_t)local_pAllocator; |
| 813 | stream->putBe64(cgen_var_46); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 814 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 815 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 816 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 817 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 818 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 819 | uint64_t cgen_var_47; |
| 820 | stream->handleMapping()->mapHandles_VkDevice_u64(pDevice, &cgen_var_47, 1); |
| 821 | stream->write((uint64_t*)&cgen_var_47, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 822 | stream->setHandleMapping(resources->unwrapMapping()); |
| 823 | stream->setHandleMapping(resources->createMapping()); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 824 | uint64_t cgen_var_48; |
| 825 | stream->read((uint64_t*)&cgen_var_48, 8); |
| 826 | stream->handleMapping()->mapHandles_u64_VkDevice(&cgen_var_48, (VkDevice*)pDevice, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 827 | stream->unsetHandleMapping(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 828 | VkResult vkCreateDevice_VkResult_return = (VkResult)0; |
| 829 | stream->read(&vkCreateDevice_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 830 | mImpl->resources()->on_vkCreateDevice(this, vkCreateDevice_VkResult_return, physicalDevice, pCreateInfo, pAllocator, pDevice); |
| 831 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 832 | countingStream->clearPool(); |
| 833 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 834 | mImpl->log("finish vkCreateDevice");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 835 | return vkCreateDevice_VkResult_return; |
| 836 | } |
| 837 | |
| 838 | void VkEncoder::vkDestroyDevice( |
| 839 | VkDevice device, |
| 840 | const VkAllocationCallbacks* pAllocator) |
| 841 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 842 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 843 | mImpl->log("start vkDestroyDevice"); |
| Lingfeng Yang | 35e9c6a | 2018-12-25 17:13:36 -0800 | [diff] [blame] | 844 | mImpl->resources()->on_vkDestroyDevice_pre(this, device, pAllocator); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 845 | auto stream = mImpl->stream(); |
| 846 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 847 | auto resources = mImpl->resources(); |
| 848 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 849 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 850 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 851 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 852 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 853 | local_pAllocator = nullptr; |
| 854 | if (pAllocator) |
| 855 | { |
| 856 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 857 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 858 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 859 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 860 | if (local_pAllocator) |
| 861 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 862 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 863 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 864 | countingStream->rewind(); |
| 865 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 866 | uint64_t cgen_var_49; |
| 867 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_49, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 868 | countingStream->write((uint64_t*)&cgen_var_49, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 869 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 870 | uint64_t cgen_var_50 = (uint64_t)(uintptr_t)local_pAllocator; |
| 871 | countingStream->putBe64(cgen_var_50); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 872 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 873 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 874 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 875 | } |
| 876 | } |
| 877 | uint32_t packetSize_vkDestroyDevice = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 878 | countingStream->rewind(); |
| 879 | uint32_t opcode_vkDestroyDevice = OP_vkDestroyDevice; |
| 880 | stream->write(&opcode_vkDestroyDevice, sizeof(uint32_t)); |
| 881 | stream->write(&packetSize_vkDestroyDevice, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 882 | uint64_t cgen_var_51; |
| 883 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_51, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 884 | stream->write((uint64_t*)&cgen_var_51, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 885 | // WARNING PTR CHECK |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 886 | uint64_t cgen_var_52 = (uint64_t)(uintptr_t)local_pAllocator; |
| 887 | stream->putBe64(cgen_var_52); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 888 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 889 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 890 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 891 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 892 | resources->destroyMapping()->mapHandles_VkDevice((VkDevice*)&device); |
| Lingfeng Yang | 35e9c6a | 2018-12-25 17:13:36 -0800 | [diff] [blame] | 893 | stream->flush(); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 894 | pool->freeAll(); |
| 895 | countingStream->clearPool(); |
| 896 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 897 | mImpl->log("finish vkDestroyDevice");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 898 | } |
| 899 | |
| 900 | VkResult VkEncoder::vkEnumerateInstanceExtensionProperties( |
| 901 | const char* pLayerName, |
| 902 | uint32_t* pPropertyCount, |
| 903 | VkExtensionProperties* pProperties) |
| 904 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 905 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 906 | mImpl->log("start vkEnumerateInstanceExtensionProperties"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 907 | auto stream = mImpl->stream(); |
| 908 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 909 | auto resources = mImpl->resources(); |
| 910 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 911 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 912 | char* local_pLayerName; |
| 913 | local_pLayerName = nullptr; |
| 914 | if (pLayerName) |
| 915 | { |
| 916 | local_pLayerName = pool->strDup(pLayerName); |
| 917 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 918 | countingStream->rewind(); |
| 919 | { |
| Lingfeng Yang | b55ed1c | 2019-06-20 15:57:08 -0700 | [diff] [blame] | 920 | if (countingStream->getFeatureBits() & VULKAN_STREAM_FEATURE_NULL_OPTIONAL_STRINGS_BIT) |
| 921 | { |
| 922 | // WARNING PTR CHECK |
| 923 | uint64_t cgen_var_53 = (uint64_t)(uintptr_t)local_pLayerName; |
| 924 | countingStream->putBe64(cgen_var_53); |
| 925 | if (local_pLayerName) |
| 926 | { |
| 927 | countingStream->putString(local_pLayerName); |
| 928 | } |
| 929 | } |
| 930 | else |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 931 | { |
| 932 | countingStream->putString(local_pLayerName); |
| 933 | } |
| 934 | // WARNING PTR CHECK |
| 935 | uint64_t cgen_var_54 = (uint64_t)(uintptr_t)pPropertyCount; |
| 936 | countingStream->putBe64(cgen_var_54); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 937 | if (pPropertyCount) |
| 938 | { |
| 939 | countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 940 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 941 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 942 | uint64_t cgen_var_55 = (uint64_t)(uintptr_t)pProperties; |
| 943 | countingStream->putBe64(cgen_var_55); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 944 | if (pProperties) |
| 945 | { |
| 946 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 947 | { |
| 948 | marshal_VkExtensionProperties(countingStream, (VkExtensionProperties*)(pProperties + i)); |
| 949 | } |
| 950 | } |
| 951 | } |
| 952 | uint32_t packetSize_vkEnumerateInstanceExtensionProperties = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 953 | countingStream->rewind(); |
| 954 | uint32_t opcode_vkEnumerateInstanceExtensionProperties = OP_vkEnumerateInstanceExtensionProperties; |
| 955 | stream->write(&opcode_vkEnumerateInstanceExtensionProperties, sizeof(uint32_t)); |
| 956 | stream->write(&packetSize_vkEnumerateInstanceExtensionProperties, sizeof(uint32_t)); |
| Lingfeng Yang | b55ed1c | 2019-06-20 15:57:08 -0700 | [diff] [blame] | 957 | if (stream->getFeatureBits() & VULKAN_STREAM_FEATURE_NULL_OPTIONAL_STRINGS_BIT) |
| 958 | { |
| 959 | // WARNING PTR CHECK |
| 960 | uint64_t cgen_var_56 = (uint64_t)(uintptr_t)local_pLayerName; |
| 961 | stream->putBe64(cgen_var_56); |
| 962 | if (local_pLayerName) |
| 963 | { |
| 964 | stream->putString(local_pLayerName); |
| 965 | } |
| 966 | } |
| 967 | else |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 968 | { |
| 969 | stream->putString(local_pLayerName); |
| 970 | } |
| 971 | // WARNING PTR CHECK |
| 972 | uint64_t cgen_var_57 = (uint64_t)(uintptr_t)pPropertyCount; |
| 973 | stream->putBe64(cgen_var_57); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 974 | if (pPropertyCount) |
| 975 | { |
| 976 | stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 977 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 978 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 979 | uint64_t cgen_var_58 = (uint64_t)(uintptr_t)pProperties; |
| 980 | stream->putBe64(cgen_var_58); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 981 | if (pProperties) |
| 982 | { |
| 983 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 984 | { |
| 985 | marshal_VkExtensionProperties(stream, (VkExtensionProperties*)(pProperties + i)); |
| 986 | } |
| 987 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 988 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 989 | uint32_t* check_pPropertyCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 990 | check_pPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 991 | if (pPropertyCount) |
| 992 | { |
| 993 | if (!(check_pPropertyCount)) |
| 994 | { |
| 995 | fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n"); |
| 996 | } |
| 997 | stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 998 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 999 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1000 | VkExtensionProperties* check_pProperties; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1001 | check_pProperties = (VkExtensionProperties*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1002 | if (pProperties) |
| 1003 | { |
| 1004 | if (!(check_pProperties)) |
| 1005 | { |
| 1006 | fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n"); |
| 1007 | } |
| 1008 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 1009 | { |
| 1010 | unmarshal_VkExtensionProperties(stream, (VkExtensionProperties*)(pProperties + i)); |
| 1011 | } |
| 1012 | } |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 1013 | if (pProperties) |
| 1014 | { |
| 1015 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 1016 | { |
| 1017 | transform_fromhost_VkExtensionProperties(mImpl->resources(), (VkExtensionProperties*)(pProperties + i)); |
| 1018 | } |
| 1019 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1020 | VkResult vkEnumerateInstanceExtensionProperties_VkResult_return = (VkResult)0; |
| 1021 | stream->read(&vkEnumerateInstanceExtensionProperties_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 1022 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1023 | countingStream->clearPool(); |
| 1024 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 1025 | mImpl->log("finish vkEnumerateInstanceExtensionProperties");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1026 | return vkEnumerateInstanceExtensionProperties_VkResult_return; |
| 1027 | } |
| 1028 | |
| 1029 | VkResult VkEncoder::vkEnumerateDeviceExtensionProperties( |
| 1030 | VkPhysicalDevice physicalDevice, |
| 1031 | const char* pLayerName, |
| 1032 | uint32_t* pPropertyCount, |
| 1033 | VkExtensionProperties* pProperties) |
| 1034 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 1035 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 154a33c | 2019-01-29 19:06:23 -0800 | [diff] [blame] | 1036 | mImpl->log("start vkEnumerateDeviceExtensionProperties"); |
| 1037 | auto stream = mImpl->stream(); |
| 1038 | auto countingStream = mImpl->countingStream(); |
| 1039 | auto resources = mImpl->resources(); |
| 1040 | auto pool = mImpl->pool(); |
| 1041 | stream->setHandleMapping(resources->unwrapMapping()); |
| 1042 | VkPhysicalDevice local_physicalDevice; |
| 1043 | char* local_pLayerName; |
| 1044 | local_physicalDevice = physicalDevice; |
| 1045 | local_pLayerName = nullptr; |
| 1046 | if (pLayerName) |
| 1047 | { |
| 1048 | local_pLayerName = pool->strDup(pLayerName); |
| 1049 | } |
| 1050 | countingStream->rewind(); |
| 1051 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1052 | uint64_t cgen_var_61; |
| 1053 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_61, 1); |
| 1054 | countingStream->write((uint64_t*)&cgen_var_61, 1 * 8); |
| Lingfeng Yang | b55ed1c | 2019-06-20 15:57:08 -0700 | [diff] [blame] | 1055 | if (countingStream->getFeatureBits() & VULKAN_STREAM_FEATURE_NULL_OPTIONAL_STRINGS_BIT) |
| 1056 | { |
| 1057 | // WARNING PTR CHECK |
| 1058 | uint64_t cgen_var_62 = (uint64_t)(uintptr_t)local_pLayerName; |
| 1059 | countingStream->putBe64(cgen_var_62); |
| 1060 | if (local_pLayerName) |
| 1061 | { |
| 1062 | countingStream->putString(local_pLayerName); |
| 1063 | } |
| 1064 | } |
| 1065 | else |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1066 | { |
| 1067 | countingStream->putString(local_pLayerName); |
| 1068 | } |
| 1069 | // WARNING PTR CHECK |
| 1070 | uint64_t cgen_var_63 = (uint64_t)(uintptr_t)pPropertyCount; |
| 1071 | countingStream->putBe64(cgen_var_63); |
| Lingfeng Yang | 154a33c | 2019-01-29 19:06:23 -0800 | [diff] [blame] | 1072 | if (pPropertyCount) |
| 1073 | { |
| 1074 | countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 1075 | } |
| 1076 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1077 | uint64_t cgen_var_64 = (uint64_t)(uintptr_t)pProperties; |
| 1078 | countingStream->putBe64(cgen_var_64); |
| Lingfeng Yang | 154a33c | 2019-01-29 19:06:23 -0800 | [diff] [blame] | 1079 | if (pProperties) |
| 1080 | { |
| 1081 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 1082 | { |
| 1083 | marshal_VkExtensionProperties(countingStream, (VkExtensionProperties*)(pProperties + i)); |
| 1084 | } |
| 1085 | } |
| 1086 | } |
| 1087 | uint32_t packetSize_vkEnumerateDeviceExtensionProperties = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 1088 | countingStream->rewind(); |
| 1089 | uint32_t opcode_vkEnumerateDeviceExtensionProperties = OP_vkEnumerateDeviceExtensionProperties; |
| 1090 | stream->write(&opcode_vkEnumerateDeviceExtensionProperties, sizeof(uint32_t)); |
| 1091 | stream->write(&packetSize_vkEnumerateDeviceExtensionProperties, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1092 | uint64_t cgen_var_65; |
| 1093 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_65, 1); |
| 1094 | stream->write((uint64_t*)&cgen_var_65, 1 * 8); |
| Lingfeng Yang | b55ed1c | 2019-06-20 15:57:08 -0700 | [diff] [blame] | 1095 | if (stream->getFeatureBits() & VULKAN_STREAM_FEATURE_NULL_OPTIONAL_STRINGS_BIT) |
| 1096 | { |
| 1097 | // WARNING PTR CHECK |
| 1098 | uint64_t cgen_var_66 = (uint64_t)(uintptr_t)local_pLayerName; |
| 1099 | stream->putBe64(cgen_var_66); |
| 1100 | if (local_pLayerName) |
| 1101 | { |
| 1102 | stream->putString(local_pLayerName); |
| 1103 | } |
| 1104 | } |
| 1105 | else |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1106 | { |
| 1107 | stream->putString(local_pLayerName); |
| 1108 | } |
| 1109 | // WARNING PTR CHECK |
| 1110 | uint64_t cgen_var_67 = (uint64_t)(uintptr_t)pPropertyCount; |
| 1111 | stream->putBe64(cgen_var_67); |
| Lingfeng Yang | 154a33c | 2019-01-29 19:06:23 -0800 | [diff] [blame] | 1112 | if (pPropertyCount) |
| 1113 | { |
| 1114 | stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 1115 | } |
| 1116 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1117 | uint64_t cgen_var_68 = (uint64_t)(uintptr_t)pProperties; |
| 1118 | stream->putBe64(cgen_var_68); |
| Lingfeng Yang | 154a33c | 2019-01-29 19:06:23 -0800 | [diff] [blame] | 1119 | if (pProperties) |
| 1120 | { |
| 1121 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 1122 | { |
| 1123 | marshal_VkExtensionProperties(stream, (VkExtensionProperties*)(pProperties + i)); |
| 1124 | } |
| 1125 | } |
| 1126 | // WARNING PTR CHECK |
| 1127 | uint32_t* check_pPropertyCount; |
| 1128 | check_pPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| 1129 | if (pPropertyCount) |
| 1130 | { |
| 1131 | if (!(check_pPropertyCount)) |
| 1132 | { |
| 1133 | fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n"); |
| 1134 | } |
| 1135 | stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 1136 | } |
| 1137 | // WARNING PTR CHECK |
| 1138 | VkExtensionProperties* check_pProperties; |
| 1139 | check_pProperties = (VkExtensionProperties*)(uintptr_t)stream->getBe64(); |
| 1140 | if (pProperties) |
| 1141 | { |
| 1142 | if (!(check_pProperties)) |
| 1143 | { |
| 1144 | fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n"); |
| 1145 | } |
| 1146 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 1147 | { |
| 1148 | unmarshal_VkExtensionProperties(stream, (VkExtensionProperties*)(pProperties + i)); |
| 1149 | } |
| 1150 | } |
| 1151 | if (pProperties) |
| 1152 | { |
| 1153 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 1154 | { |
| 1155 | transform_fromhost_VkExtensionProperties(mImpl->resources(), (VkExtensionProperties*)(pProperties + i)); |
| 1156 | } |
| 1157 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1158 | VkResult vkEnumerateDeviceExtensionProperties_VkResult_return = (VkResult)0; |
| Lingfeng Yang | 154a33c | 2019-01-29 19:06:23 -0800 | [diff] [blame] | 1159 | stream->read(&vkEnumerateDeviceExtensionProperties_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 1160 | pool->freeAll(); |
| Lingfeng Yang | 154a33c | 2019-01-29 19:06:23 -0800 | [diff] [blame] | 1161 | countingStream->clearPool(); |
| 1162 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 1163 | mImpl->log("finish vkEnumerateDeviceExtensionProperties");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1164 | return vkEnumerateDeviceExtensionProperties_VkResult_return; |
| 1165 | } |
| 1166 | |
| 1167 | VkResult VkEncoder::vkEnumerateInstanceLayerProperties( |
| 1168 | uint32_t* pPropertyCount, |
| 1169 | VkLayerProperties* pProperties) |
| 1170 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 1171 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 1172 | mImpl->log("start vkEnumerateInstanceLayerProperties"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1173 | auto stream = mImpl->stream(); |
| 1174 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1175 | auto resources = mImpl->resources(); |
| 1176 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1177 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1178 | countingStream->rewind(); |
| 1179 | { |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1180 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1181 | uint64_t cgen_var_71 = (uint64_t)(uintptr_t)pPropertyCount; |
| 1182 | countingStream->putBe64(cgen_var_71); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1183 | if (pPropertyCount) |
| 1184 | { |
| 1185 | countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 1186 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1187 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1188 | uint64_t cgen_var_72 = (uint64_t)(uintptr_t)pProperties; |
| 1189 | countingStream->putBe64(cgen_var_72); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1190 | if (pProperties) |
| 1191 | { |
| 1192 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 1193 | { |
| 1194 | marshal_VkLayerProperties(countingStream, (VkLayerProperties*)(pProperties + i)); |
| 1195 | } |
| 1196 | } |
| 1197 | } |
| 1198 | uint32_t packetSize_vkEnumerateInstanceLayerProperties = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 1199 | countingStream->rewind(); |
| 1200 | uint32_t opcode_vkEnumerateInstanceLayerProperties = OP_vkEnumerateInstanceLayerProperties; |
| 1201 | stream->write(&opcode_vkEnumerateInstanceLayerProperties, sizeof(uint32_t)); |
| 1202 | stream->write(&packetSize_vkEnumerateInstanceLayerProperties, sizeof(uint32_t)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1203 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1204 | uint64_t cgen_var_73 = (uint64_t)(uintptr_t)pPropertyCount; |
| 1205 | stream->putBe64(cgen_var_73); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1206 | if (pPropertyCount) |
| 1207 | { |
| 1208 | stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 1209 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1210 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1211 | uint64_t cgen_var_74 = (uint64_t)(uintptr_t)pProperties; |
| 1212 | stream->putBe64(cgen_var_74); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1213 | if (pProperties) |
| 1214 | { |
| 1215 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 1216 | { |
| 1217 | marshal_VkLayerProperties(stream, (VkLayerProperties*)(pProperties + i)); |
| 1218 | } |
| 1219 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1220 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1221 | uint32_t* check_pPropertyCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1222 | check_pPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1223 | if (pPropertyCount) |
| 1224 | { |
| 1225 | if (!(check_pPropertyCount)) |
| 1226 | { |
| 1227 | fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n"); |
| 1228 | } |
| 1229 | stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 1230 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1231 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1232 | VkLayerProperties* check_pProperties; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1233 | check_pProperties = (VkLayerProperties*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1234 | if (pProperties) |
| 1235 | { |
| 1236 | if (!(check_pProperties)) |
| 1237 | { |
| 1238 | fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n"); |
| 1239 | } |
| 1240 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 1241 | { |
| 1242 | unmarshal_VkLayerProperties(stream, (VkLayerProperties*)(pProperties + i)); |
| 1243 | } |
| 1244 | } |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 1245 | if (pProperties) |
| 1246 | { |
| 1247 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 1248 | { |
| 1249 | transform_fromhost_VkLayerProperties(mImpl->resources(), (VkLayerProperties*)(pProperties + i)); |
| 1250 | } |
| 1251 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1252 | VkResult vkEnumerateInstanceLayerProperties_VkResult_return = (VkResult)0; |
| 1253 | stream->read(&vkEnumerateInstanceLayerProperties_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 1254 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1255 | countingStream->clearPool(); |
| 1256 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 1257 | mImpl->log("finish vkEnumerateInstanceLayerProperties");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1258 | return vkEnumerateInstanceLayerProperties_VkResult_return; |
| 1259 | } |
| 1260 | |
| 1261 | VkResult VkEncoder::vkEnumerateDeviceLayerProperties( |
| 1262 | VkPhysicalDevice physicalDevice, |
| 1263 | uint32_t* pPropertyCount, |
| 1264 | VkLayerProperties* pProperties) |
| 1265 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 1266 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 1267 | mImpl->log("start vkEnumerateDeviceLayerProperties"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1268 | auto stream = mImpl->stream(); |
| 1269 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1270 | auto resources = mImpl->resources(); |
| 1271 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1272 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1273 | VkPhysicalDevice local_physicalDevice; |
| 1274 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1275 | countingStream->rewind(); |
| 1276 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1277 | uint64_t cgen_var_77; |
| 1278 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_77, 1); |
| 1279 | countingStream->write((uint64_t*)&cgen_var_77, 1 * 8); |
| 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_78 = (uint64_t)(uintptr_t)pPropertyCount; |
| 1282 | countingStream->putBe64(cgen_var_78); |
| 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_79 = (uint64_t)(uintptr_t)pProperties; |
| 1289 | countingStream->putBe64(cgen_var_79); |
| 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_vkEnumerateDeviceLayerProperties = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 1299 | countingStream->rewind(); |
| 1300 | uint32_t opcode_vkEnumerateDeviceLayerProperties = OP_vkEnumerateDeviceLayerProperties; |
| 1301 | stream->write(&opcode_vkEnumerateDeviceLayerProperties, sizeof(uint32_t)); |
| 1302 | stream->write(&packetSize_vkEnumerateDeviceLayerProperties, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1303 | uint64_t cgen_var_80; |
| 1304 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_80, 1); |
| 1305 | stream->write((uint64_t*)&cgen_var_80, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1306 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1307 | uint64_t cgen_var_81 = (uint64_t)(uintptr_t)pPropertyCount; |
| 1308 | stream->putBe64(cgen_var_81); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1309 | if (pPropertyCount) |
| 1310 | { |
| 1311 | stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 1312 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1313 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1314 | uint64_t cgen_var_82 = (uint64_t)(uintptr_t)pProperties; |
| 1315 | stream->putBe64(cgen_var_82); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1316 | if (pProperties) |
| 1317 | { |
| 1318 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 1319 | { |
| 1320 | marshal_VkLayerProperties(stream, (VkLayerProperties*)(pProperties + i)); |
| 1321 | } |
| 1322 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1323 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1324 | uint32_t* check_pPropertyCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1325 | check_pPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1326 | if (pPropertyCount) |
| 1327 | { |
| 1328 | if (!(check_pPropertyCount)) |
| 1329 | { |
| 1330 | fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n"); |
| 1331 | } |
| 1332 | stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 1333 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1334 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1335 | VkLayerProperties* check_pProperties; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1336 | check_pProperties = (VkLayerProperties*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1337 | if (pProperties) |
| 1338 | { |
| 1339 | if (!(check_pProperties)) |
| 1340 | { |
| 1341 | fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n"); |
| 1342 | } |
| 1343 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 1344 | { |
| 1345 | unmarshal_VkLayerProperties(stream, (VkLayerProperties*)(pProperties + i)); |
| 1346 | } |
| 1347 | } |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 1348 | if (pProperties) |
| 1349 | { |
| 1350 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 1351 | { |
| 1352 | transform_fromhost_VkLayerProperties(mImpl->resources(), (VkLayerProperties*)(pProperties + i)); |
| 1353 | } |
| 1354 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1355 | VkResult vkEnumerateDeviceLayerProperties_VkResult_return = (VkResult)0; |
| 1356 | stream->read(&vkEnumerateDeviceLayerProperties_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 1357 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1358 | countingStream->clearPool(); |
| 1359 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 1360 | mImpl->log("finish vkEnumerateDeviceLayerProperties");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1361 | return vkEnumerateDeviceLayerProperties_VkResult_return; |
| 1362 | } |
| 1363 | |
| 1364 | void VkEncoder::vkGetDeviceQueue( |
| 1365 | VkDevice device, |
| 1366 | uint32_t queueFamilyIndex, |
| 1367 | uint32_t queueIndex, |
| 1368 | VkQueue* pQueue) |
| 1369 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 1370 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 1371 | mImpl->log("start vkGetDeviceQueue"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1372 | auto stream = mImpl->stream(); |
| 1373 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1374 | auto resources = mImpl->resources(); |
| 1375 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1376 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1377 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1378 | uint32_t local_queueFamilyIndex; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1379 | uint32_t local_queueIndex; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 1380 | local_device = device; |
| 1381 | local_queueFamilyIndex = queueFamilyIndex; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1382 | local_queueIndex = queueIndex; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1383 | countingStream->rewind(); |
| 1384 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1385 | uint64_t cgen_var_85; |
| 1386 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_85, 1); |
| 1387 | countingStream->write((uint64_t*)&cgen_var_85, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1388 | countingStream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t)); |
| 1389 | countingStream->write((uint32_t*)&local_queueIndex, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1390 | uint64_t cgen_var_86; |
| 1391 | countingStream->handleMapping()->mapHandles_VkQueue_u64(pQueue, &cgen_var_86, 1); |
| 1392 | countingStream->write((uint64_t*)&cgen_var_86, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1393 | } |
| 1394 | uint32_t packetSize_vkGetDeviceQueue = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 1395 | countingStream->rewind(); |
| 1396 | uint32_t opcode_vkGetDeviceQueue = OP_vkGetDeviceQueue; |
| 1397 | stream->write(&opcode_vkGetDeviceQueue, sizeof(uint32_t)); |
| 1398 | stream->write(&packetSize_vkGetDeviceQueue, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1399 | uint64_t cgen_var_87; |
| 1400 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_87, 1); |
| 1401 | stream->write((uint64_t*)&cgen_var_87, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1402 | stream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t)); |
| 1403 | stream->write((uint32_t*)&local_queueIndex, sizeof(uint32_t)); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1404 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1405 | uint64_t cgen_var_88; |
| 1406 | stream->handleMapping()->mapHandles_VkQueue_u64(pQueue, &cgen_var_88, 1); |
| 1407 | stream->write((uint64_t*)&cgen_var_88, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1408 | stream->setHandleMapping(resources->unwrapMapping()); |
| 1409 | stream->setHandleMapping(resources->createMapping()); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1410 | uint64_t cgen_var_89; |
| 1411 | stream->read((uint64_t*)&cgen_var_89, 8); |
| 1412 | stream->handleMapping()->mapHandles_u64_VkQueue(&cgen_var_89, (VkQueue*)pQueue, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1413 | stream->unsetHandleMapping(); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 1414 | pool->freeAll(); |
| 1415 | countingStream->clearPool(); |
| 1416 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 1417 | mImpl->log("finish vkGetDeviceQueue");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1418 | } |
| 1419 | |
| 1420 | VkResult VkEncoder::vkQueueSubmit( |
| 1421 | VkQueue queue, |
| 1422 | uint32_t submitCount, |
| 1423 | const VkSubmitInfo* pSubmits, |
| 1424 | VkFence fence) |
| 1425 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 1426 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 1427 | mImpl->log("start vkQueueSubmit"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1428 | auto stream = mImpl->stream(); |
| 1429 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1430 | auto resources = mImpl->resources(); |
| 1431 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1432 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1433 | VkQueue local_queue; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1434 | uint32_t local_submitCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1435 | VkSubmitInfo* local_pSubmits; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 1436 | VkFence local_fence; |
| 1437 | local_queue = queue; |
| 1438 | local_submitCount = submitCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1439 | local_pSubmits = nullptr; |
| 1440 | if (pSubmits) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1441 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1442 | local_pSubmits = (VkSubmitInfo*)pool->alloc(((submitCount)) * sizeof(const VkSubmitInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1443 | for (uint32_t i = 0; i < (uint32_t)((submitCount)); ++i) |
| 1444 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1445 | deepcopy_VkSubmitInfo(pool, pSubmits + i, (VkSubmitInfo*)(local_pSubmits + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1446 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1447 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1448 | local_fence = fence; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 1449 | if (local_pSubmits) |
| 1450 | { |
| 1451 | for (uint32_t i = 0; i < (uint32_t)((submitCount)); ++i) |
| 1452 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 1453 | transform_tohost_VkSubmitInfo(mImpl->resources(), (VkSubmitInfo*)(local_pSubmits + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 1454 | } |
| 1455 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1456 | countingStream->rewind(); |
| 1457 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1458 | uint64_t cgen_var_90; |
| 1459 | countingStream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_90, 1); |
| 1460 | countingStream->write((uint64_t*)&cgen_var_90, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1461 | countingStream->write((uint32_t*)&local_submitCount, sizeof(uint32_t)); |
| 1462 | for (uint32_t i = 0; i < (uint32_t)((submitCount)); ++i) |
| 1463 | { |
| 1464 | marshal_VkSubmitInfo(countingStream, (VkSubmitInfo*)(local_pSubmits + i)); |
| 1465 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1466 | uint64_t cgen_var_91; |
| 1467 | countingStream->handleMapping()->mapHandles_VkFence_u64(&local_fence, &cgen_var_91, 1); |
| 1468 | countingStream->write((uint64_t*)&cgen_var_91, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1469 | } |
| 1470 | uint32_t packetSize_vkQueueSubmit = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 1471 | countingStream->rewind(); |
| 1472 | uint32_t opcode_vkQueueSubmit = OP_vkQueueSubmit; |
| 1473 | stream->write(&opcode_vkQueueSubmit, sizeof(uint32_t)); |
| 1474 | stream->write(&packetSize_vkQueueSubmit, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1475 | uint64_t cgen_var_92; |
| 1476 | stream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_92, 1); |
| 1477 | stream->write((uint64_t*)&cgen_var_92, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1478 | stream->write((uint32_t*)&local_submitCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1479 | for (uint32_t i = 0; i < (uint32_t)((submitCount)); ++i) |
| 1480 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1481 | marshal_VkSubmitInfo(stream, (VkSubmitInfo*)(local_pSubmits + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1482 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1483 | uint64_t cgen_var_93; |
| 1484 | stream->handleMapping()->mapHandles_VkFence_u64(&local_fence, &cgen_var_93, 1); |
| 1485 | stream->write((uint64_t*)&cgen_var_93, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1486 | VkResult vkQueueSubmit_VkResult_return = (VkResult)0; |
| 1487 | stream->read(&vkQueueSubmit_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 1488 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1489 | countingStream->clearPool(); |
| 1490 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 1491 | mImpl->log("finish vkQueueSubmit");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1492 | return vkQueueSubmit_VkResult_return; |
| 1493 | } |
| 1494 | |
| 1495 | VkResult VkEncoder::vkQueueWaitIdle( |
| 1496 | VkQueue queue) |
| 1497 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 1498 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 1499 | mImpl->log("start vkQueueWaitIdle"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1500 | auto stream = mImpl->stream(); |
| 1501 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1502 | auto resources = mImpl->resources(); |
| 1503 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1504 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1505 | VkQueue local_queue; |
| 1506 | local_queue = queue; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1507 | countingStream->rewind(); |
| 1508 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1509 | uint64_t cgen_var_94; |
| 1510 | countingStream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_94, 1); |
| 1511 | countingStream->write((uint64_t*)&cgen_var_94, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1512 | } |
| 1513 | uint32_t packetSize_vkQueueWaitIdle = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 1514 | countingStream->rewind(); |
| 1515 | uint32_t opcode_vkQueueWaitIdle = OP_vkQueueWaitIdle; |
| 1516 | stream->write(&opcode_vkQueueWaitIdle, sizeof(uint32_t)); |
| 1517 | stream->write(&packetSize_vkQueueWaitIdle, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1518 | uint64_t cgen_var_95; |
| 1519 | stream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_95, 1); |
| 1520 | stream->write((uint64_t*)&cgen_var_95, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1521 | VkResult vkQueueWaitIdle_VkResult_return = (VkResult)0; |
| 1522 | stream->read(&vkQueueWaitIdle_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 1523 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1524 | countingStream->clearPool(); |
| 1525 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 1526 | mImpl->log("finish vkQueueWaitIdle");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1527 | return vkQueueWaitIdle_VkResult_return; |
| 1528 | } |
| 1529 | |
| 1530 | VkResult VkEncoder::vkDeviceWaitIdle( |
| 1531 | VkDevice device) |
| 1532 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 1533 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 1534 | mImpl->log("start vkDeviceWaitIdle"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1535 | auto stream = mImpl->stream(); |
| 1536 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1537 | auto resources = mImpl->resources(); |
| 1538 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1539 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1540 | VkDevice local_device; |
| 1541 | local_device = device; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1542 | countingStream->rewind(); |
| 1543 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1544 | uint64_t cgen_var_96; |
| 1545 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_96, 1); |
| 1546 | countingStream->write((uint64_t*)&cgen_var_96, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1547 | } |
| 1548 | uint32_t packetSize_vkDeviceWaitIdle = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 1549 | countingStream->rewind(); |
| 1550 | uint32_t opcode_vkDeviceWaitIdle = OP_vkDeviceWaitIdle; |
| 1551 | stream->write(&opcode_vkDeviceWaitIdle, sizeof(uint32_t)); |
| 1552 | stream->write(&packetSize_vkDeviceWaitIdle, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1553 | uint64_t cgen_var_97; |
| 1554 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_97, 1); |
| 1555 | stream->write((uint64_t*)&cgen_var_97, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1556 | VkResult vkDeviceWaitIdle_VkResult_return = (VkResult)0; |
| 1557 | stream->read(&vkDeviceWaitIdle_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 1558 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1559 | countingStream->clearPool(); |
| 1560 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 1561 | mImpl->log("finish vkDeviceWaitIdle");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1562 | return vkDeviceWaitIdle_VkResult_return; |
| 1563 | } |
| 1564 | |
| 1565 | VkResult VkEncoder::vkAllocateMemory( |
| 1566 | VkDevice device, |
| 1567 | const VkMemoryAllocateInfo* pAllocateInfo, |
| 1568 | const VkAllocationCallbacks* pAllocator, |
| 1569 | VkDeviceMemory* pMemory) |
| 1570 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 1571 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 1572 | mImpl->log("start vkAllocateMemory"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1573 | auto stream = mImpl->stream(); |
| 1574 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1575 | auto resources = mImpl->resources(); |
| 1576 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1577 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1578 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1579 | VkMemoryAllocateInfo* local_pAllocateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 1580 | VkAllocationCallbacks* local_pAllocator; |
| 1581 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1582 | local_pAllocateInfo = nullptr; |
| 1583 | if (pAllocateInfo) |
| 1584 | { |
| 1585 | local_pAllocateInfo = (VkMemoryAllocateInfo*)pool->alloc(sizeof(const VkMemoryAllocateInfo)); |
| 1586 | deepcopy_VkMemoryAllocateInfo(pool, pAllocateInfo, (VkMemoryAllocateInfo*)(local_pAllocateInfo)); |
| 1587 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1588 | local_pAllocator = nullptr; |
| 1589 | if (pAllocator) |
| 1590 | { |
| 1591 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 1592 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 1593 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 1594 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 1595 | if (local_pAllocateInfo) |
| 1596 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 1597 | transform_tohost_VkMemoryAllocateInfo(mImpl->resources(), (VkMemoryAllocateInfo*)(local_pAllocateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 1598 | } |
| 1599 | if (local_pAllocator) |
| 1600 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 1601 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 1602 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1603 | countingStream->rewind(); |
| 1604 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1605 | uint64_t cgen_var_98; |
| 1606 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_98, 1); |
| 1607 | countingStream->write((uint64_t*)&cgen_var_98, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1608 | marshal_VkMemoryAllocateInfo(countingStream, (VkMemoryAllocateInfo*)(local_pAllocateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1609 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1610 | uint64_t cgen_var_99 = (uint64_t)(uintptr_t)local_pAllocator; |
| 1611 | countingStream->putBe64(cgen_var_99); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1612 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1613 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1614 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1615 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1616 | uint64_t cgen_var_100; |
| 1617 | countingStream->handleMapping()->mapHandles_VkDeviceMemory_u64(pMemory, &cgen_var_100, 1); |
| 1618 | countingStream->write((uint64_t*)&cgen_var_100, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1619 | } |
| 1620 | uint32_t packetSize_vkAllocateMemory = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 1621 | countingStream->rewind(); |
| 1622 | uint32_t opcode_vkAllocateMemory = OP_vkAllocateMemory; |
| 1623 | stream->write(&opcode_vkAllocateMemory, sizeof(uint32_t)); |
| 1624 | stream->write(&packetSize_vkAllocateMemory, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1625 | uint64_t cgen_var_101; |
| 1626 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_101, 1); |
| 1627 | stream->write((uint64_t*)&cgen_var_101, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1628 | marshal_VkMemoryAllocateInfo(stream, (VkMemoryAllocateInfo*)(local_pAllocateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1629 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1630 | uint64_t cgen_var_102 = (uint64_t)(uintptr_t)local_pAllocator; |
| 1631 | stream->putBe64(cgen_var_102); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1632 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1633 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1634 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1635 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1636 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1637 | uint64_t cgen_var_103; |
| 1638 | stream->handleMapping()->mapHandles_VkDeviceMemory_u64(pMemory, &cgen_var_103, 1); |
| 1639 | stream->write((uint64_t*)&cgen_var_103, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1640 | stream->setHandleMapping(resources->unwrapMapping()); |
| 1641 | stream->setHandleMapping(resources->createMapping()); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1642 | uint64_t cgen_var_104; |
| 1643 | stream->read((uint64_t*)&cgen_var_104, 8); |
| 1644 | stream->handleMapping()->mapHandles_u64_VkDeviceMemory(&cgen_var_104, (VkDeviceMemory*)pMemory, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1645 | stream->unsetHandleMapping(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1646 | VkResult vkAllocateMemory_VkResult_return = (VkResult)0; |
| 1647 | stream->read(&vkAllocateMemory_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 1648 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1649 | countingStream->clearPool(); |
| 1650 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 1651 | mImpl->log("finish vkAllocateMemory");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1652 | return vkAllocateMemory_VkResult_return; |
| 1653 | } |
| 1654 | |
| 1655 | void VkEncoder::vkFreeMemory( |
| 1656 | VkDevice device, |
| 1657 | VkDeviceMemory memory, |
| 1658 | const VkAllocationCallbacks* pAllocator) |
| 1659 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 1660 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 1661 | mImpl->log("start vkFreeMemory"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1662 | auto stream = mImpl->stream(); |
| 1663 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1664 | auto resources = mImpl->resources(); |
| 1665 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1666 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1667 | VkDevice local_device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 1668 | VkDeviceMemory local_memory; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1669 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 1670 | local_device = device; |
| 1671 | local_memory = memory; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1672 | local_pAllocator = nullptr; |
| 1673 | if (pAllocator) |
| 1674 | { |
| 1675 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 1676 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 1677 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 1678 | local_pAllocator = nullptr; |
| Lingfeng Yang | 2b1b8cf | 2019-02-08 09:53:36 -0800 | [diff] [blame] | 1679 | 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] | 1680 | countingStream->rewind(); |
| 1681 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1682 | uint64_t cgen_var_105; |
| 1683 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_105, 1); |
| 1684 | countingStream->write((uint64_t*)&cgen_var_105, 1 * 8); |
| 1685 | uint64_t cgen_var_106; |
| 1686 | countingStream->handleMapping()->mapHandles_VkDeviceMemory_u64(&local_memory, &cgen_var_106, 1); |
| 1687 | countingStream->write((uint64_t*)&cgen_var_106, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1688 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1689 | uint64_t cgen_var_107 = (uint64_t)(uintptr_t)local_pAllocator; |
| 1690 | countingStream->putBe64(cgen_var_107); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1691 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1692 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1693 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1694 | } |
| 1695 | } |
| 1696 | uint32_t packetSize_vkFreeMemory = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 1697 | countingStream->rewind(); |
| 1698 | uint32_t opcode_vkFreeMemory = OP_vkFreeMemory; |
| 1699 | stream->write(&opcode_vkFreeMemory, sizeof(uint32_t)); |
| 1700 | stream->write(&packetSize_vkFreeMemory, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1701 | uint64_t cgen_var_108; |
| 1702 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_108, 1); |
| 1703 | stream->write((uint64_t*)&cgen_var_108, 1 * 8); |
| 1704 | uint64_t cgen_var_109; |
| 1705 | stream->handleMapping()->mapHandles_VkDeviceMemory_u64(&local_memory, &cgen_var_109, 1); |
| 1706 | stream->write((uint64_t*)&cgen_var_109, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 1707 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1708 | uint64_t cgen_var_110 = (uint64_t)(uintptr_t)local_pAllocator; |
| 1709 | stream->putBe64(cgen_var_110); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1710 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1711 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1712 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1713 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1714 | resources->destroyMapping()->mapHandles_VkDeviceMemory((VkDeviceMemory*)&memory); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 1715 | pool->freeAll(); |
| 1716 | countingStream->clearPool(); |
| 1717 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 1718 | mImpl->log("finish vkFreeMemory");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1719 | } |
| 1720 | |
| 1721 | VkResult VkEncoder::vkMapMemory( |
| 1722 | VkDevice device, |
| 1723 | VkDeviceMemory memory, |
| 1724 | VkDeviceSize offset, |
| 1725 | VkDeviceSize size, |
| 1726 | VkMemoryMapFlags flags, |
| 1727 | void** ppData) |
| 1728 | { |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1729 | VkResult vkMapMemory_VkResult_return = (VkResult)0; |
| Lingfeng Yang | def88ba | 2018-12-13 12:43:17 -0800 | [diff] [blame] | 1730 | 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] | 1731 | mImpl->log("finish vkMapMemory");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1732 | return vkMapMemory_VkResult_return; |
| 1733 | } |
| 1734 | |
| 1735 | void VkEncoder::vkUnmapMemory( |
| 1736 | VkDevice device, |
| 1737 | VkDeviceMemory memory) |
| 1738 | { |
| Lingfeng Yang | def88ba | 2018-12-13 12:43:17 -0800 | [diff] [blame] | 1739 | mImpl->resources()->on_vkUnmapMemory(this, device, memory); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1740 | } |
| 1741 | |
| 1742 | VkResult VkEncoder::vkFlushMappedMemoryRanges( |
| 1743 | VkDevice device, |
| 1744 | uint32_t memoryRangeCount, |
| 1745 | const VkMappedMemoryRange* pMemoryRanges) |
| 1746 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 1747 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 1748 | mImpl->log("start vkFlushMappedMemoryRanges"); |
| Lingfeng Yang | 29c99d9 | 2018-11-30 11:15:29 -0800 | [diff] [blame] | 1749 | 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] | 1750 | auto stream = mImpl->stream(); |
| 1751 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1752 | auto resources = mImpl->resources(); |
| 1753 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1754 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1755 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1756 | uint32_t local_memoryRangeCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1757 | VkMappedMemoryRange* local_pMemoryRanges; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 1758 | local_device = device; |
| 1759 | local_memoryRangeCount = memoryRangeCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1760 | local_pMemoryRanges = nullptr; |
| 1761 | if (pMemoryRanges) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1762 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1763 | local_pMemoryRanges = (VkMappedMemoryRange*)pool->alloc(((memoryRangeCount)) * sizeof(const VkMappedMemoryRange)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1764 | for (uint32_t i = 0; i < (uint32_t)((memoryRangeCount)); ++i) |
| 1765 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1766 | deepcopy_VkMappedMemoryRange(pool, pMemoryRanges + i, (VkMappedMemoryRange*)(local_pMemoryRanges + i)); |
| 1767 | } |
| 1768 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 1769 | if (local_pMemoryRanges) |
| 1770 | { |
| 1771 | for (uint32_t i = 0; i < (uint32_t)((memoryRangeCount)); ++i) |
| 1772 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 1773 | transform_tohost_VkMappedMemoryRange(mImpl->resources(), (VkMappedMemoryRange*)(local_pMemoryRanges + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 1774 | } |
| 1775 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1776 | countingStream->rewind(); |
| 1777 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1778 | uint64_t cgen_var_111; |
| 1779 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_111, 1); |
| 1780 | countingStream->write((uint64_t*)&cgen_var_111, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1781 | countingStream->write((uint32_t*)&local_memoryRangeCount, sizeof(uint32_t)); |
| 1782 | for (uint32_t i = 0; i < (uint32_t)((memoryRangeCount)); ++i) |
| 1783 | { |
| 1784 | marshal_VkMappedMemoryRange(countingStream, (VkMappedMemoryRange*)(local_pMemoryRanges + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1785 | } |
| 1786 | } |
| Lingfeng Yang | 5c63afd | 2018-12-22 01:21:14 -0800 | [diff] [blame] | 1787 | if (!resources->usingDirectMapping()) |
| Lingfeng Yang | e30d338 | 2018-11-09 08:24:37 -0800 | [diff] [blame] | 1788 | { |
| Lingfeng Yang | 5c63afd | 2018-12-22 01:21:14 -0800 | [diff] [blame] | 1789 | for (uint32_t i = 0; i < memoryRangeCount; ++i) |
| 1790 | { |
| 1791 | auto range = pMemoryRanges[i]; |
| 1792 | auto memory = pMemoryRanges[i].memory; |
| 1793 | auto size = pMemoryRanges[i].size; |
| 1794 | auto offset = pMemoryRanges[i].offset; |
| 1795 | uint64_t streamSize = 0; |
| 1796 | if (!memory) { countingStream->write(&streamSize, sizeof(uint64_t)); continue; }; |
| 1797 | auto hostPtr = resources->getMappedPointer(memory); |
| 1798 | auto actualSize = size == VK_WHOLE_SIZE ? resources->getMappedSize(memory) : size; |
| 1799 | if (!hostPtr) { countingStream->write(&streamSize, sizeof(uint64_t)); continue; }; |
| 1800 | streamSize = actualSize; |
| 1801 | countingStream->write(&streamSize, sizeof(uint64_t)); |
| 1802 | uint8_t* targetRange = hostPtr + offset; |
| 1803 | countingStream->write(targetRange, actualSize); |
| 1804 | } |
| Lingfeng Yang | e30d338 | 2018-11-09 08:24:37 -0800 | [diff] [blame] | 1805 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1806 | uint32_t packetSize_vkFlushMappedMemoryRanges = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 1807 | countingStream->rewind(); |
| 1808 | uint32_t opcode_vkFlushMappedMemoryRanges = OP_vkFlushMappedMemoryRanges; |
| 1809 | stream->write(&opcode_vkFlushMappedMemoryRanges, sizeof(uint32_t)); |
| 1810 | stream->write(&packetSize_vkFlushMappedMemoryRanges, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1811 | uint64_t cgen_var_112; |
| 1812 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_112, 1); |
| 1813 | stream->write((uint64_t*)&cgen_var_112, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1814 | stream->write((uint32_t*)&local_memoryRangeCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1815 | for (uint32_t i = 0; i < (uint32_t)((memoryRangeCount)); ++i) |
| 1816 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1817 | marshal_VkMappedMemoryRange(stream, (VkMappedMemoryRange*)(local_pMemoryRanges + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1818 | } |
| Lingfeng Yang | 5c63afd | 2018-12-22 01:21:14 -0800 | [diff] [blame] | 1819 | if (!resources->usingDirectMapping()) |
| Lingfeng Yang | e30d338 | 2018-11-09 08:24:37 -0800 | [diff] [blame] | 1820 | { |
| Lingfeng Yang | 5c63afd | 2018-12-22 01:21:14 -0800 | [diff] [blame] | 1821 | for (uint32_t i = 0; i < memoryRangeCount; ++i) |
| 1822 | { |
| 1823 | auto range = pMemoryRanges[i]; |
| 1824 | auto memory = pMemoryRanges[i].memory; |
| 1825 | auto size = pMemoryRanges[i].size; |
| 1826 | auto offset = pMemoryRanges[i].offset; |
| 1827 | uint64_t streamSize = 0; |
| 1828 | if (!memory) { stream->write(&streamSize, sizeof(uint64_t)); continue; }; |
| 1829 | auto hostPtr = resources->getMappedPointer(memory); |
| 1830 | auto actualSize = size == VK_WHOLE_SIZE ? resources->getMappedSize(memory) : size; |
| 1831 | if (!hostPtr) { stream->write(&streamSize, sizeof(uint64_t)); continue; }; |
| 1832 | streamSize = actualSize; |
| 1833 | stream->write(&streamSize, sizeof(uint64_t)); |
| 1834 | uint8_t* targetRange = hostPtr + offset; |
| 1835 | stream->write(targetRange, actualSize); |
| 1836 | } |
| Lingfeng Yang | e30d338 | 2018-11-09 08:24:37 -0800 | [diff] [blame] | 1837 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1838 | VkResult vkFlushMappedMemoryRanges_VkResult_return = (VkResult)0; |
| 1839 | stream->read(&vkFlushMappedMemoryRanges_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 1840 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 1841 | countingStream->clearPool(); |
| 1842 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 1843 | mImpl->log("finish vkFlushMappedMemoryRanges");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1844 | return vkFlushMappedMemoryRanges_VkResult_return; |
| 1845 | } |
| 1846 | |
| 1847 | VkResult VkEncoder::vkInvalidateMappedMemoryRanges( |
| 1848 | VkDevice device, |
| 1849 | uint32_t memoryRangeCount, |
| 1850 | const VkMappedMemoryRange* pMemoryRanges) |
| 1851 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 1852 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 1853 | mImpl->log("start vkInvalidateMappedMemoryRanges"); |
| Lingfeng Yang | 29c99d9 | 2018-11-30 11:15:29 -0800 | [diff] [blame] | 1854 | 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] | 1855 | auto stream = mImpl->stream(); |
| 1856 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1857 | auto resources = mImpl->resources(); |
| 1858 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1859 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1860 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1861 | uint32_t local_memoryRangeCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1862 | VkMappedMemoryRange* local_pMemoryRanges; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 1863 | local_device = device; |
| 1864 | local_memoryRangeCount = memoryRangeCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1865 | local_pMemoryRanges = nullptr; |
| 1866 | if (pMemoryRanges) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1867 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1868 | local_pMemoryRanges = (VkMappedMemoryRange*)pool->alloc(((memoryRangeCount)) * sizeof(const VkMappedMemoryRange)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1869 | for (uint32_t i = 0; i < (uint32_t)((memoryRangeCount)); ++i) |
| 1870 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1871 | deepcopy_VkMappedMemoryRange(pool, pMemoryRanges + i, (VkMappedMemoryRange*)(local_pMemoryRanges + i)); |
| 1872 | } |
| 1873 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 1874 | if (local_pMemoryRanges) |
| 1875 | { |
| 1876 | for (uint32_t i = 0; i < (uint32_t)((memoryRangeCount)); ++i) |
| 1877 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 1878 | transform_tohost_VkMappedMemoryRange(mImpl->resources(), (VkMappedMemoryRange*)(local_pMemoryRanges + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 1879 | } |
| 1880 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1881 | countingStream->rewind(); |
| 1882 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1883 | uint64_t cgen_var_113; |
| 1884 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_113, 1); |
| 1885 | countingStream->write((uint64_t*)&cgen_var_113, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1886 | countingStream->write((uint32_t*)&local_memoryRangeCount, sizeof(uint32_t)); |
| 1887 | for (uint32_t i = 0; i < (uint32_t)((memoryRangeCount)); ++i) |
| 1888 | { |
| 1889 | marshal_VkMappedMemoryRange(countingStream, (VkMappedMemoryRange*)(local_pMemoryRanges + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1890 | } |
| 1891 | } |
| 1892 | uint32_t packetSize_vkInvalidateMappedMemoryRanges = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 1893 | countingStream->rewind(); |
| 1894 | uint32_t opcode_vkInvalidateMappedMemoryRanges = OP_vkInvalidateMappedMemoryRanges; |
| 1895 | stream->write(&opcode_vkInvalidateMappedMemoryRanges, sizeof(uint32_t)); |
| 1896 | stream->write(&packetSize_vkInvalidateMappedMemoryRanges, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1897 | uint64_t cgen_var_114; |
| 1898 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_114, 1); |
| 1899 | stream->write((uint64_t*)&cgen_var_114, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1900 | stream->write((uint32_t*)&local_memoryRangeCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1901 | for (uint32_t i = 0; i < (uint32_t)((memoryRangeCount)); ++i) |
| 1902 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1903 | marshal_VkMappedMemoryRange(stream, (VkMappedMemoryRange*)(local_pMemoryRanges + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1904 | } |
| 1905 | VkResult vkInvalidateMappedMemoryRanges_VkResult_return = (VkResult)0; |
| 1906 | stream->read(&vkInvalidateMappedMemoryRanges_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 5c63afd | 2018-12-22 01:21:14 -0800 | [diff] [blame] | 1907 | if (!resources->usingDirectMapping()) |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -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) { stream->read(&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) { stream->read(&streamSize, sizeof(uint64_t)); continue; }; |
| 1920 | streamSize = actualSize; |
| 1921 | stream->read(&streamSize, sizeof(uint64_t)); |
| 1922 | uint8_t* targetRange = hostPtr + offset; |
| 1923 | stream->read(targetRange, actualSize); |
| 1924 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 1925 | } |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 1926 | pool->freeAll(); |
| 1927 | countingStream->clearPool(); |
| 1928 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 1929 | mImpl->log("finish vkInvalidateMappedMemoryRanges");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1930 | return vkInvalidateMappedMemoryRanges_VkResult_return; |
| 1931 | } |
| 1932 | |
| 1933 | void VkEncoder::vkGetDeviceMemoryCommitment( |
| 1934 | VkDevice device, |
| 1935 | VkDeviceMemory memory, |
| 1936 | VkDeviceSize* pCommittedMemoryInBytes) |
| 1937 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 1938 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 1939 | mImpl->log("start vkGetDeviceMemoryCommitment"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1940 | auto stream = mImpl->stream(); |
| 1941 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1942 | auto resources = mImpl->resources(); |
| 1943 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1944 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1945 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1946 | VkDeviceMemory local_memory; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 1947 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1948 | local_memory = memory; |
| Lingfeng Yang | 2b1b8cf | 2019-02-08 09:53:36 -0800 | [diff] [blame] | 1949 | 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] | 1950 | countingStream->rewind(); |
| 1951 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1952 | uint64_t cgen_var_115; |
| 1953 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_115, 1); |
| 1954 | countingStream->write((uint64_t*)&cgen_var_115, 1 * 8); |
| 1955 | uint64_t cgen_var_116; |
| 1956 | countingStream->handleMapping()->mapHandles_VkDeviceMemory_u64(&local_memory, &cgen_var_116, 1); |
| 1957 | countingStream->write((uint64_t*)&cgen_var_116, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1958 | countingStream->write((VkDeviceSize*)pCommittedMemoryInBytes, sizeof(VkDeviceSize)); |
| 1959 | } |
| 1960 | uint32_t packetSize_vkGetDeviceMemoryCommitment = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 1961 | countingStream->rewind(); |
| 1962 | uint32_t opcode_vkGetDeviceMemoryCommitment = OP_vkGetDeviceMemoryCommitment; |
| 1963 | stream->write(&opcode_vkGetDeviceMemoryCommitment, sizeof(uint32_t)); |
| 1964 | stream->write(&packetSize_vkGetDeviceMemoryCommitment, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 1965 | uint64_t cgen_var_117; |
| 1966 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_117, 1); |
| 1967 | stream->write((uint64_t*)&cgen_var_117, 1 * 8); |
| 1968 | uint64_t cgen_var_118; |
| 1969 | stream->handleMapping()->mapHandles_VkDeviceMemory_u64(&local_memory, &cgen_var_118, 1); |
| 1970 | stream->write((uint64_t*)&cgen_var_118, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1971 | stream->write((VkDeviceSize*)pCommittedMemoryInBytes, sizeof(VkDeviceSize)); |
| 1972 | stream->read((VkDeviceSize*)pCommittedMemoryInBytes, sizeof(VkDeviceSize)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 1973 | pool->freeAll(); |
| 1974 | countingStream->clearPool(); |
| 1975 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 1976 | mImpl->log("finish vkGetDeviceMemoryCommitment");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1977 | } |
| 1978 | |
| 1979 | VkResult VkEncoder::vkBindBufferMemory( |
| 1980 | VkDevice device, |
| 1981 | VkBuffer buffer, |
| 1982 | VkDeviceMemory memory, |
| 1983 | VkDeviceSize memoryOffset) |
| 1984 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 1985 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 1986 | mImpl->log("start vkBindBufferMemory"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 1987 | auto stream = mImpl->stream(); |
| 1988 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1989 | auto resources = mImpl->resources(); |
| 1990 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 1991 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1992 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1993 | VkBuffer local_buffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1994 | VkDeviceMemory local_memory; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1995 | VkDeviceSize local_memoryOffset; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 1996 | local_device = device; |
| 1997 | local_buffer = buffer; |
| 1998 | local_memory = memory; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 1999 | local_memoryOffset = memoryOffset; |
| Lingfeng Yang | 2b1b8cf | 2019-02-08 09:53:36 -0800 | [diff] [blame] | 2000 | 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] | 2001 | countingStream->rewind(); |
| 2002 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2003 | uint64_t cgen_var_119; |
| 2004 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_119, 1); |
| 2005 | countingStream->write((uint64_t*)&cgen_var_119, 1 * 8); |
| 2006 | uint64_t cgen_var_120; |
| 2007 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_120, 1); |
| 2008 | countingStream->write((uint64_t*)&cgen_var_120, 1 * 8); |
| 2009 | uint64_t cgen_var_121; |
| 2010 | countingStream->handleMapping()->mapHandles_VkDeviceMemory_u64(&local_memory, &cgen_var_121, 1); |
| 2011 | countingStream->write((uint64_t*)&cgen_var_121, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2012 | countingStream->write((VkDeviceSize*)&local_memoryOffset, sizeof(VkDeviceSize)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2013 | } |
| 2014 | uint32_t packetSize_vkBindBufferMemory = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 2015 | countingStream->rewind(); |
| 2016 | uint32_t opcode_vkBindBufferMemory = OP_vkBindBufferMemory; |
| 2017 | stream->write(&opcode_vkBindBufferMemory, sizeof(uint32_t)); |
| 2018 | stream->write(&packetSize_vkBindBufferMemory, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2019 | uint64_t cgen_var_122; |
| 2020 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_122, 1); |
| 2021 | stream->write((uint64_t*)&cgen_var_122, 1 * 8); |
| 2022 | uint64_t cgen_var_123; |
| 2023 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_123, 1); |
| 2024 | stream->write((uint64_t*)&cgen_var_123, 1 * 8); |
| 2025 | uint64_t cgen_var_124; |
| 2026 | stream->handleMapping()->mapHandles_VkDeviceMemory_u64(&local_memory, &cgen_var_124, 1); |
| 2027 | stream->write((uint64_t*)&cgen_var_124, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2028 | stream->write((VkDeviceSize*)&local_memoryOffset, sizeof(VkDeviceSize)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2029 | VkResult vkBindBufferMemory_VkResult_return = (VkResult)0; |
| 2030 | stream->read(&vkBindBufferMemory_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 2031 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2032 | countingStream->clearPool(); |
| 2033 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2034 | mImpl->log("finish vkBindBufferMemory");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2035 | return vkBindBufferMemory_VkResult_return; |
| 2036 | } |
| 2037 | |
| 2038 | VkResult VkEncoder::vkBindImageMemory( |
| 2039 | VkDevice device, |
| 2040 | VkImage image, |
| 2041 | VkDeviceMemory memory, |
| 2042 | VkDeviceSize memoryOffset) |
| 2043 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 2044 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2045 | mImpl->log("start vkBindImageMemory"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2046 | auto stream = mImpl->stream(); |
| 2047 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2048 | auto resources = mImpl->resources(); |
| 2049 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2050 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2051 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2052 | VkImage local_image; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2053 | VkDeviceMemory local_memory; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2054 | VkDeviceSize local_memoryOffset; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 2055 | local_device = device; |
| 2056 | local_image = image; |
| 2057 | local_memory = memory; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2058 | local_memoryOffset = memoryOffset; |
| Lingfeng Yang | 2b1b8cf | 2019-02-08 09:53:36 -0800 | [diff] [blame] | 2059 | 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] | 2060 | countingStream->rewind(); |
| 2061 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2062 | uint64_t cgen_var_125; |
| 2063 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_125, 1); |
| 2064 | countingStream->write((uint64_t*)&cgen_var_125, 1 * 8); |
| 2065 | uint64_t cgen_var_126; |
| 2066 | countingStream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_126, 1); |
| 2067 | countingStream->write((uint64_t*)&cgen_var_126, 1 * 8); |
| 2068 | uint64_t cgen_var_127; |
| 2069 | countingStream->handleMapping()->mapHandles_VkDeviceMemory_u64(&local_memory, &cgen_var_127, 1); |
| 2070 | countingStream->write((uint64_t*)&cgen_var_127, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2071 | countingStream->write((VkDeviceSize*)&local_memoryOffset, sizeof(VkDeviceSize)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2072 | } |
| 2073 | uint32_t packetSize_vkBindImageMemory = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 2074 | countingStream->rewind(); |
| 2075 | uint32_t opcode_vkBindImageMemory = OP_vkBindImageMemory; |
| 2076 | stream->write(&opcode_vkBindImageMemory, sizeof(uint32_t)); |
| 2077 | stream->write(&packetSize_vkBindImageMemory, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2078 | uint64_t cgen_var_128; |
| 2079 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_128, 1); |
| 2080 | stream->write((uint64_t*)&cgen_var_128, 1 * 8); |
| 2081 | uint64_t cgen_var_129; |
| 2082 | stream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_129, 1); |
| 2083 | stream->write((uint64_t*)&cgen_var_129, 1 * 8); |
| 2084 | uint64_t cgen_var_130; |
| 2085 | stream->handleMapping()->mapHandles_VkDeviceMemory_u64(&local_memory, &cgen_var_130, 1); |
| 2086 | stream->write((uint64_t*)&cgen_var_130, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2087 | stream->write((VkDeviceSize*)&local_memoryOffset, sizeof(VkDeviceSize)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2088 | VkResult vkBindImageMemory_VkResult_return = (VkResult)0; |
| 2089 | stream->read(&vkBindImageMemory_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 2090 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2091 | countingStream->clearPool(); |
| 2092 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2093 | mImpl->log("finish vkBindImageMemory");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2094 | return vkBindImageMemory_VkResult_return; |
| 2095 | } |
| 2096 | |
| 2097 | void VkEncoder::vkGetBufferMemoryRequirements( |
| 2098 | VkDevice device, |
| 2099 | VkBuffer buffer, |
| 2100 | VkMemoryRequirements* pMemoryRequirements) |
| 2101 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 2102 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2103 | mImpl->log("start vkGetBufferMemoryRequirements"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2104 | auto stream = mImpl->stream(); |
| 2105 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2106 | auto resources = mImpl->resources(); |
| 2107 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2108 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2109 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2110 | VkBuffer local_buffer; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 2111 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2112 | local_buffer = buffer; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2113 | countingStream->rewind(); |
| 2114 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2115 | uint64_t cgen_var_131; |
| 2116 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_131, 1); |
| 2117 | countingStream->write((uint64_t*)&cgen_var_131, 1 * 8); |
| 2118 | uint64_t cgen_var_132; |
| 2119 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_132, 1); |
| 2120 | countingStream->write((uint64_t*)&cgen_var_132, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2121 | marshal_VkMemoryRequirements(countingStream, (VkMemoryRequirements*)(pMemoryRequirements)); |
| 2122 | } |
| 2123 | uint32_t packetSize_vkGetBufferMemoryRequirements = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 2124 | countingStream->rewind(); |
| 2125 | uint32_t opcode_vkGetBufferMemoryRequirements = OP_vkGetBufferMemoryRequirements; |
| 2126 | stream->write(&opcode_vkGetBufferMemoryRequirements, sizeof(uint32_t)); |
| 2127 | stream->write(&packetSize_vkGetBufferMemoryRequirements, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2128 | uint64_t cgen_var_133; |
| 2129 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_133, 1); |
| 2130 | stream->write((uint64_t*)&cgen_var_133, 1 * 8); |
| 2131 | uint64_t cgen_var_134; |
| 2132 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_134, 1); |
| 2133 | stream->write((uint64_t*)&cgen_var_134, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2134 | marshal_VkMemoryRequirements(stream, (VkMemoryRequirements*)(pMemoryRequirements)); |
| 2135 | unmarshal_VkMemoryRequirements(stream, (VkMemoryRequirements*)(pMemoryRequirements)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 2136 | if (pMemoryRequirements) |
| 2137 | { |
| 2138 | transform_fromhost_VkMemoryRequirements(mImpl->resources(), (VkMemoryRequirements*)(pMemoryRequirements)); |
| 2139 | } |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 2140 | pool->freeAll(); |
| 2141 | countingStream->clearPool(); |
| 2142 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2143 | mImpl->log("finish vkGetBufferMemoryRequirements");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2144 | } |
| 2145 | |
| 2146 | void VkEncoder::vkGetImageMemoryRequirements( |
| 2147 | VkDevice device, |
| 2148 | VkImage image, |
| 2149 | VkMemoryRequirements* pMemoryRequirements) |
| 2150 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 2151 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2152 | mImpl->log("start vkGetImageMemoryRequirements"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2153 | auto stream = mImpl->stream(); |
| 2154 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2155 | auto resources = mImpl->resources(); |
| 2156 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2157 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2158 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2159 | VkImage local_image; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 2160 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2161 | local_image = image; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2162 | countingStream->rewind(); |
| 2163 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2164 | uint64_t cgen_var_135; |
| 2165 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_135, 1); |
| 2166 | countingStream->write((uint64_t*)&cgen_var_135, 1 * 8); |
| 2167 | uint64_t cgen_var_136; |
| 2168 | countingStream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_136, 1); |
| 2169 | countingStream->write((uint64_t*)&cgen_var_136, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2170 | marshal_VkMemoryRequirements(countingStream, (VkMemoryRequirements*)(pMemoryRequirements)); |
| 2171 | } |
| 2172 | uint32_t packetSize_vkGetImageMemoryRequirements = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 2173 | countingStream->rewind(); |
| 2174 | uint32_t opcode_vkGetImageMemoryRequirements = OP_vkGetImageMemoryRequirements; |
| 2175 | stream->write(&opcode_vkGetImageMemoryRequirements, sizeof(uint32_t)); |
| 2176 | stream->write(&packetSize_vkGetImageMemoryRequirements, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2177 | uint64_t cgen_var_137; |
| 2178 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_137, 1); |
| 2179 | stream->write((uint64_t*)&cgen_var_137, 1 * 8); |
| 2180 | uint64_t cgen_var_138; |
| 2181 | stream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_138, 1); |
| 2182 | stream->write((uint64_t*)&cgen_var_138, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2183 | marshal_VkMemoryRequirements(stream, (VkMemoryRequirements*)(pMemoryRequirements)); |
| 2184 | unmarshal_VkMemoryRequirements(stream, (VkMemoryRequirements*)(pMemoryRequirements)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 2185 | if (pMemoryRequirements) |
| 2186 | { |
| 2187 | transform_fromhost_VkMemoryRequirements(mImpl->resources(), (VkMemoryRequirements*)(pMemoryRequirements)); |
| 2188 | } |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 2189 | pool->freeAll(); |
| 2190 | countingStream->clearPool(); |
| 2191 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2192 | mImpl->log("finish vkGetImageMemoryRequirements");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2193 | } |
| 2194 | |
| 2195 | void VkEncoder::vkGetImageSparseMemoryRequirements( |
| 2196 | VkDevice device, |
| 2197 | VkImage image, |
| 2198 | uint32_t* pSparseMemoryRequirementCount, |
| 2199 | VkSparseImageMemoryRequirements* pSparseMemoryRequirements) |
| 2200 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 2201 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2202 | mImpl->log("start vkGetImageSparseMemoryRequirements"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2203 | auto stream = mImpl->stream(); |
| 2204 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2205 | auto resources = mImpl->resources(); |
| 2206 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2207 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2208 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2209 | VkImage local_image; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 2210 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2211 | local_image = image; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2212 | countingStream->rewind(); |
| 2213 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2214 | uint64_t cgen_var_139; |
| 2215 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_139, 1); |
| 2216 | countingStream->write((uint64_t*)&cgen_var_139, 1 * 8); |
| 2217 | uint64_t cgen_var_140; |
| 2218 | countingStream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_140, 1); |
| 2219 | countingStream->write((uint64_t*)&cgen_var_140, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2220 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2221 | uint64_t cgen_var_141 = (uint64_t)(uintptr_t)pSparseMemoryRequirementCount; |
| 2222 | countingStream->putBe64(cgen_var_141); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2223 | if (pSparseMemoryRequirementCount) |
| 2224 | { |
| 2225 | countingStream->write((uint32_t*)pSparseMemoryRequirementCount, sizeof(uint32_t)); |
| 2226 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2227 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2228 | uint64_t cgen_var_142 = (uint64_t)(uintptr_t)pSparseMemoryRequirements; |
| 2229 | countingStream->putBe64(cgen_var_142); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2230 | if (pSparseMemoryRequirements) |
| 2231 | { |
| 2232 | for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i) |
| 2233 | { |
| 2234 | marshal_VkSparseImageMemoryRequirements(countingStream, (VkSparseImageMemoryRequirements*)(pSparseMemoryRequirements + i)); |
| 2235 | } |
| 2236 | } |
| 2237 | } |
| 2238 | uint32_t packetSize_vkGetImageSparseMemoryRequirements = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 2239 | countingStream->rewind(); |
| 2240 | uint32_t opcode_vkGetImageSparseMemoryRequirements = OP_vkGetImageSparseMemoryRequirements; |
| 2241 | stream->write(&opcode_vkGetImageSparseMemoryRequirements, sizeof(uint32_t)); |
| 2242 | stream->write(&packetSize_vkGetImageSparseMemoryRequirements, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2243 | uint64_t cgen_var_143; |
| 2244 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_143, 1); |
| 2245 | stream->write((uint64_t*)&cgen_var_143, 1 * 8); |
| 2246 | uint64_t cgen_var_144; |
| 2247 | stream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_144, 1); |
| 2248 | stream->write((uint64_t*)&cgen_var_144, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2249 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2250 | uint64_t cgen_var_145 = (uint64_t)(uintptr_t)pSparseMemoryRequirementCount; |
| 2251 | stream->putBe64(cgen_var_145); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2252 | if (pSparseMemoryRequirementCount) |
| 2253 | { |
| 2254 | stream->write((uint32_t*)pSparseMemoryRequirementCount, sizeof(uint32_t)); |
| 2255 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2256 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2257 | uint64_t cgen_var_146 = (uint64_t)(uintptr_t)pSparseMemoryRequirements; |
| 2258 | stream->putBe64(cgen_var_146); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2259 | if (pSparseMemoryRequirements) |
| 2260 | { |
| 2261 | for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i) |
| 2262 | { |
| 2263 | marshal_VkSparseImageMemoryRequirements(stream, (VkSparseImageMemoryRequirements*)(pSparseMemoryRequirements + i)); |
| 2264 | } |
| 2265 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2266 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2267 | uint32_t* check_pSparseMemoryRequirementCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2268 | check_pSparseMemoryRequirementCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2269 | if (pSparseMemoryRequirementCount) |
| 2270 | { |
| 2271 | if (!(check_pSparseMemoryRequirementCount)) |
| 2272 | { |
| 2273 | fprintf(stderr, "fatal: pSparseMemoryRequirementCount inconsistent between guest and host\n"); |
| 2274 | } |
| 2275 | stream->read((uint32_t*)pSparseMemoryRequirementCount, sizeof(uint32_t)); |
| 2276 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2277 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2278 | VkSparseImageMemoryRequirements* check_pSparseMemoryRequirements; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2279 | check_pSparseMemoryRequirements = (VkSparseImageMemoryRequirements*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2280 | if (pSparseMemoryRequirements) |
| 2281 | { |
| 2282 | if (!(check_pSparseMemoryRequirements)) |
| 2283 | { |
| 2284 | fprintf(stderr, "fatal: pSparseMemoryRequirements inconsistent between guest and host\n"); |
| 2285 | } |
| 2286 | for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i) |
| 2287 | { |
| 2288 | unmarshal_VkSparseImageMemoryRequirements(stream, (VkSparseImageMemoryRequirements*)(pSparseMemoryRequirements + i)); |
| 2289 | } |
| 2290 | } |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 2291 | if (pSparseMemoryRequirements) |
| 2292 | { |
| 2293 | for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i) |
| 2294 | { |
| 2295 | transform_fromhost_VkSparseImageMemoryRequirements(mImpl->resources(), (VkSparseImageMemoryRequirements*)(pSparseMemoryRequirements + i)); |
| 2296 | } |
| 2297 | } |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 2298 | pool->freeAll(); |
| 2299 | countingStream->clearPool(); |
| 2300 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2301 | mImpl->log("finish vkGetImageSparseMemoryRequirements");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2302 | } |
| 2303 | |
| 2304 | void VkEncoder::vkGetPhysicalDeviceSparseImageFormatProperties( |
| 2305 | VkPhysicalDevice physicalDevice, |
| 2306 | VkFormat format, |
| 2307 | VkImageType type, |
| 2308 | VkSampleCountFlagBits samples, |
| 2309 | VkImageUsageFlags usage, |
| 2310 | VkImageTiling tiling, |
| 2311 | uint32_t* pPropertyCount, |
| 2312 | VkSparseImageFormatProperties* pProperties) |
| 2313 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 2314 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2315 | mImpl->log("start vkGetPhysicalDeviceSparseImageFormatProperties"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2316 | auto stream = mImpl->stream(); |
| 2317 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2318 | auto resources = mImpl->resources(); |
| 2319 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2320 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2321 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2322 | VkFormat local_format; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2323 | VkImageType local_type; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2324 | VkSampleCountFlagBits local_samples; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2325 | VkImageUsageFlags local_usage; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2326 | VkImageTiling local_tiling; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 2327 | local_physicalDevice = physicalDevice; |
| 2328 | local_format = format; |
| 2329 | local_type = type; |
| 2330 | local_samples = samples; |
| 2331 | local_usage = usage; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2332 | local_tiling = tiling; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2333 | countingStream->rewind(); |
| 2334 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2335 | uint64_t cgen_var_149; |
| 2336 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_149, 1); |
| 2337 | countingStream->write((uint64_t*)&cgen_var_149, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2338 | countingStream->write((VkFormat*)&local_format, sizeof(VkFormat)); |
| 2339 | countingStream->write((VkImageType*)&local_type, sizeof(VkImageType)); |
| 2340 | countingStream->write((VkSampleCountFlagBits*)&local_samples, sizeof(VkSampleCountFlagBits)); |
| 2341 | countingStream->write((VkImageUsageFlags*)&local_usage, sizeof(VkImageUsageFlags)); |
| 2342 | countingStream->write((VkImageTiling*)&local_tiling, sizeof(VkImageTiling)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2343 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2344 | uint64_t cgen_var_150 = (uint64_t)(uintptr_t)pPropertyCount; |
| 2345 | countingStream->putBe64(cgen_var_150); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2346 | if (pPropertyCount) |
| 2347 | { |
| 2348 | countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 2349 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2350 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2351 | uint64_t cgen_var_151 = (uint64_t)(uintptr_t)pProperties; |
| 2352 | countingStream->putBe64(cgen_var_151); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2353 | if (pProperties) |
| 2354 | { |
| 2355 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 2356 | { |
| 2357 | marshal_VkSparseImageFormatProperties(countingStream, (VkSparseImageFormatProperties*)(pProperties + i)); |
| 2358 | } |
| 2359 | } |
| 2360 | } |
| 2361 | uint32_t packetSize_vkGetPhysicalDeviceSparseImageFormatProperties = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 2362 | countingStream->rewind(); |
| 2363 | uint32_t opcode_vkGetPhysicalDeviceSparseImageFormatProperties = OP_vkGetPhysicalDeviceSparseImageFormatProperties; |
| 2364 | stream->write(&opcode_vkGetPhysicalDeviceSparseImageFormatProperties, sizeof(uint32_t)); |
| 2365 | stream->write(&packetSize_vkGetPhysicalDeviceSparseImageFormatProperties, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2366 | uint64_t cgen_var_152; |
| 2367 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_152, 1); |
| 2368 | stream->write((uint64_t*)&cgen_var_152, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2369 | stream->write((VkFormat*)&local_format, sizeof(VkFormat)); |
| 2370 | stream->write((VkImageType*)&local_type, sizeof(VkImageType)); |
| 2371 | stream->write((VkSampleCountFlagBits*)&local_samples, sizeof(VkSampleCountFlagBits)); |
| 2372 | stream->write((VkImageUsageFlags*)&local_usage, sizeof(VkImageUsageFlags)); |
| 2373 | stream->write((VkImageTiling*)&local_tiling, sizeof(VkImageTiling)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2374 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2375 | uint64_t cgen_var_153 = (uint64_t)(uintptr_t)pPropertyCount; |
| 2376 | stream->putBe64(cgen_var_153); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2377 | if (pPropertyCount) |
| 2378 | { |
| 2379 | stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 2380 | } |
| 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_154 = (uint64_t)(uintptr_t)pProperties; |
| 2383 | stream->putBe64(cgen_var_154); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2384 | if (pProperties) |
| 2385 | { |
| 2386 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 2387 | { |
| 2388 | marshal_VkSparseImageFormatProperties(stream, (VkSparseImageFormatProperties*)(pProperties + i)); |
| 2389 | } |
| 2390 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2391 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2392 | uint32_t* check_pPropertyCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2393 | check_pPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2394 | if (pPropertyCount) |
| 2395 | { |
| 2396 | if (!(check_pPropertyCount)) |
| 2397 | { |
| 2398 | fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n"); |
| 2399 | } |
| 2400 | stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 2401 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2402 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2403 | VkSparseImageFormatProperties* check_pProperties; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2404 | check_pProperties = (VkSparseImageFormatProperties*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2405 | if (pProperties) |
| 2406 | { |
| 2407 | if (!(check_pProperties)) |
| 2408 | { |
| 2409 | fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n"); |
| 2410 | } |
| 2411 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 2412 | { |
| 2413 | unmarshal_VkSparseImageFormatProperties(stream, (VkSparseImageFormatProperties*)(pProperties + i)); |
| 2414 | } |
| 2415 | } |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 2416 | if (pProperties) |
| 2417 | { |
| 2418 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 2419 | { |
| 2420 | transform_fromhost_VkSparseImageFormatProperties(mImpl->resources(), (VkSparseImageFormatProperties*)(pProperties + i)); |
| 2421 | } |
| 2422 | } |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 2423 | pool->freeAll(); |
| 2424 | countingStream->clearPool(); |
| 2425 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2426 | mImpl->log("finish vkGetPhysicalDeviceSparseImageFormatProperties");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2427 | } |
| 2428 | |
| 2429 | VkResult VkEncoder::vkQueueBindSparse( |
| 2430 | VkQueue queue, |
| 2431 | uint32_t bindInfoCount, |
| 2432 | const VkBindSparseInfo* pBindInfo, |
| 2433 | VkFence fence) |
| 2434 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 2435 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2436 | mImpl->log("start vkQueueBindSparse"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2437 | auto stream = mImpl->stream(); |
| 2438 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2439 | auto resources = mImpl->resources(); |
| 2440 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2441 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2442 | VkQueue local_queue; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2443 | uint32_t local_bindInfoCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2444 | VkBindSparseInfo* local_pBindInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 2445 | VkFence local_fence; |
| 2446 | local_queue = queue; |
| 2447 | local_bindInfoCount = bindInfoCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2448 | local_pBindInfo = nullptr; |
| 2449 | if (pBindInfo) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2450 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2451 | local_pBindInfo = (VkBindSparseInfo*)pool->alloc(((bindInfoCount)) * sizeof(const VkBindSparseInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2452 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 2453 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2454 | deepcopy_VkBindSparseInfo(pool, pBindInfo + i, (VkBindSparseInfo*)(local_pBindInfo + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2455 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2456 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2457 | local_fence = fence; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 2458 | if (local_pBindInfo) |
| 2459 | { |
| 2460 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 2461 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 2462 | transform_tohost_VkBindSparseInfo(mImpl->resources(), (VkBindSparseInfo*)(local_pBindInfo + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 2463 | } |
| 2464 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2465 | countingStream->rewind(); |
| 2466 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2467 | uint64_t cgen_var_157; |
| 2468 | countingStream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_157, 1); |
| 2469 | countingStream->write((uint64_t*)&cgen_var_157, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2470 | countingStream->write((uint32_t*)&local_bindInfoCount, sizeof(uint32_t)); |
| 2471 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 2472 | { |
| 2473 | marshal_VkBindSparseInfo(countingStream, (VkBindSparseInfo*)(local_pBindInfo + i)); |
| 2474 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2475 | uint64_t cgen_var_158; |
| 2476 | countingStream->handleMapping()->mapHandles_VkFence_u64(&local_fence, &cgen_var_158, 1); |
| 2477 | countingStream->write((uint64_t*)&cgen_var_158, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2478 | } |
| 2479 | uint32_t packetSize_vkQueueBindSparse = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 2480 | countingStream->rewind(); |
| 2481 | uint32_t opcode_vkQueueBindSparse = OP_vkQueueBindSparse; |
| 2482 | stream->write(&opcode_vkQueueBindSparse, sizeof(uint32_t)); |
| 2483 | stream->write(&packetSize_vkQueueBindSparse, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2484 | uint64_t cgen_var_159; |
| 2485 | stream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_159, 1); |
| 2486 | stream->write((uint64_t*)&cgen_var_159, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2487 | stream->write((uint32_t*)&local_bindInfoCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2488 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 2489 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2490 | marshal_VkBindSparseInfo(stream, (VkBindSparseInfo*)(local_pBindInfo + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2491 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2492 | uint64_t cgen_var_160; |
| 2493 | stream->handleMapping()->mapHandles_VkFence_u64(&local_fence, &cgen_var_160, 1); |
| 2494 | stream->write((uint64_t*)&cgen_var_160, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2495 | VkResult vkQueueBindSparse_VkResult_return = (VkResult)0; |
| 2496 | stream->read(&vkQueueBindSparse_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 2497 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2498 | countingStream->clearPool(); |
| 2499 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2500 | mImpl->log("finish vkQueueBindSparse");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2501 | return vkQueueBindSparse_VkResult_return; |
| 2502 | } |
| 2503 | |
| 2504 | VkResult VkEncoder::vkCreateFence( |
| 2505 | VkDevice device, |
| 2506 | const VkFenceCreateInfo* pCreateInfo, |
| 2507 | const VkAllocationCallbacks* pAllocator, |
| 2508 | VkFence* pFence) |
| 2509 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 2510 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2511 | mImpl->log("start vkCreateFence"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2512 | auto stream = mImpl->stream(); |
| 2513 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2514 | auto resources = mImpl->resources(); |
| 2515 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2516 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2517 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2518 | VkFenceCreateInfo* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 2519 | VkAllocationCallbacks* local_pAllocator; |
| 2520 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2521 | local_pCreateInfo = nullptr; |
| 2522 | if (pCreateInfo) |
| 2523 | { |
| 2524 | local_pCreateInfo = (VkFenceCreateInfo*)pool->alloc(sizeof(const VkFenceCreateInfo)); |
| 2525 | deepcopy_VkFenceCreateInfo(pool, pCreateInfo, (VkFenceCreateInfo*)(local_pCreateInfo)); |
| 2526 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2527 | local_pAllocator = nullptr; |
| 2528 | if (pAllocator) |
| 2529 | { |
| 2530 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 2531 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 2532 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 2533 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 2534 | if (local_pCreateInfo) |
| 2535 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 2536 | transform_tohost_VkFenceCreateInfo(mImpl->resources(), (VkFenceCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 2537 | } |
| 2538 | if (local_pAllocator) |
| 2539 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 2540 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 2541 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2542 | countingStream->rewind(); |
| 2543 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2544 | uint64_t cgen_var_161; |
| 2545 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_161, 1); |
| 2546 | countingStream->write((uint64_t*)&cgen_var_161, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2547 | marshal_VkFenceCreateInfo(countingStream, (VkFenceCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2548 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2549 | uint64_t cgen_var_162 = (uint64_t)(uintptr_t)local_pAllocator; |
| 2550 | countingStream->putBe64(cgen_var_162); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2551 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2552 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2553 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2554 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2555 | uint64_t cgen_var_163; |
| 2556 | countingStream->handleMapping()->mapHandles_VkFence_u64(pFence, &cgen_var_163, 1); |
| 2557 | countingStream->write((uint64_t*)&cgen_var_163, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2558 | } |
| 2559 | uint32_t packetSize_vkCreateFence = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 2560 | countingStream->rewind(); |
| 2561 | uint32_t opcode_vkCreateFence = OP_vkCreateFence; |
| 2562 | stream->write(&opcode_vkCreateFence, sizeof(uint32_t)); |
| 2563 | stream->write(&packetSize_vkCreateFence, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2564 | uint64_t cgen_var_164; |
| 2565 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_164, 1); |
| 2566 | stream->write((uint64_t*)&cgen_var_164, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2567 | marshal_VkFenceCreateInfo(stream, (VkFenceCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2568 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2569 | uint64_t cgen_var_165 = (uint64_t)(uintptr_t)local_pAllocator; |
| 2570 | stream->putBe64(cgen_var_165); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2571 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2572 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2573 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2574 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2575 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2576 | uint64_t cgen_var_166; |
| 2577 | stream->handleMapping()->mapHandles_VkFence_u64(pFence, &cgen_var_166, 1); |
| 2578 | stream->write((uint64_t*)&cgen_var_166, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2579 | stream->setHandleMapping(resources->unwrapMapping()); |
| 2580 | stream->setHandleMapping(resources->createMapping()); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2581 | uint64_t cgen_var_167; |
| 2582 | stream->read((uint64_t*)&cgen_var_167, 8); |
| 2583 | stream->handleMapping()->mapHandles_u64_VkFence(&cgen_var_167, (VkFence*)pFence, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2584 | stream->unsetHandleMapping(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2585 | VkResult vkCreateFence_VkResult_return = (VkResult)0; |
| 2586 | stream->read(&vkCreateFence_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 2587 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2588 | countingStream->clearPool(); |
| 2589 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2590 | mImpl->log("finish vkCreateFence");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2591 | return vkCreateFence_VkResult_return; |
| 2592 | } |
| 2593 | |
| 2594 | void VkEncoder::vkDestroyFence( |
| 2595 | VkDevice device, |
| 2596 | VkFence fence, |
| 2597 | const VkAllocationCallbacks* pAllocator) |
| 2598 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 2599 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2600 | mImpl->log("start vkDestroyFence"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2601 | auto stream = mImpl->stream(); |
| 2602 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2603 | auto resources = mImpl->resources(); |
| 2604 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2605 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2606 | VkDevice local_device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 2607 | VkFence local_fence; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2608 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 2609 | local_device = device; |
| 2610 | local_fence = fence; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2611 | local_pAllocator = nullptr; |
| 2612 | if (pAllocator) |
| 2613 | { |
| 2614 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 2615 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 2616 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 2617 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 2618 | if (local_pAllocator) |
| 2619 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 2620 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 2621 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2622 | countingStream->rewind(); |
| 2623 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2624 | uint64_t cgen_var_168; |
| 2625 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_168, 1); |
| 2626 | countingStream->write((uint64_t*)&cgen_var_168, 1 * 8); |
| 2627 | uint64_t cgen_var_169; |
| 2628 | countingStream->handleMapping()->mapHandles_VkFence_u64(&local_fence, &cgen_var_169, 1); |
| 2629 | countingStream->write((uint64_t*)&cgen_var_169, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2630 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2631 | uint64_t cgen_var_170 = (uint64_t)(uintptr_t)local_pAllocator; |
| 2632 | countingStream->putBe64(cgen_var_170); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2633 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2634 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2635 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2636 | } |
| 2637 | } |
| 2638 | uint32_t packetSize_vkDestroyFence = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 2639 | countingStream->rewind(); |
| 2640 | uint32_t opcode_vkDestroyFence = OP_vkDestroyFence; |
| 2641 | stream->write(&opcode_vkDestroyFence, sizeof(uint32_t)); |
| 2642 | stream->write(&packetSize_vkDestroyFence, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2643 | uint64_t cgen_var_171; |
| 2644 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_171, 1); |
| 2645 | stream->write((uint64_t*)&cgen_var_171, 1 * 8); |
| 2646 | uint64_t cgen_var_172; |
| 2647 | stream->handleMapping()->mapHandles_VkFence_u64(&local_fence, &cgen_var_172, 1); |
| 2648 | stream->write((uint64_t*)&cgen_var_172, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2649 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2650 | uint64_t cgen_var_173 = (uint64_t)(uintptr_t)local_pAllocator; |
| 2651 | stream->putBe64(cgen_var_173); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2652 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2653 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2654 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2655 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2656 | resources->destroyMapping()->mapHandles_VkFence((VkFence*)&fence); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 2657 | pool->freeAll(); |
| 2658 | countingStream->clearPool(); |
| 2659 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2660 | mImpl->log("finish vkDestroyFence");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2661 | } |
| 2662 | |
| 2663 | VkResult VkEncoder::vkResetFences( |
| 2664 | VkDevice device, |
| 2665 | uint32_t fenceCount, |
| 2666 | const VkFence* pFences) |
| 2667 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 2668 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2669 | mImpl->log("start vkResetFences"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2670 | auto stream = mImpl->stream(); |
| 2671 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2672 | auto resources = mImpl->resources(); |
| 2673 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2674 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2675 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2676 | uint32_t local_fenceCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2677 | VkFence* local_pFences; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 2678 | local_device = device; |
| 2679 | local_fenceCount = fenceCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2680 | local_pFences = nullptr; |
| 2681 | if (pFences) |
| 2682 | { |
| 2683 | local_pFences = (VkFence*)pool->dupArray(pFences, ((fenceCount)) * sizeof(const VkFence)); |
| 2684 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2685 | countingStream->rewind(); |
| 2686 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2687 | uint64_t cgen_var_174; |
| 2688 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_174, 1); |
| 2689 | countingStream->write((uint64_t*)&cgen_var_174, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2690 | countingStream->write((uint32_t*)&local_fenceCount, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2691 | if (((fenceCount))) |
| 2692 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2693 | uint64_t* cgen_var_175; |
| 2694 | countingStream->alloc((void**)&cgen_var_175, ((fenceCount)) * 8); |
| 2695 | countingStream->handleMapping()->mapHandles_VkFence_u64(local_pFences, cgen_var_175, ((fenceCount))); |
| 2696 | countingStream->write((uint64_t*)cgen_var_175, ((fenceCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2697 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2698 | } |
| 2699 | uint32_t packetSize_vkResetFences = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 2700 | countingStream->rewind(); |
| 2701 | uint32_t opcode_vkResetFences = OP_vkResetFences; |
| 2702 | stream->write(&opcode_vkResetFences, sizeof(uint32_t)); |
| 2703 | stream->write(&packetSize_vkResetFences, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2704 | uint64_t cgen_var_176; |
| 2705 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_176, 1); |
| 2706 | stream->write((uint64_t*)&cgen_var_176, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2707 | stream->write((uint32_t*)&local_fenceCount, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2708 | if (((fenceCount))) |
| 2709 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2710 | uint64_t* cgen_var_177; |
| 2711 | stream->alloc((void**)&cgen_var_177, ((fenceCount)) * 8); |
| 2712 | stream->handleMapping()->mapHandles_VkFence_u64(local_pFences, cgen_var_177, ((fenceCount))); |
| 2713 | stream->write((uint64_t*)cgen_var_177, ((fenceCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2714 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2715 | VkResult vkResetFences_VkResult_return = (VkResult)0; |
| 2716 | stream->read(&vkResetFences_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 2717 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2718 | countingStream->clearPool(); |
| 2719 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2720 | mImpl->log("finish vkResetFences");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2721 | return vkResetFences_VkResult_return; |
| 2722 | } |
| 2723 | |
| 2724 | VkResult VkEncoder::vkGetFenceStatus( |
| 2725 | VkDevice device, |
| 2726 | VkFence fence) |
| 2727 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 2728 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2729 | mImpl->log("start vkGetFenceStatus"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2730 | auto stream = mImpl->stream(); |
| 2731 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2732 | auto resources = mImpl->resources(); |
| 2733 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2734 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2735 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2736 | VkFence local_fence; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 2737 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2738 | local_fence = fence; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2739 | countingStream->rewind(); |
| 2740 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2741 | uint64_t cgen_var_178; |
| 2742 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_178, 1); |
| 2743 | countingStream->write((uint64_t*)&cgen_var_178, 1 * 8); |
| 2744 | uint64_t cgen_var_179; |
| 2745 | countingStream->handleMapping()->mapHandles_VkFence_u64(&local_fence, &cgen_var_179, 1); |
| 2746 | countingStream->write((uint64_t*)&cgen_var_179, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2747 | } |
| 2748 | uint32_t packetSize_vkGetFenceStatus = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 2749 | countingStream->rewind(); |
| 2750 | uint32_t opcode_vkGetFenceStatus = OP_vkGetFenceStatus; |
| 2751 | stream->write(&opcode_vkGetFenceStatus, sizeof(uint32_t)); |
| 2752 | stream->write(&packetSize_vkGetFenceStatus, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2753 | uint64_t cgen_var_180; |
| 2754 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_180, 1); |
| 2755 | stream->write((uint64_t*)&cgen_var_180, 1 * 8); |
| 2756 | uint64_t cgen_var_181; |
| 2757 | stream->handleMapping()->mapHandles_VkFence_u64(&local_fence, &cgen_var_181, 1); |
| 2758 | stream->write((uint64_t*)&cgen_var_181, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2759 | VkResult vkGetFenceStatus_VkResult_return = (VkResult)0; |
| 2760 | stream->read(&vkGetFenceStatus_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 2761 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2762 | countingStream->clearPool(); |
| 2763 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2764 | mImpl->log("finish vkGetFenceStatus");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2765 | return vkGetFenceStatus_VkResult_return; |
| 2766 | } |
| 2767 | |
| 2768 | VkResult VkEncoder::vkWaitForFences( |
| 2769 | VkDevice device, |
| 2770 | uint32_t fenceCount, |
| 2771 | const VkFence* pFences, |
| 2772 | VkBool32 waitAll, |
| 2773 | uint64_t timeout) |
| 2774 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 2775 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2776 | mImpl->log("start vkWaitForFences"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2777 | auto stream = mImpl->stream(); |
| 2778 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2779 | auto resources = mImpl->resources(); |
| 2780 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2781 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2782 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2783 | uint32_t local_fenceCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2784 | VkFence* local_pFences; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 2785 | VkBool32 local_waitAll; |
| 2786 | uint64_t local_timeout; |
| 2787 | local_device = device; |
| 2788 | local_fenceCount = fenceCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2789 | local_pFences = nullptr; |
| 2790 | if (pFences) |
| 2791 | { |
| 2792 | local_pFences = (VkFence*)pool->dupArray(pFences, ((fenceCount)) * sizeof(const VkFence)); |
| 2793 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2794 | local_waitAll = waitAll; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2795 | local_timeout = timeout; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2796 | countingStream->rewind(); |
| 2797 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2798 | uint64_t cgen_var_182; |
| 2799 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_182, 1); |
| 2800 | countingStream->write((uint64_t*)&cgen_var_182, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2801 | countingStream->write((uint32_t*)&local_fenceCount, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2802 | if (((fenceCount))) |
| 2803 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2804 | uint64_t* cgen_var_183; |
| 2805 | countingStream->alloc((void**)&cgen_var_183, ((fenceCount)) * 8); |
| 2806 | countingStream->handleMapping()->mapHandles_VkFence_u64(local_pFences, cgen_var_183, ((fenceCount))); |
| 2807 | countingStream->write((uint64_t*)cgen_var_183, ((fenceCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2808 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2809 | countingStream->write((VkBool32*)&local_waitAll, sizeof(VkBool32)); |
| 2810 | countingStream->write((uint64_t*)&local_timeout, sizeof(uint64_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2811 | } |
| 2812 | uint32_t packetSize_vkWaitForFences = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 2813 | countingStream->rewind(); |
| 2814 | uint32_t opcode_vkWaitForFences = OP_vkWaitForFences; |
| 2815 | stream->write(&opcode_vkWaitForFences, sizeof(uint32_t)); |
| 2816 | stream->write(&packetSize_vkWaitForFences, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2817 | uint64_t cgen_var_184; |
| 2818 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_184, 1); |
| 2819 | stream->write((uint64_t*)&cgen_var_184, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2820 | stream->write((uint32_t*)&local_fenceCount, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2821 | if (((fenceCount))) |
| 2822 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2823 | uint64_t* cgen_var_185; |
| 2824 | stream->alloc((void**)&cgen_var_185, ((fenceCount)) * 8); |
| 2825 | stream->handleMapping()->mapHandles_VkFence_u64(local_pFences, cgen_var_185, ((fenceCount))); |
| 2826 | stream->write((uint64_t*)cgen_var_185, ((fenceCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2827 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2828 | stream->write((VkBool32*)&local_waitAll, sizeof(VkBool32)); |
| 2829 | stream->write((uint64_t*)&local_timeout, sizeof(uint64_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2830 | VkResult vkWaitForFences_VkResult_return = (VkResult)0; |
| 2831 | stream->read(&vkWaitForFences_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 2832 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2833 | countingStream->clearPool(); |
| 2834 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2835 | mImpl->log("finish vkWaitForFences");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2836 | return vkWaitForFences_VkResult_return; |
| 2837 | } |
| 2838 | |
| 2839 | VkResult VkEncoder::vkCreateSemaphore( |
| 2840 | VkDevice device, |
| 2841 | const VkSemaphoreCreateInfo* pCreateInfo, |
| 2842 | const VkAllocationCallbacks* pAllocator, |
| 2843 | VkSemaphore* pSemaphore) |
| 2844 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 2845 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2846 | mImpl->log("start vkCreateSemaphore"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2847 | auto stream = mImpl->stream(); |
| 2848 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2849 | auto resources = mImpl->resources(); |
| 2850 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2851 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2852 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2853 | VkSemaphoreCreateInfo* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 2854 | VkAllocationCallbacks* local_pAllocator; |
| 2855 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2856 | local_pCreateInfo = nullptr; |
| 2857 | if (pCreateInfo) |
| 2858 | { |
| 2859 | local_pCreateInfo = (VkSemaphoreCreateInfo*)pool->alloc(sizeof(const VkSemaphoreCreateInfo)); |
| 2860 | deepcopy_VkSemaphoreCreateInfo(pool, pCreateInfo, (VkSemaphoreCreateInfo*)(local_pCreateInfo)); |
| 2861 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2862 | local_pAllocator = nullptr; |
| 2863 | if (pAllocator) |
| 2864 | { |
| 2865 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 2866 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 2867 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 2868 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 2869 | if (local_pCreateInfo) |
| 2870 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 2871 | transform_tohost_VkSemaphoreCreateInfo(mImpl->resources(), (VkSemaphoreCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 2872 | } |
| 2873 | if (local_pAllocator) |
| 2874 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 2875 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 2876 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2877 | countingStream->rewind(); |
| 2878 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2879 | uint64_t cgen_var_186; |
| 2880 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_186, 1); |
| 2881 | countingStream->write((uint64_t*)&cgen_var_186, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2882 | marshal_VkSemaphoreCreateInfo(countingStream, (VkSemaphoreCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2883 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2884 | uint64_t cgen_var_187 = (uint64_t)(uintptr_t)local_pAllocator; |
| 2885 | countingStream->putBe64(cgen_var_187); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2886 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2887 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2888 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2889 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2890 | uint64_t cgen_var_188; |
| 2891 | countingStream->handleMapping()->mapHandles_VkSemaphore_u64(pSemaphore, &cgen_var_188, 1); |
| 2892 | countingStream->write((uint64_t*)&cgen_var_188, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2893 | } |
| 2894 | uint32_t packetSize_vkCreateSemaphore = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 2895 | countingStream->rewind(); |
| 2896 | uint32_t opcode_vkCreateSemaphore = OP_vkCreateSemaphore; |
| 2897 | stream->write(&opcode_vkCreateSemaphore, sizeof(uint32_t)); |
| 2898 | stream->write(&packetSize_vkCreateSemaphore, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2899 | uint64_t cgen_var_189; |
| 2900 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_189, 1); |
| 2901 | stream->write((uint64_t*)&cgen_var_189, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2902 | marshal_VkSemaphoreCreateInfo(stream, (VkSemaphoreCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2903 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2904 | uint64_t cgen_var_190 = (uint64_t)(uintptr_t)local_pAllocator; |
| 2905 | stream->putBe64(cgen_var_190); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2906 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2907 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2908 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2909 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2910 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2911 | uint64_t cgen_var_191; |
| 2912 | stream->handleMapping()->mapHandles_VkSemaphore_u64(pSemaphore, &cgen_var_191, 1); |
| 2913 | stream->write((uint64_t*)&cgen_var_191, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2914 | stream->setHandleMapping(resources->unwrapMapping()); |
| 2915 | stream->setHandleMapping(resources->createMapping()); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2916 | uint64_t cgen_var_192; |
| 2917 | stream->read((uint64_t*)&cgen_var_192, 8); |
| 2918 | stream->handleMapping()->mapHandles_u64_VkSemaphore(&cgen_var_192, (VkSemaphore*)pSemaphore, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2919 | stream->unsetHandleMapping(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2920 | VkResult vkCreateSemaphore_VkResult_return = (VkResult)0; |
| 2921 | stream->read(&vkCreateSemaphore_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 2922 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 2923 | countingStream->clearPool(); |
| 2924 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2925 | mImpl->log("finish vkCreateSemaphore");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2926 | return vkCreateSemaphore_VkResult_return; |
| 2927 | } |
| 2928 | |
| 2929 | void VkEncoder::vkDestroySemaphore( |
| 2930 | VkDevice device, |
| 2931 | VkSemaphore semaphore, |
| 2932 | const VkAllocationCallbacks* pAllocator) |
| 2933 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 2934 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2935 | mImpl->log("start vkDestroySemaphore"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2936 | auto stream = mImpl->stream(); |
| 2937 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2938 | auto resources = mImpl->resources(); |
| 2939 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 2940 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2941 | VkDevice local_device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 2942 | VkSemaphore local_semaphore; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2943 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 2944 | local_device = device; |
| 2945 | local_semaphore = semaphore; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2946 | local_pAllocator = nullptr; |
| 2947 | if (pAllocator) |
| 2948 | { |
| 2949 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 2950 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 2951 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 2952 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 2953 | if (local_pAllocator) |
| 2954 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 2955 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 2956 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2957 | countingStream->rewind(); |
| 2958 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2959 | uint64_t cgen_var_193; |
| 2960 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_193, 1); |
| 2961 | countingStream->write((uint64_t*)&cgen_var_193, 1 * 8); |
| 2962 | uint64_t cgen_var_194; |
| 2963 | countingStream->handleMapping()->mapHandles_VkSemaphore_u64(&local_semaphore, &cgen_var_194, 1); |
| 2964 | countingStream->write((uint64_t*)&cgen_var_194, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2965 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2966 | uint64_t cgen_var_195 = (uint64_t)(uintptr_t)local_pAllocator; |
| 2967 | countingStream->putBe64(cgen_var_195); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2968 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2969 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2970 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2971 | } |
| 2972 | } |
| 2973 | uint32_t packetSize_vkDestroySemaphore = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 2974 | countingStream->rewind(); |
| 2975 | uint32_t opcode_vkDestroySemaphore = OP_vkDestroySemaphore; |
| 2976 | stream->write(&opcode_vkDestroySemaphore, sizeof(uint32_t)); |
| 2977 | stream->write(&packetSize_vkDestroySemaphore, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2978 | uint64_t cgen_var_196; |
| 2979 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_196, 1); |
| 2980 | stream->write((uint64_t*)&cgen_var_196, 1 * 8); |
| 2981 | uint64_t cgen_var_197; |
| 2982 | stream->handleMapping()->mapHandles_VkSemaphore_u64(&local_semaphore, &cgen_var_197, 1); |
| 2983 | stream->write((uint64_t*)&cgen_var_197, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 2984 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 2985 | uint64_t cgen_var_198 = (uint64_t)(uintptr_t)local_pAllocator; |
| 2986 | stream->putBe64(cgen_var_198); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2987 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2988 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2989 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2990 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 2991 | resources->destroyMapping()->mapHandles_VkSemaphore((VkSemaphore*)&semaphore); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 2992 | pool->freeAll(); |
| 2993 | countingStream->clearPool(); |
| 2994 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 2995 | mImpl->log("finish vkDestroySemaphore");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 2996 | } |
| 2997 | |
| 2998 | VkResult VkEncoder::vkCreateEvent( |
| 2999 | VkDevice device, |
| 3000 | const VkEventCreateInfo* pCreateInfo, |
| 3001 | const VkAllocationCallbacks* pAllocator, |
| 3002 | VkEvent* pEvent) |
| 3003 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 3004 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3005 | mImpl->log("start vkCreateEvent"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3006 | auto stream = mImpl->stream(); |
| 3007 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3008 | auto resources = mImpl->resources(); |
| 3009 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3010 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3011 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3012 | VkEventCreateInfo* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 3013 | VkAllocationCallbacks* local_pAllocator; |
| 3014 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3015 | local_pCreateInfo = nullptr; |
| 3016 | if (pCreateInfo) |
| 3017 | { |
| 3018 | local_pCreateInfo = (VkEventCreateInfo*)pool->alloc(sizeof(const VkEventCreateInfo)); |
| 3019 | deepcopy_VkEventCreateInfo(pool, pCreateInfo, (VkEventCreateInfo*)(local_pCreateInfo)); |
| 3020 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3021 | local_pAllocator = nullptr; |
| 3022 | if (pAllocator) |
| 3023 | { |
| 3024 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 3025 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 3026 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 3027 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 3028 | if (local_pCreateInfo) |
| 3029 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 3030 | transform_tohost_VkEventCreateInfo(mImpl->resources(), (VkEventCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 3031 | } |
| 3032 | if (local_pAllocator) |
| 3033 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 3034 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 3035 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3036 | countingStream->rewind(); |
| 3037 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3038 | uint64_t cgen_var_199; |
| 3039 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_199, 1); |
| 3040 | countingStream->write((uint64_t*)&cgen_var_199, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3041 | marshal_VkEventCreateInfo(countingStream, (VkEventCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3042 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3043 | uint64_t cgen_var_200 = (uint64_t)(uintptr_t)local_pAllocator; |
| 3044 | countingStream->putBe64(cgen_var_200); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3045 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3046 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3047 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3048 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3049 | uint64_t cgen_var_201; |
| 3050 | countingStream->handleMapping()->mapHandles_VkEvent_u64(pEvent, &cgen_var_201, 1); |
| 3051 | countingStream->write((uint64_t*)&cgen_var_201, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3052 | } |
| 3053 | uint32_t packetSize_vkCreateEvent = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 3054 | countingStream->rewind(); |
| 3055 | uint32_t opcode_vkCreateEvent = OP_vkCreateEvent; |
| 3056 | stream->write(&opcode_vkCreateEvent, sizeof(uint32_t)); |
| 3057 | stream->write(&packetSize_vkCreateEvent, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3058 | uint64_t cgen_var_202; |
| 3059 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_202, 1); |
| 3060 | stream->write((uint64_t*)&cgen_var_202, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3061 | marshal_VkEventCreateInfo(stream, (VkEventCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3062 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3063 | uint64_t cgen_var_203 = (uint64_t)(uintptr_t)local_pAllocator; |
| 3064 | stream->putBe64(cgen_var_203); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3065 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3066 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3067 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3068 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3069 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3070 | uint64_t cgen_var_204; |
| 3071 | stream->handleMapping()->mapHandles_VkEvent_u64(pEvent, &cgen_var_204, 1); |
| 3072 | stream->write((uint64_t*)&cgen_var_204, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3073 | stream->setHandleMapping(resources->unwrapMapping()); |
| 3074 | stream->setHandleMapping(resources->createMapping()); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3075 | uint64_t cgen_var_205; |
| 3076 | stream->read((uint64_t*)&cgen_var_205, 8); |
| 3077 | stream->handleMapping()->mapHandles_u64_VkEvent(&cgen_var_205, (VkEvent*)pEvent, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3078 | stream->unsetHandleMapping(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3079 | VkResult vkCreateEvent_VkResult_return = (VkResult)0; |
| 3080 | stream->read(&vkCreateEvent_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 3081 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3082 | countingStream->clearPool(); |
| 3083 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3084 | mImpl->log("finish vkCreateEvent");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3085 | return vkCreateEvent_VkResult_return; |
| 3086 | } |
| 3087 | |
| 3088 | void VkEncoder::vkDestroyEvent( |
| 3089 | VkDevice device, |
| 3090 | VkEvent event, |
| 3091 | const VkAllocationCallbacks* pAllocator) |
| 3092 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 3093 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3094 | mImpl->log("start vkDestroyEvent"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3095 | auto stream = mImpl->stream(); |
| 3096 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3097 | auto resources = mImpl->resources(); |
| 3098 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3099 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3100 | VkDevice local_device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 3101 | VkEvent local_event; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3102 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 3103 | local_device = device; |
| 3104 | local_event = event; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3105 | local_pAllocator = nullptr; |
| 3106 | if (pAllocator) |
| 3107 | { |
| 3108 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 3109 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 3110 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 3111 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 3112 | if (local_pAllocator) |
| 3113 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 3114 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 3115 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3116 | countingStream->rewind(); |
| 3117 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3118 | uint64_t cgen_var_206; |
| 3119 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_206, 1); |
| 3120 | countingStream->write((uint64_t*)&cgen_var_206, 1 * 8); |
| 3121 | uint64_t cgen_var_207; |
| 3122 | countingStream->handleMapping()->mapHandles_VkEvent_u64(&local_event, &cgen_var_207, 1); |
| 3123 | countingStream->write((uint64_t*)&cgen_var_207, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3124 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3125 | uint64_t cgen_var_208 = (uint64_t)(uintptr_t)local_pAllocator; |
| 3126 | countingStream->putBe64(cgen_var_208); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3127 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3128 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3129 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3130 | } |
| 3131 | } |
| 3132 | uint32_t packetSize_vkDestroyEvent = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 3133 | countingStream->rewind(); |
| 3134 | uint32_t opcode_vkDestroyEvent = OP_vkDestroyEvent; |
| 3135 | stream->write(&opcode_vkDestroyEvent, sizeof(uint32_t)); |
| 3136 | stream->write(&packetSize_vkDestroyEvent, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3137 | uint64_t cgen_var_209; |
| 3138 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_209, 1); |
| 3139 | stream->write((uint64_t*)&cgen_var_209, 1 * 8); |
| 3140 | uint64_t cgen_var_210; |
| 3141 | stream->handleMapping()->mapHandles_VkEvent_u64(&local_event, &cgen_var_210, 1); |
| 3142 | stream->write((uint64_t*)&cgen_var_210, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3143 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3144 | uint64_t cgen_var_211 = (uint64_t)(uintptr_t)local_pAllocator; |
| 3145 | stream->putBe64(cgen_var_211); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3146 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3147 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3148 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3149 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3150 | resources->destroyMapping()->mapHandles_VkEvent((VkEvent*)&event); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 3151 | pool->freeAll(); |
| 3152 | countingStream->clearPool(); |
| 3153 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3154 | mImpl->log("finish vkDestroyEvent");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3155 | } |
| 3156 | |
| 3157 | VkResult VkEncoder::vkGetEventStatus( |
| 3158 | VkDevice device, |
| 3159 | VkEvent event) |
| 3160 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 3161 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3162 | mImpl->log("start vkGetEventStatus"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3163 | auto stream = mImpl->stream(); |
| 3164 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3165 | auto resources = mImpl->resources(); |
| 3166 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3167 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3168 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3169 | VkEvent local_event; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 3170 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3171 | local_event = event; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3172 | countingStream->rewind(); |
| 3173 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3174 | uint64_t cgen_var_212; |
| 3175 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_212, 1); |
| 3176 | countingStream->write((uint64_t*)&cgen_var_212, 1 * 8); |
| 3177 | uint64_t cgen_var_213; |
| 3178 | countingStream->handleMapping()->mapHandles_VkEvent_u64(&local_event, &cgen_var_213, 1); |
| 3179 | countingStream->write((uint64_t*)&cgen_var_213, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3180 | } |
| 3181 | uint32_t packetSize_vkGetEventStatus = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 3182 | countingStream->rewind(); |
| 3183 | uint32_t opcode_vkGetEventStatus = OP_vkGetEventStatus; |
| 3184 | stream->write(&opcode_vkGetEventStatus, sizeof(uint32_t)); |
| 3185 | stream->write(&packetSize_vkGetEventStatus, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3186 | uint64_t cgen_var_214; |
| 3187 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_214, 1); |
| 3188 | stream->write((uint64_t*)&cgen_var_214, 1 * 8); |
| 3189 | uint64_t cgen_var_215; |
| 3190 | stream->handleMapping()->mapHandles_VkEvent_u64(&local_event, &cgen_var_215, 1); |
| 3191 | stream->write((uint64_t*)&cgen_var_215, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3192 | VkResult vkGetEventStatus_VkResult_return = (VkResult)0; |
| 3193 | stream->read(&vkGetEventStatus_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 3194 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3195 | countingStream->clearPool(); |
| 3196 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3197 | mImpl->log("finish vkGetEventStatus");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3198 | return vkGetEventStatus_VkResult_return; |
| 3199 | } |
| 3200 | |
| 3201 | VkResult VkEncoder::vkSetEvent( |
| 3202 | VkDevice device, |
| 3203 | VkEvent event) |
| 3204 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 3205 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3206 | mImpl->log("start vkSetEvent"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3207 | auto stream = mImpl->stream(); |
| 3208 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3209 | auto resources = mImpl->resources(); |
| 3210 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3211 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3212 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3213 | VkEvent local_event; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 3214 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3215 | local_event = event; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3216 | countingStream->rewind(); |
| 3217 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3218 | uint64_t cgen_var_216; |
| 3219 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_216, 1); |
| 3220 | countingStream->write((uint64_t*)&cgen_var_216, 1 * 8); |
| 3221 | uint64_t cgen_var_217; |
| 3222 | countingStream->handleMapping()->mapHandles_VkEvent_u64(&local_event, &cgen_var_217, 1); |
| 3223 | countingStream->write((uint64_t*)&cgen_var_217, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3224 | } |
| 3225 | uint32_t packetSize_vkSetEvent = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 3226 | countingStream->rewind(); |
| 3227 | uint32_t opcode_vkSetEvent = OP_vkSetEvent; |
| 3228 | stream->write(&opcode_vkSetEvent, sizeof(uint32_t)); |
| 3229 | stream->write(&packetSize_vkSetEvent, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3230 | uint64_t cgen_var_218; |
| 3231 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_218, 1); |
| 3232 | stream->write((uint64_t*)&cgen_var_218, 1 * 8); |
| 3233 | uint64_t cgen_var_219; |
| 3234 | stream->handleMapping()->mapHandles_VkEvent_u64(&local_event, &cgen_var_219, 1); |
| 3235 | stream->write((uint64_t*)&cgen_var_219, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3236 | VkResult vkSetEvent_VkResult_return = (VkResult)0; |
| 3237 | stream->read(&vkSetEvent_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 3238 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3239 | countingStream->clearPool(); |
| 3240 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3241 | mImpl->log("finish vkSetEvent");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3242 | return vkSetEvent_VkResult_return; |
| 3243 | } |
| 3244 | |
| 3245 | VkResult VkEncoder::vkResetEvent( |
| 3246 | VkDevice device, |
| 3247 | VkEvent event) |
| 3248 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 3249 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3250 | mImpl->log("start vkResetEvent"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3251 | auto stream = mImpl->stream(); |
| 3252 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3253 | auto resources = mImpl->resources(); |
| 3254 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3255 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3256 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3257 | VkEvent local_event; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 3258 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3259 | local_event = event; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3260 | countingStream->rewind(); |
| 3261 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3262 | uint64_t cgen_var_220; |
| 3263 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_220, 1); |
| 3264 | countingStream->write((uint64_t*)&cgen_var_220, 1 * 8); |
| 3265 | uint64_t cgen_var_221; |
| 3266 | countingStream->handleMapping()->mapHandles_VkEvent_u64(&local_event, &cgen_var_221, 1); |
| 3267 | countingStream->write((uint64_t*)&cgen_var_221, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3268 | } |
| 3269 | uint32_t packetSize_vkResetEvent = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 3270 | countingStream->rewind(); |
| 3271 | uint32_t opcode_vkResetEvent = OP_vkResetEvent; |
| 3272 | stream->write(&opcode_vkResetEvent, sizeof(uint32_t)); |
| 3273 | stream->write(&packetSize_vkResetEvent, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3274 | uint64_t cgen_var_222; |
| 3275 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_222, 1); |
| 3276 | stream->write((uint64_t*)&cgen_var_222, 1 * 8); |
| 3277 | uint64_t cgen_var_223; |
| 3278 | stream->handleMapping()->mapHandles_VkEvent_u64(&local_event, &cgen_var_223, 1); |
| 3279 | stream->write((uint64_t*)&cgen_var_223, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3280 | VkResult vkResetEvent_VkResult_return = (VkResult)0; |
| 3281 | stream->read(&vkResetEvent_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 3282 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3283 | countingStream->clearPool(); |
| 3284 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3285 | mImpl->log("finish vkResetEvent");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3286 | return vkResetEvent_VkResult_return; |
| 3287 | } |
| 3288 | |
| 3289 | VkResult VkEncoder::vkCreateQueryPool( |
| 3290 | VkDevice device, |
| 3291 | const VkQueryPoolCreateInfo* pCreateInfo, |
| 3292 | const VkAllocationCallbacks* pAllocator, |
| 3293 | VkQueryPool* pQueryPool) |
| 3294 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 3295 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3296 | mImpl->log("start vkCreateQueryPool"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3297 | auto stream = mImpl->stream(); |
| 3298 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3299 | auto resources = mImpl->resources(); |
| 3300 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3301 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3302 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3303 | VkQueryPoolCreateInfo* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 3304 | VkAllocationCallbacks* local_pAllocator; |
| 3305 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3306 | local_pCreateInfo = nullptr; |
| 3307 | if (pCreateInfo) |
| 3308 | { |
| 3309 | local_pCreateInfo = (VkQueryPoolCreateInfo*)pool->alloc(sizeof(const VkQueryPoolCreateInfo)); |
| 3310 | deepcopy_VkQueryPoolCreateInfo(pool, pCreateInfo, (VkQueryPoolCreateInfo*)(local_pCreateInfo)); |
| 3311 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3312 | local_pAllocator = nullptr; |
| 3313 | if (pAllocator) |
| 3314 | { |
| 3315 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 3316 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 3317 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 3318 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 3319 | if (local_pCreateInfo) |
| 3320 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 3321 | transform_tohost_VkQueryPoolCreateInfo(mImpl->resources(), (VkQueryPoolCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 3322 | } |
| 3323 | if (local_pAllocator) |
| 3324 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 3325 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 3326 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3327 | countingStream->rewind(); |
| 3328 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3329 | uint64_t cgen_var_224; |
| 3330 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_224, 1); |
| 3331 | countingStream->write((uint64_t*)&cgen_var_224, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3332 | marshal_VkQueryPoolCreateInfo(countingStream, (VkQueryPoolCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3333 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3334 | uint64_t cgen_var_225 = (uint64_t)(uintptr_t)local_pAllocator; |
| 3335 | countingStream->putBe64(cgen_var_225); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3336 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3337 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3338 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3339 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3340 | uint64_t cgen_var_226; |
| 3341 | countingStream->handleMapping()->mapHandles_VkQueryPool_u64(pQueryPool, &cgen_var_226, 1); |
| 3342 | countingStream->write((uint64_t*)&cgen_var_226, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3343 | } |
| 3344 | uint32_t packetSize_vkCreateQueryPool = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 3345 | countingStream->rewind(); |
| 3346 | uint32_t opcode_vkCreateQueryPool = OP_vkCreateQueryPool; |
| 3347 | stream->write(&opcode_vkCreateQueryPool, sizeof(uint32_t)); |
| 3348 | stream->write(&packetSize_vkCreateQueryPool, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3349 | uint64_t cgen_var_227; |
| 3350 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_227, 1); |
| 3351 | stream->write((uint64_t*)&cgen_var_227, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3352 | marshal_VkQueryPoolCreateInfo(stream, (VkQueryPoolCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3353 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3354 | uint64_t cgen_var_228 = (uint64_t)(uintptr_t)local_pAllocator; |
| 3355 | stream->putBe64(cgen_var_228); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3356 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3357 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3358 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3359 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3360 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3361 | uint64_t cgen_var_229; |
| 3362 | stream->handleMapping()->mapHandles_VkQueryPool_u64(pQueryPool, &cgen_var_229, 1); |
| 3363 | stream->write((uint64_t*)&cgen_var_229, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3364 | stream->setHandleMapping(resources->unwrapMapping()); |
| 3365 | stream->setHandleMapping(resources->createMapping()); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3366 | uint64_t cgen_var_230; |
| 3367 | stream->read((uint64_t*)&cgen_var_230, 8); |
| 3368 | stream->handleMapping()->mapHandles_u64_VkQueryPool(&cgen_var_230, (VkQueryPool*)pQueryPool, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3369 | stream->unsetHandleMapping(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3370 | VkResult vkCreateQueryPool_VkResult_return = (VkResult)0; |
| 3371 | stream->read(&vkCreateQueryPool_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 3372 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3373 | countingStream->clearPool(); |
| 3374 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3375 | mImpl->log("finish vkCreateQueryPool");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3376 | return vkCreateQueryPool_VkResult_return; |
| 3377 | } |
| 3378 | |
| 3379 | void VkEncoder::vkDestroyQueryPool( |
| 3380 | VkDevice device, |
| 3381 | VkQueryPool queryPool, |
| 3382 | const VkAllocationCallbacks* pAllocator) |
| 3383 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 3384 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3385 | mImpl->log("start vkDestroyQueryPool"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3386 | auto stream = mImpl->stream(); |
| 3387 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3388 | auto resources = mImpl->resources(); |
| 3389 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3390 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3391 | VkDevice local_device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 3392 | VkQueryPool local_queryPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3393 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 3394 | local_device = device; |
| 3395 | local_queryPool = queryPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3396 | local_pAllocator = nullptr; |
| 3397 | if (pAllocator) |
| 3398 | { |
| 3399 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 3400 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 3401 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 3402 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 3403 | if (local_pAllocator) |
| 3404 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 3405 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 3406 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3407 | countingStream->rewind(); |
| 3408 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3409 | uint64_t cgen_var_231; |
| 3410 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_231, 1); |
| 3411 | countingStream->write((uint64_t*)&cgen_var_231, 1 * 8); |
| 3412 | uint64_t cgen_var_232; |
| 3413 | countingStream->handleMapping()->mapHandles_VkQueryPool_u64(&local_queryPool, &cgen_var_232, 1); |
| 3414 | countingStream->write((uint64_t*)&cgen_var_232, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3415 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3416 | uint64_t cgen_var_233 = (uint64_t)(uintptr_t)local_pAllocator; |
| 3417 | countingStream->putBe64(cgen_var_233); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3418 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3419 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3420 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3421 | } |
| 3422 | } |
| 3423 | uint32_t packetSize_vkDestroyQueryPool = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 3424 | countingStream->rewind(); |
| 3425 | uint32_t opcode_vkDestroyQueryPool = OP_vkDestroyQueryPool; |
| 3426 | stream->write(&opcode_vkDestroyQueryPool, sizeof(uint32_t)); |
| 3427 | stream->write(&packetSize_vkDestroyQueryPool, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3428 | uint64_t cgen_var_234; |
| 3429 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_234, 1); |
| 3430 | stream->write((uint64_t*)&cgen_var_234, 1 * 8); |
| 3431 | uint64_t cgen_var_235; |
| 3432 | stream->handleMapping()->mapHandles_VkQueryPool_u64(&local_queryPool, &cgen_var_235, 1); |
| 3433 | stream->write((uint64_t*)&cgen_var_235, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3434 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3435 | uint64_t cgen_var_236 = (uint64_t)(uintptr_t)local_pAllocator; |
| 3436 | stream->putBe64(cgen_var_236); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3437 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3438 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3439 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3440 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3441 | resources->destroyMapping()->mapHandles_VkQueryPool((VkQueryPool*)&queryPool); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 3442 | pool->freeAll(); |
| 3443 | countingStream->clearPool(); |
| 3444 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3445 | mImpl->log("finish vkDestroyQueryPool");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3446 | } |
| 3447 | |
| 3448 | VkResult VkEncoder::vkGetQueryPoolResults( |
| 3449 | VkDevice device, |
| 3450 | VkQueryPool queryPool, |
| 3451 | uint32_t firstQuery, |
| 3452 | uint32_t queryCount, |
| 3453 | size_t dataSize, |
| 3454 | void* pData, |
| 3455 | VkDeviceSize stride, |
| 3456 | VkQueryResultFlags flags) |
| 3457 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 3458 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3459 | mImpl->log("start vkGetQueryPoolResults"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3460 | auto stream = mImpl->stream(); |
| 3461 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3462 | auto resources = mImpl->resources(); |
| 3463 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3464 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3465 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3466 | VkQueryPool local_queryPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3467 | uint32_t local_firstQuery; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3468 | uint32_t local_queryCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3469 | size_t local_dataSize; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3470 | VkDeviceSize local_stride; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3471 | VkQueryResultFlags local_flags; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 3472 | local_device = device; |
| 3473 | local_queryPool = queryPool; |
| 3474 | local_firstQuery = firstQuery; |
| 3475 | local_queryCount = queryCount; |
| 3476 | local_dataSize = dataSize; |
| 3477 | local_stride = stride; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3478 | local_flags = flags; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3479 | countingStream->rewind(); |
| 3480 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3481 | uint64_t cgen_var_237; |
| 3482 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_237, 1); |
| 3483 | countingStream->write((uint64_t*)&cgen_var_237, 1 * 8); |
| 3484 | uint64_t cgen_var_238; |
| 3485 | countingStream->handleMapping()->mapHandles_VkQueryPool_u64(&local_queryPool, &cgen_var_238, 1); |
| 3486 | countingStream->write((uint64_t*)&cgen_var_238, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3487 | countingStream->write((uint32_t*)&local_firstQuery, sizeof(uint32_t)); |
| 3488 | countingStream->write((uint32_t*)&local_queryCount, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3489 | uint64_t cgen_var_239 = (uint64_t)local_dataSize; |
| 3490 | countingStream->putBe64(cgen_var_239); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3491 | countingStream->write((void*)pData, ((dataSize)) * sizeof(uint8_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3492 | countingStream->write((VkDeviceSize*)&local_stride, sizeof(VkDeviceSize)); |
| 3493 | countingStream->write((VkQueryResultFlags*)&local_flags, sizeof(VkQueryResultFlags)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3494 | } |
| 3495 | uint32_t packetSize_vkGetQueryPoolResults = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 3496 | countingStream->rewind(); |
| 3497 | uint32_t opcode_vkGetQueryPoolResults = OP_vkGetQueryPoolResults; |
| 3498 | stream->write(&opcode_vkGetQueryPoolResults, sizeof(uint32_t)); |
| 3499 | stream->write(&packetSize_vkGetQueryPoolResults, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3500 | uint64_t cgen_var_240; |
| 3501 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_240, 1); |
| 3502 | stream->write((uint64_t*)&cgen_var_240, 1 * 8); |
| 3503 | uint64_t cgen_var_241; |
| 3504 | stream->handleMapping()->mapHandles_VkQueryPool_u64(&local_queryPool, &cgen_var_241, 1); |
| 3505 | stream->write((uint64_t*)&cgen_var_241, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3506 | stream->write((uint32_t*)&local_firstQuery, sizeof(uint32_t)); |
| 3507 | stream->write((uint32_t*)&local_queryCount, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3508 | uint64_t cgen_var_242 = (uint64_t)local_dataSize; |
| 3509 | stream->putBe64(cgen_var_242); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3510 | stream->write((void*)pData, ((dataSize)) * sizeof(uint8_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3511 | stream->write((VkDeviceSize*)&local_stride, sizeof(VkDeviceSize)); |
| 3512 | stream->write((VkQueryResultFlags*)&local_flags, sizeof(VkQueryResultFlags)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3513 | stream->read((void*)pData, ((dataSize)) * sizeof(uint8_t)); |
| 3514 | VkResult vkGetQueryPoolResults_VkResult_return = (VkResult)0; |
| 3515 | stream->read(&vkGetQueryPoolResults_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 3516 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3517 | countingStream->clearPool(); |
| 3518 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3519 | mImpl->log("finish vkGetQueryPoolResults");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3520 | return vkGetQueryPoolResults_VkResult_return; |
| 3521 | } |
| 3522 | |
| 3523 | VkResult VkEncoder::vkCreateBuffer( |
| 3524 | VkDevice device, |
| 3525 | const VkBufferCreateInfo* pCreateInfo, |
| 3526 | const VkAllocationCallbacks* pAllocator, |
| 3527 | VkBuffer* pBuffer) |
| 3528 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 3529 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3530 | mImpl->log("start vkCreateBuffer"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3531 | auto stream = mImpl->stream(); |
| 3532 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3533 | auto resources = mImpl->resources(); |
| 3534 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3535 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3536 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3537 | VkBufferCreateInfo* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 3538 | VkAllocationCallbacks* local_pAllocator; |
| 3539 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3540 | local_pCreateInfo = nullptr; |
| 3541 | if (pCreateInfo) |
| 3542 | { |
| 3543 | local_pCreateInfo = (VkBufferCreateInfo*)pool->alloc(sizeof(const VkBufferCreateInfo)); |
| 3544 | deepcopy_VkBufferCreateInfo(pool, pCreateInfo, (VkBufferCreateInfo*)(local_pCreateInfo)); |
| 3545 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3546 | local_pAllocator = nullptr; |
| 3547 | if (pAllocator) |
| 3548 | { |
| 3549 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 3550 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 3551 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 3552 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 3553 | if (local_pCreateInfo) |
| 3554 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 3555 | transform_tohost_VkBufferCreateInfo(mImpl->resources(), (VkBufferCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 3556 | } |
| 3557 | if (local_pAllocator) |
| 3558 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 3559 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 3560 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3561 | countingStream->rewind(); |
| 3562 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3563 | uint64_t cgen_var_243; |
| 3564 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_243, 1); |
| 3565 | countingStream->write((uint64_t*)&cgen_var_243, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3566 | marshal_VkBufferCreateInfo(countingStream, (VkBufferCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3567 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3568 | uint64_t cgen_var_244 = (uint64_t)(uintptr_t)local_pAllocator; |
| 3569 | countingStream->putBe64(cgen_var_244); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3570 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3571 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3572 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3573 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3574 | uint64_t cgen_var_245; |
| 3575 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(pBuffer, &cgen_var_245, 1); |
| 3576 | countingStream->write((uint64_t*)&cgen_var_245, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3577 | } |
| 3578 | uint32_t packetSize_vkCreateBuffer = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 3579 | countingStream->rewind(); |
| 3580 | uint32_t opcode_vkCreateBuffer = OP_vkCreateBuffer; |
| 3581 | stream->write(&opcode_vkCreateBuffer, sizeof(uint32_t)); |
| 3582 | stream->write(&packetSize_vkCreateBuffer, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3583 | uint64_t cgen_var_246; |
| 3584 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_246, 1); |
| 3585 | stream->write((uint64_t*)&cgen_var_246, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3586 | marshal_VkBufferCreateInfo(stream, (VkBufferCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3587 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3588 | uint64_t cgen_var_247 = (uint64_t)(uintptr_t)local_pAllocator; |
| 3589 | stream->putBe64(cgen_var_247); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3590 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3591 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3592 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3593 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3594 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3595 | uint64_t cgen_var_248; |
| 3596 | stream->handleMapping()->mapHandles_VkBuffer_u64(pBuffer, &cgen_var_248, 1); |
| 3597 | stream->write((uint64_t*)&cgen_var_248, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3598 | stream->setHandleMapping(resources->unwrapMapping()); |
| 3599 | stream->setHandleMapping(resources->createMapping()); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3600 | uint64_t cgen_var_249; |
| 3601 | stream->read((uint64_t*)&cgen_var_249, 8); |
| 3602 | stream->handleMapping()->mapHandles_u64_VkBuffer(&cgen_var_249, (VkBuffer*)pBuffer, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3603 | stream->unsetHandleMapping(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3604 | VkResult vkCreateBuffer_VkResult_return = (VkResult)0; |
| 3605 | stream->read(&vkCreateBuffer_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 3606 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3607 | countingStream->clearPool(); |
| 3608 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3609 | mImpl->log("finish vkCreateBuffer");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3610 | return vkCreateBuffer_VkResult_return; |
| 3611 | } |
| 3612 | |
| 3613 | void VkEncoder::vkDestroyBuffer( |
| 3614 | VkDevice device, |
| 3615 | VkBuffer buffer, |
| 3616 | const VkAllocationCallbacks* pAllocator) |
| 3617 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 3618 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3619 | mImpl->log("start vkDestroyBuffer"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3620 | auto stream = mImpl->stream(); |
| 3621 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3622 | auto resources = mImpl->resources(); |
| 3623 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3624 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3625 | VkDevice local_device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 3626 | VkBuffer local_buffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3627 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 3628 | local_device = device; |
| 3629 | local_buffer = buffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3630 | local_pAllocator = nullptr; |
| 3631 | if (pAllocator) |
| 3632 | { |
| 3633 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 3634 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 3635 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 3636 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 3637 | if (local_pAllocator) |
| 3638 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 3639 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 3640 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3641 | countingStream->rewind(); |
| 3642 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3643 | uint64_t cgen_var_250; |
| 3644 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_250, 1); |
| 3645 | countingStream->write((uint64_t*)&cgen_var_250, 1 * 8); |
| 3646 | uint64_t cgen_var_251; |
| 3647 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_251, 1); |
| 3648 | countingStream->write((uint64_t*)&cgen_var_251, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3649 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3650 | uint64_t cgen_var_252 = (uint64_t)(uintptr_t)local_pAllocator; |
| 3651 | countingStream->putBe64(cgen_var_252); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3652 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3653 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3654 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3655 | } |
| 3656 | } |
| 3657 | uint32_t packetSize_vkDestroyBuffer = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 3658 | countingStream->rewind(); |
| 3659 | uint32_t opcode_vkDestroyBuffer = OP_vkDestroyBuffer; |
| 3660 | stream->write(&opcode_vkDestroyBuffer, sizeof(uint32_t)); |
| 3661 | stream->write(&packetSize_vkDestroyBuffer, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3662 | uint64_t cgen_var_253; |
| 3663 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_253, 1); |
| 3664 | stream->write((uint64_t*)&cgen_var_253, 1 * 8); |
| 3665 | uint64_t cgen_var_254; |
| 3666 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_254, 1); |
| 3667 | stream->write((uint64_t*)&cgen_var_254, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3668 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3669 | uint64_t cgen_var_255 = (uint64_t)(uintptr_t)local_pAllocator; |
| 3670 | stream->putBe64(cgen_var_255); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3671 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3672 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3673 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3674 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3675 | resources->destroyMapping()->mapHandles_VkBuffer((VkBuffer*)&buffer); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 3676 | pool->freeAll(); |
| 3677 | countingStream->clearPool(); |
| 3678 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3679 | mImpl->log("finish vkDestroyBuffer");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3680 | } |
| 3681 | |
| 3682 | VkResult VkEncoder::vkCreateBufferView( |
| 3683 | VkDevice device, |
| 3684 | const VkBufferViewCreateInfo* pCreateInfo, |
| 3685 | const VkAllocationCallbacks* pAllocator, |
| 3686 | VkBufferView* pView) |
| 3687 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 3688 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3689 | mImpl->log("start vkCreateBufferView"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3690 | auto stream = mImpl->stream(); |
| 3691 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3692 | auto resources = mImpl->resources(); |
| 3693 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3694 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3695 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3696 | VkBufferViewCreateInfo* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 3697 | VkAllocationCallbacks* local_pAllocator; |
| 3698 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3699 | local_pCreateInfo = nullptr; |
| 3700 | if (pCreateInfo) |
| 3701 | { |
| 3702 | local_pCreateInfo = (VkBufferViewCreateInfo*)pool->alloc(sizeof(const VkBufferViewCreateInfo)); |
| 3703 | deepcopy_VkBufferViewCreateInfo(pool, pCreateInfo, (VkBufferViewCreateInfo*)(local_pCreateInfo)); |
| 3704 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3705 | local_pAllocator = nullptr; |
| 3706 | if (pAllocator) |
| 3707 | { |
| 3708 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 3709 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 3710 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 3711 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 3712 | if (local_pCreateInfo) |
| 3713 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 3714 | transform_tohost_VkBufferViewCreateInfo(mImpl->resources(), (VkBufferViewCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 3715 | } |
| 3716 | if (local_pAllocator) |
| 3717 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 3718 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 3719 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3720 | countingStream->rewind(); |
| 3721 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3722 | uint64_t cgen_var_256; |
| 3723 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_256, 1); |
| 3724 | countingStream->write((uint64_t*)&cgen_var_256, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3725 | marshal_VkBufferViewCreateInfo(countingStream, (VkBufferViewCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3726 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3727 | uint64_t cgen_var_257 = (uint64_t)(uintptr_t)local_pAllocator; |
| 3728 | countingStream->putBe64(cgen_var_257); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3729 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3730 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3731 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3732 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3733 | uint64_t cgen_var_258; |
| 3734 | countingStream->handleMapping()->mapHandles_VkBufferView_u64(pView, &cgen_var_258, 1); |
| 3735 | countingStream->write((uint64_t*)&cgen_var_258, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3736 | } |
| 3737 | uint32_t packetSize_vkCreateBufferView = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 3738 | countingStream->rewind(); |
| 3739 | uint32_t opcode_vkCreateBufferView = OP_vkCreateBufferView; |
| 3740 | stream->write(&opcode_vkCreateBufferView, sizeof(uint32_t)); |
| 3741 | stream->write(&packetSize_vkCreateBufferView, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3742 | uint64_t cgen_var_259; |
| 3743 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_259, 1); |
| 3744 | stream->write((uint64_t*)&cgen_var_259, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3745 | marshal_VkBufferViewCreateInfo(stream, (VkBufferViewCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3746 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3747 | uint64_t cgen_var_260 = (uint64_t)(uintptr_t)local_pAllocator; |
| 3748 | stream->putBe64(cgen_var_260); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3749 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3750 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3751 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3752 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3753 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3754 | uint64_t cgen_var_261; |
| 3755 | stream->handleMapping()->mapHandles_VkBufferView_u64(pView, &cgen_var_261, 1); |
| 3756 | stream->write((uint64_t*)&cgen_var_261, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3757 | stream->setHandleMapping(resources->unwrapMapping()); |
| 3758 | stream->setHandleMapping(resources->createMapping()); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3759 | uint64_t cgen_var_262; |
| 3760 | stream->read((uint64_t*)&cgen_var_262, 8); |
| 3761 | stream->handleMapping()->mapHandles_u64_VkBufferView(&cgen_var_262, (VkBufferView*)pView, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3762 | stream->unsetHandleMapping(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3763 | VkResult vkCreateBufferView_VkResult_return = (VkResult)0; |
| 3764 | stream->read(&vkCreateBufferView_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 3765 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3766 | countingStream->clearPool(); |
| 3767 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3768 | mImpl->log("finish vkCreateBufferView");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3769 | return vkCreateBufferView_VkResult_return; |
| 3770 | } |
| 3771 | |
| 3772 | void VkEncoder::vkDestroyBufferView( |
| 3773 | VkDevice device, |
| 3774 | VkBufferView bufferView, |
| 3775 | const VkAllocationCallbacks* pAllocator) |
| 3776 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 3777 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3778 | mImpl->log("start vkDestroyBufferView"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3779 | auto stream = mImpl->stream(); |
| 3780 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3781 | auto resources = mImpl->resources(); |
| 3782 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3783 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3784 | VkDevice local_device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 3785 | VkBufferView local_bufferView; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3786 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 3787 | local_device = device; |
| 3788 | local_bufferView = bufferView; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3789 | local_pAllocator = nullptr; |
| 3790 | if (pAllocator) |
| 3791 | { |
| 3792 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 3793 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 3794 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 3795 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 3796 | if (local_pAllocator) |
| 3797 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 3798 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 3799 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3800 | countingStream->rewind(); |
| 3801 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3802 | uint64_t cgen_var_263; |
| 3803 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_263, 1); |
| 3804 | countingStream->write((uint64_t*)&cgen_var_263, 1 * 8); |
| 3805 | uint64_t cgen_var_264; |
| 3806 | countingStream->handleMapping()->mapHandles_VkBufferView_u64(&local_bufferView, &cgen_var_264, 1); |
| 3807 | countingStream->write((uint64_t*)&cgen_var_264, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3808 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3809 | uint64_t cgen_var_265 = (uint64_t)(uintptr_t)local_pAllocator; |
| 3810 | countingStream->putBe64(cgen_var_265); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3811 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3812 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3813 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3814 | } |
| 3815 | } |
| 3816 | uint32_t packetSize_vkDestroyBufferView = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 3817 | countingStream->rewind(); |
| 3818 | uint32_t opcode_vkDestroyBufferView = OP_vkDestroyBufferView; |
| 3819 | stream->write(&opcode_vkDestroyBufferView, sizeof(uint32_t)); |
| 3820 | stream->write(&packetSize_vkDestroyBufferView, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3821 | uint64_t cgen_var_266; |
| 3822 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_266, 1); |
| 3823 | stream->write((uint64_t*)&cgen_var_266, 1 * 8); |
| 3824 | uint64_t cgen_var_267; |
| 3825 | stream->handleMapping()->mapHandles_VkBufferView_u64(&local_bufferView, &cgen_var_267, 1); |
| 3826 | stream->write((uint64_t*)&cgen_var_267, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3827 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3828 | uint64_t cgen_var_268 = (uint64_t)(uintptr_t)local_pAllocator; |
| 3829 | stream->putBe64(cgen_var_268); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3830 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3831 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3832 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3833 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3834 | resources->destroyMapping()->mapHandles_VkBufferView((VkBufferView*)&bufferView); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 3835 | pool->freeAll(); |
| 3836 | countingStream->clearPool(); |
| 3837 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3838 | mImpl->log("finish vkDestroyBufferView");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3839 | } |
| 3840 | |
| 3841 | VkResult VkEncoder::vkCreateImage( |
| 3842 | VkDevice device, |
| 3843 | const VkImageCreateInfo* pCreateInfo, |
| 3844 | const VkAllocationCallbacks* pAllocator, |
| 3845 | VkImage* pImage) |
| 3846 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 3847 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3848 | mImpl->log("start vkCreateImage"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3849 | auto stream = mImpl->stream(); |
| 3850 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3851 | auto resources = mImpl->resources(); |
| 3852 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3853 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3854 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3855 | VkImageCreateInfo* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 3856 | VkAllocationCallbacks* local_pAllocator; |
| 3857 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3858 | local_pCreateInfo = nullptr; |
| 3859 | if (pCreateInfo) |
| 3860 | { |
| 3861 | local_pCreateInfo = (VkImageCreateInfo*)pool->alloc(sizeof(const VkImageCreateInfo)); |
| 3862 | deepcopy_VkImageCreateInfo(pool, pCreateInfo, (VkImageCreateInfo*)(local_pCreateInfo)); |
| 3863 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3864 | local_pAllocator = nullptr; |
| 3865 | if (pAllocator) |
| 3866 | { |
| 3867 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 3868 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 3869 | } |
| Lingfeng Yang | def88ba | 2018-12-13 12:43:17 -0800 | [diff] [blame] | 3870 | mImpl->resources()->unwrap_VkNativeBufferANDROID(pCreateInfo, local_pCreateInfo); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 3871 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 3872 | if (local_pCreateInfo) |
| 3873 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 3874 | transform_tohost_VkImageCreateInfo(mImpl->resources(), (VkImageCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 3875 | } |
| 3876 | if (local_pAllocator) |
| 3877 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 3878 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 3879 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3880 | countingStream->rewind(); |
| 3881 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3882 | uint64_t cgen_var_269; |
| 3883 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_269, 1); |
| 3884 | countingStream->write((uint64_t*)&cgen_var_269, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3885 | marshal_VkImageCreateInfo(countingStream, (VkImageCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3886 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3887 | uint64_t cgen_var_270 = (uint64_t)(uintptr_t)local_pAllocator; |
| 3888 | countingStream->putBe64(cgen_var_270); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3889 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3890 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3891 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3892 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3893 | uint64_t cgen_var_271; |
| 3894 | countingStream->handleMapping()->mapHandles_VkImage_u64(pImage, &cgen_var_271, 1); |
| 3895 | countingStream->write((uint64_t*)&cgen_var_271, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3896 | } |
| 3897 | uint32_t packetSize_vkCreateImage = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 3898 | countingStream->rewind(); |
| 3899 | uint32_t opcode_vkCreateImage = OP_vkCreateImage; |
| 3900 | stream->write(&opcode_vkCreateImage, sizeof(uint32_t)); |
| 3901 | stream->write(&packetSize_vkCreateImage, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3902 | uint64_t cgen_var_272; |
| 3903 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_272, 1); |
| 3904 | stream->write((uint64_t*)&cgen_var_272, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3905 | marshal_VkImageCreateInfo(stream, (VkImageCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3906 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3907 | uint64_t cgen_var_273 = (uint64_t)(uintptr_t)local_pAllocator; |
| 3908 | stream->putBe64(cgen_var_273); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3909 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3910 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3911 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3912 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3913 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3914 | uint64_t cgen_var_274; |
| 3915 | stream->handleMapping()->mapHandles_VkImage_u64(pImage, &cgen_var_274, 1); |
| 3916 | stream->write((uint64_t*)&cgen_var_274, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3917 | stream->setHandleMapping(resources->unwrapMapping()); |
| 3918 | stream->setHandleMapping(resources->createMapping()); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3919 | uint64_t cgen_var_275; |
| 3920 | stream->read((uint64_t*)&cgen_var_275, 8); |
| 3921 | stream->handleMapping()->mapHandles_u64_VkImage(&cgen_var_275, (VkImage*)pImage, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3922 | stream->unsetHandleMapping(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3923 | VkResult vkCreateImage_VkResult_return = (VkResult)0; |
| 3924 | stream->read(&vkCreateImage_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 3925 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 3926 | countingStream->clearPool(); |
| 3927 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3928 | mImpl->log("finish vkCreateImage");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3929 | return vkCreateImage_VkResult_return; |
| 3930 | } |
| 3931 | |
| 3932 | void VkEncoder::vkDestroyImage( |
| 3933 | VkDevice device, |
| 3934 | VkImage image, |
| 3935 | const VkAllocationCallbacks* pAllocator) |
| 3936 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 3937 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3938 | mImpl->log("start vkDestroyImage"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3939 | auto stream = mImpl->stream(); |
| 3940 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3941 | auto resources = mImpl->resources(); |
| 3942 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 3943 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3944 | VkDevice local_device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 3945 | VkImage local_image; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3946 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 3947 | local_device = device; |
| 3948 | local_image = image; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3949 | local_pAllocator = nullptr; |
| 3950 | if (pAllocator) |
| 3951 | { |
| 3952 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 3953 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 3954 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 3955 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 3956 | if (local_pAllocator) |
| 3957 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 3958 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 3959 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3960 | countingStream->rewind(); |
| 3961 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3962 | uint64_t cgen_var_276; |
| 3963 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_276, 1); |
| 3964 | countingStream->write((uint64_t*)&cgen_var_276, 1 * 8); |
| 3965 | uint64_t cgen_var_277; |
| 3966 | countingStream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_277, 1); |
| 3967 | countingStream->write((uint64_t*)&cgen_var_277, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3968 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3969 | uint64_t cgen_var_278 = (uint64_t)(uintptr_t)local_pAllocator; |
| 3970 | countingStream->putBe64(cgen_var_278); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3971 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3972 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3973 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3974 | } |
| 3975 | } |
| 3976 | uint32_t packetSize_vkDestroyImage = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 3977 | countingStream->rewind(); |
| 3978 | uint32_t opcode_vkDestroyImage = OP_vkDestroyImage; |
| 3979 | stream->write(&opcode_vkDestroyImage, sizeof(uint32_t)); |
| 3980 | stream->write(&packetSize_vkDestroyImage, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3981 | uint64_t cgen_var_279; |
| 3982 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_279, 1); |
| 3983 | stream->write((uint64_t*)&cgen_var_279, 1 * 8); |
| 3984 | uint64_t cgen_var_280; |
| 3985 | stream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_280, 1); |
| 3986 | stream->write((uint64_t*)&cgen_var_280, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 3987 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 3988 | uint64_t cgen_var_281 = (uint64_t)(uintptr_t)local_pAllocator; |
| 3989 | stream->putBe64(cgen_var_281); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3990 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3991 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3992 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3993 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 3994 | resources->destroyMapping()->mapHandles_VkImage((VkImage*)&image); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 3995 | pool->freeAll(); |
| 3996 | countingStream->clearPool(); |
| 3997 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 3998 | mImpl->log("finish vkDestroyImage");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 3999 | } |
| 4000 | |
| 4001 | void VkEncoder::vkGetImageSubresourceLayout( |
| 4002 | VkDevice device, |
| 4003 | VkImage image, |
| 4004 | const VkImageSubresource* pSubresource, |
| 4005 | VkSubresourceLayout* pLayout) |
| 4006 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 4007 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 4008 | mImpl->log("start vkGetImageSubresourceLayout"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4009 | auto stream = mImpl->stream(); |
| 4010 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4011 | auto resources = mImpl->resources(); |
| 4012 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4013 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4014 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4015 | VkImage local_image; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4016 | VkImageSubresource* local_pSubresource; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 4017 | local_device = device; |
| 4018 | local_image = image; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4019 | local_pSubresource = nullptr; |
| 4020 | if (pSubresource) |
| 4021 | { |
| 4022 | local_pSubresource = (VkImageSubresource*)pool->alloc(sizeof(const VkImageSubresource)); |
| 4023 | deepcopy_VkImageSubresource(pool, pSubresource, (VkImageSubresource*)(local_pSubresource)); |
| 4024 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 4025 | if (local_pSubresource) |
| 4026 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 4027 | transform_tohost_VkImageSubresource(mImpl->resources(), (VkImageSubresource*)(local_pSubresource)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 4028 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4029 | countingStream->rewind(); |
| 4030 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4031 | uint64_t cgen_var_282; |
| 4032 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_282, 1); |
| 4033 | countingStream->write((uint64_t*)&cgen_var_282, 1 * 8); |
| 4034 | uint64_t cgen_var_283; |
| 4035 | countingStream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_283, 1); |
| 4036 | countingStream->write((uint64_t*)&cgen_var_283, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4037 | marshal_VkImageSubresource(countingStream, (VkImageSubresource*)(local_pSubresource)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4038 | marshal_VkSubresourceLayout(countingStream, (VkSubresourceLayout*)(pLayout)); |
| 4039 | } |
| 4040 | uint32_t packetSize_vkGetImageSubresourceLayout = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 4041 | countingStream->rewind(); |
| 4042 | uint32_t opcode_vkGetImageSubresourceLayout = OP_vkGetImageSubresourceLayout; |
| 4043 | stream->write(&opcode_vkGetImageSubresourceLayout, sizeof(uint32_t)); |
| 4044 | stream->write(&packetSize_vkGetImageSubresourceLayout, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4045 | uint64_t cgen_var_284; |
| 4046 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_284, 1); |
| 4047 | stream->write((uint64_t*)&cgen_var_284, 1 * 8); |
| 4048 | uint64_t cgen_var_285; |
| 4049 | stream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_285, 1); |
| 4050 | stream->write((uint64_t*)&cgen_var_285, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4051 | marshal_VkImageSubresource(stream, (VkImageSubresource*)(local_pSubresource)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4052 | marshal_VkSubresourceLayout(stream, (VkSubresourceLayout*)(pLayout)); |
| 4053 | unmarshal_VkSubresourceLayout(stream, (VkSubresourceLayout*)(pLayout)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 4054 | if (pLayout) |
| 4055 | { |
| 4056 | transform_fromhost_VkSubresourceLayout(mImpl->resources(), (VkSubresourceLayout*)(pLayout)); |
| 4057 | } |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 4058 | pool->freeAll(); |
| 4059 | countingStream->clearPool(); |
| 4060 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 4061 | mImpl->log("finish vkGetImageSubresourceLayout");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4062 | } |
| 4063 | |
| 4064 | VkResult VkEncoder::vkCreateImageView( |
| 4065 | VkDevice device, |
| 4066 | const VkImageViewCreateInfo* pCreateInfo, |
| 4067 | const VkAllocationCallbacks* pAllocator, |
| 4068 | VkImageView* pView) |
| 4069 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 4070 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 4071 | mImpl->log("start vkCreateImageView"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4072 | auto stream = mImpl->stream(); |
| 4073 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4074 | auto resources = mImpl->resources(); |
| 4075 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4076 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4077 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4078 | VkImageViewCreateInfo* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 4079 | VkAllocationCallbacks* local_pAllocator; |
| 4080 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4081 | local_pCreateInfo = nullptr; |
| 4082 | if (pCreateInfo) |
| 4083 | { |
| 4084 | local_pCreateInfo = (VkImageViewCreateInfo*)pool->alloc(sizeof(const VkImageViewCreateInfo)); |
| 4085 | deepcopy_VkImageViewCreateInfo(pool, pCreateInfo, (VkImageViewCreateInfo*)(local_pCreateInfo)); |
| 4086 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4087 | local_pAllocator = nullptr; |
| 4088 | if (pAllocator) |
| 4089 | { |
| 4090 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 4091 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 4092 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 4093 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 4094 | if (local_pCreateInfo) |
| 4095 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 4096 | transform_tohost_VkImageViewCreateInfo(mImpl->resources(), (VkImageViewCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 4097 | } |
| 4098 | if (local_pAllocator) |
| 4099 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 4100 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 4101 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4102 | countingStream->rewind(); |
| 4103 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4104 | uint64_t cgen_var_286; |
| 4105 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_286, 1); |
| 4106 | countingStream->write((uint64_t*)&cgen_var_286, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4107 | marshal_VkImageViewCreateInfo(countingStream, (VkImageViewCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4108 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4109 | uint64_t cgen_var_287 = (uint64_t)(uintptr_t)local_pAllocator; |
| 4110 | countingStream->putBe64(cgen_var_287); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4111 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4112 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4113 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4114 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4115 | uint64_t cgen_var_288; |
| 4116 | countingStream->handleMapping()->mapHandles_VkImageView_u64(pView, &cgen_var_288, 1); |
| 4117 | countingStream->write((uint64_t*)&cgen_var_288, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4118 | } |
| 4119 | uint32_t packetSize_vkCreateImageView = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 4120 | countingStream->rewind(); |
| 4121 | uint32_t opcode_vkCreateImageView = OP_vkCreateImageView; |
| 4122 | stream->write(&opcode_vkCreateImageView, sizeof(uint32_t)); |
| 4123 | stream->write(&packetSize_vkCreateImageView, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4124 | uint64_t cgen_var_289; |
| 4125 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_289, 1); |
| 4126 | stream->write((uint64_t*)&cgen_var_289, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4127 | marshal_VkImageViewCreateInfo(stream, (VkImageViewCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4128 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4129 | uint64_t cgen_var_290 = (uint64_t)(uintptr_t)local_pAllocator; |
| 4130 | stream->putBe64(cgen_var_290); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4131 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4132 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4133 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4134 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4135 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4136 | uint64_t cgen_var_291; |
| 4137 | stream->handleMapping()->mapHandles_VkImageView_u64(pView, &cgen_var_291, 1); |
| 4138 | stream->write((uint64_t*)&cgen_var_291, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4139 | stream->setHandleMapping(resources->unwrapMapping()); |
| 4140 | stream->setHandleMapping(resources->createMapping()); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4141 | uint64_t cgen_var_292; |
| 4142 | stream->read((uint64_t*)&cgen_var_292, 8); |
| 4143 | stream->handleMapping()->mapHandles_u64_VkImageView(&cgen_var_292, (VkImageView*)pView, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4144 | stream->unsetHandleMapping(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4145 | VkResult vkCreateImageView_VkResult_return = (VkResult)0; |
| 4146 | stream->read(&vkCreateImageView_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 4147 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4148 | countingStream->clearPool(); |
| 4149 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 4150 | mImpl->log("finish vkCreateImageView");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4151 | return vkCreateImageView_VkResult_return; |
| 4152 | } |
| 4153 | |
| 4154 | void VkEncoder::vkDestroyImageView( |
| 4155 | VkDevice device, |
| 4156 | VkImageView imageView, |
| 4157 | const VkAllocationCallbacks* pAllocator) |
| 4158 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 4159 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 4160 | mImpl->log("start vkDestroyImageView"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4161 | auto stream = mImpl->stream(); |
| 4162 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4163 | auto resources = mImpl->resources(); |
| 4164 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4165 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4166 | VkDevice local_device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 4167 | VkImageView local_imageView; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4168 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 4169 | local_device = device; |
| 4170 | local_imageView = imageView; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4171 | local_pAllocator = nullptr; |
| 4172 | if (pAllocator) |
| 4173 | { |
| 4174 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 4175 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 4176 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 4177 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 4178 | if (local_pAllocator) |
| 4179 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 4180 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 4181 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4182 | countingStream->rewind(); |
| 4183 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4184 | uint64_t cgen_var_293; |
| 4185 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_293, 1); |
| 4186 | countingStream->write((uint64_t*)&cgen_var_293, 1 * 8); |
| 4187 | uint64_t cgen_var_294; |
| 4188 | countingStream->handleMapping()->mapHandles_VkImageView_u64(&local_imageView, &cgen_var_294, 1); |
| 4189 | countingStream->write((uint64_t*)&cgen_var_294, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4190 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4191 | uint64_t cgen_var_295 = (uint64_t)(uintptr_t)local_pAllocator; |
| 4192 | countingStream->putBe64(cgen_var_295); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4193 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4194 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4195 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4196 | } |
| 4197 | } |
| 4198 | uint32_t packetSize_vkDestroyImageView = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 4199 | countingStream->rewind(); |
| 4200 | uint32_t opcode_vkDestroyImageView = OP_vkDestroyImageView; |
| 4201 | stream->write(&opcode_vkDestroyImageView, sizeof(uint32_t)); |
| 4202 | stream->write(&packetSize_vkDestroyImageView, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4203 | uint64_t cgen_var_296; |
| 4204 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_296, 1); |
| 4205 | stream->write((uint64_t*)&cgen_var_296, 1 * 8); |
| 4206 | uint64_t cgen_var_297; |
| 4207 | stream->handleMapping()->mapHandles_VkImageView_u64(&local_imageView, &cgen_var_297, 1); |
| 4208 | stream->write((uint64_t*)&cgen_var_297, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4209 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4210 | uint64_t cgen_var_298 = (uint64_t)(uintptr_t)local_pAllocator; |
| 4211 | stream->putBe64(cgen_var_298); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4212 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4213 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4214 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4215 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4216 | resources->destroyMapping()->mapHandles_VkImageView((VkImageView*)&imageView); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 4217 | pool->freeAll(); |
| 4218 | countingStream->clearPool(); |
| 4219 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 4220 | mImpl->log("finish vkDestroyImageView");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4221 | } |
| 4222 | |
| 4223 | VkResult VkEncoder::vkCreateShaderModule( |
| 4224 | VkDevice device, |
| 4225 | const VkShaderModuleCreateInfo* pCreateInfo, |
| 4226 | const VkAllocationCallbacks* pAllocator, |
| 4227 | VkShaderModule* pShaderModule) |
| 4228 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 4229 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 4230 | mImpl->log("start vkCreateShaderModule"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4231 | auto stream = mImpl->stream(); |
| 4232 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4233 | auto resources = mImpl->resources(); |
| 4234 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4235 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4236 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4237 | VkShaderModuleCreateInfo* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 4238 | VkAllocationCallbacks* local_pAllocator; |
| 4239 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4240 | local_pCreateInfo = nullptr; |
| 4241 | if (pCreateInfo) |
| 4242 | { |
| 4243 | local_pCreateInfo = (VkShaderModuleCreateInfo*)pool->alloc(sizeof(const VkShaderModuleCreateInfo)); |
| 4244 | deepcopy_VkShaderModuleCreateInfo(pool, pCreateInfo, (VkShaderModuleCreateInfo*)(local_pCreateInfo)); |
| 4245 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4246 | local_pAllocator = nullptr; |
| 4247 | if (pAllocator) |
| 4248 | { |
| 4249 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 4250 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 4251 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 4252 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 4253 | if (local_pCreateInfo) |
| 4254 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 4255 | transform_tohost_VkShaderModuleCreateInfo(mImpl->resources(), (VkShaderModuleCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 4256 | } |
| 4257 | if (local_pAllocator) |
| 4258 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 4259 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 4260 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4261 | countingStream->rewind(); |
| 4262 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4263 | uint64_t cgen_var_299; |
| 4264 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_299, 1); |
| 4265 | countingStream->write((uint64_t*)&cgen_var_299, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4266 | marshal_VkShaderModuleCreateInfo(countingStream, (VkShaderModuleCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4267 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4268 | uint64_t cgen_var_300 = (uint64_t)(uintptr_t)local_pAllocator; |
| 4269 | countingStream->putBe64(cgen_var_300); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4270 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4271 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4272 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4273 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4274 | uint64_t cgen_var_301; |
| 4275 | countingStream->handleMapping()->mapHandles_VkShaderModule_u64(pShaderModule, &cgen_var_301, 1); |
| 4276 | countingStream->write((uint64_t*)&cgen_var_301, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4277 | } |
| 4278 | uint32_t packetSize_vkCreateShaderModule = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 4279 | countingStream->rewind(); |
| 4280 | uint32_t opcode_vkCreateShaderModule = OP_vkCreateShaderModule; |
| 4281 | stream->write(&opcode_vkCreateShaderModule, sizeof(uint32_t)); |
| 4282 | stream->write(&packetSize_vkCreateShaderModule, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4283 | uint64_t cgen_var_302; |
| 4284 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_302, 1); |
| 4285 | stream->write((uint64_t*)&cgen_var_302, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4286 | marshal_VkShaderModuleCreateInfo(stream, (VkShaderModuleCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4287 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4288 | uint64_t cgen_var_303 = (uint64_t)(uintptr_t)local_pAllocator; |
| 4289 | stream->putBe64(cgen_var_303); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4290 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4291 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4292 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4293 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4294 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4295 | uint64_t cgen_var_304; |
| 4296 | stream->handleMapping()->mapHandles_VkShaderModule_u64(pShaderModule, &cgen_var_304, 1); |
| 4297 | stream->write((uint64_t*)&cgen_var_304, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4298 | stream->setHandleMapping(resources->unwrapMapping()); |
| 4299 | stream->setHandleMapping(resources->createMapping()); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4300 | uint64_t cgen_var_305; |
| 4301 | stream->read((uint64_t*)&cgen_var_305, 8); |
| 4302 | stream->handleMapping()->mapHandles_u64_VkShaderModule(&cgen_var_305, (VkShaderModule*)pShaderModule, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4303 | stream->unsetHandleMapping(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4304 | VkResult vkCreateShaderModule_VkResult_return = (VkResult)0; |
| 4305 | stream->read(&vkCreateShaderModule_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 4306 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4307 | countingStream->clearPool(); |
| 4308 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 4309 | mImpl->log("finish vkCreateShaderModule");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4310 | return vkCreateShaderModule_VkResult_return; |
| 4311 | } |
| 4312 | |
| 4313 | void VkEncoder::vkDestroyShaderModule( |
| 4314 | VkDevice device, |
| 4315 | VkShaderModule shaderModule, |
| 4316 | const VkAllocationCallbacks* pAllocator) |
| 4317 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 4318 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 4319 | mImpl->log("start vkDestroyShaderModule"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4320 | auto stream = mImpl->stream(); |
| 4321 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4322 | auto resources = mImpl->resources(); |
| 4323 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4324 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4325 | VkDevice local_device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 4326 | VkShaderModule local_shaderModule; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4327 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 4328 | local_device = device; |
| 4329 | local_shaderModule = shaderModule; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4330 | local_pAllocator = nullptr; |
| 4331 | if (pAllocator) |
| 4332 | { |
| 4333 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 4334 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 4335 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 4336 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 4337 | if (local_pAllocator) |
| 4338 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 4339 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 4340 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4341 | countingStream->rewind(); |
| 4342 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4343 | uint64_t cgen_var_306; |
| 4344 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_306, 1); |
| 4345 | countingStream->write((uint64_t*)&cgen_var_306, 1 * 8); |
| 4346 | uint64_t cgen_var_307; |
| 4347 | countingStream->handleMapping()->mapHandles_VkShaderModule_u64(&local_shaderModule, &cgen_var_307, 1); |
| 4348 | countingStream->write((uint64_t*)&cgen_var_307, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4349 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4350 | uint64_t cgen_var_308 = (uint64_t)(uintptr_t)local_pAllocator; |
| 4351 | countingStream->putBe64(cgen_var_308); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4352 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4353 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4354 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4355 | } |
| 4356 | } |
| 4357 | uint32_t packetSize_vkDestroyShaderModule = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 4358 | countingStream->rewind(); |
| 4359 | uint32_t opcode_vkDestroyShaderModule = OP_vkDestroyShaderModule; |
| 4360 | stream->write(&opcode_vkDestroyShaderModule, sizeof(uint32_t)); |
| 4361 | stream->write(&packetSize_vkDestroyShaderModule, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4362 | uint64_t cgen_var_309; |
| 4363 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_309, 1); |
| 4364 | stream->write((uint64_t*)&cgen_var_309, 1 * 8); |
| 4365 | uint64_t cgen_var_310; |
| 4366 | stream->handleMapping()->mapHandles_VkShaderModule_u64(&local_shaderModule, &cgen_var_310, 1); |
| 4367 | stream->write((uint64_t*)&cgen_var_310, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4368 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4369 | uint64_t cgen_var_311 = (uint64_t)(uintptr_t)local_pAllocator; |
| 4370 | stream->putBe64(cgen_var_311); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4371 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4372 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4373 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(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 | resources->destroyMapping()->mapHandles_VkShaderModule((VkShaderModule*)&shaderModule); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 4376 | pool->freeAll(); |
| 4377 | countingStream->clearPool(); |
| 4378 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 4379 | mImpl->log("finish vkDestroyShaderModule");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4380 | } |
| 4381 | |
| 4382 | VkResult VkEncoder::vkCreatePipelineCache( |
| 4383 | VkDevice device, |
| 4384 | const VkPipelineCacheCreateInfo* pCreateInfo, |
| 4385 | const VkAllocationCallbacks* pAllocator, |
| 4386 | VkPipelineCache* pPipelineCache) |
| 4387 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 4388 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 4389 | mImpl->log("start vkCreatePipelineCache"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4390 | auto stream = mImpl->stream(); |
| 4391 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4392 | auto resources = mImpl->resources(); |
| 4393 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4394 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4395 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4396 | VkPipelineCacheCreateInfo* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 4397 | VkAllocationCallbacks* local_pAllocator; |
| 4398 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4399 | local_pCreateInfo = nullptr; |
| 4400 | if (pCreateInfo) |
| 4401 | { |
| 4402 | local_pCreateInfo = (VkPipelineCacheCreateInfo*)pool->alloc(sizeof(const VkPipelineCacheCreateInfo)); |
| 4403 | deepcopy_VkPipelineCacheCreateInfo(pool, pCreateInfo, (VkPipelineCacheCreateInfo*)(local_pCreateInfo)); |
| 4404 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4405 | local_pAllocator = nullptr; |
| 4406 | if (pAllocator) |
| 4407 | { |
| 4408 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 4409 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 4410 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 4411 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 4412 | if (local_pCreateInfo) |
| 4413 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 4414 | transform_tohost_VkPipelineCacheCreateInfo(mImpl->resources(), (VkPipelineCacheCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 4415 | } |
| 4416 | if (local_pAllocator) |
| 4417 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 4418 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 4419 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4420 | countingStream->rewind(); |
| 4421 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4422 | uint64_t cgen_var_312; |
| 4423 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_312, 1); |
| 4424 | countingStream->write((uint64_t*)&cgen_var_312, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4425 | marshal_VkPipelineCacheCreateInfo(countingStream, (VkPipelineCacheCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4426 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4427 | uint64_t cgen_var_313 = (uint64_t)(uintptr_t)local_pAllocator; |
| 4428 | countingStream->putBe64(cgen_var_313); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4429 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4430 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4431 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4432 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4433 | uint64_t cgen_var_314; |
| 4434 | countingStream->handleMapping()->mapHandles_VkPipelineCache_u64(pPipelineCache, &cgen_var_314, 1); |
| 4435 | countingStream->write((uint64_t*)&cgen_var_314, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4436 | } |
| 4437 | uint32_t packetSize_vkCreatePipelineCache = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 4438 | countingStream->rewind(); |
| 4439 | uint32_t opcode_vkCreatePipelineCache = OP_vkCreatePipelineCache; |
| 4440 | stream->write(&opcode_vkCreatePipelineCache, sizeof(uint32_t)); |
| 4441 | stream->write(&packetSize_vkCreatePipelineCache, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4442 | uint64_t cgen_var_315; |
| 4443 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_315, 1); |
| 4444 | stream->write((uint64_t*)&cgen_var_315, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4445 | marshal_VkPipelineCacheCreateInfo(stream, (VkPipelineCacheCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4446 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4447 | uint64_t cgen_var_316 = (uint64_t)(uintptr_t)local_pAllocator; |
| 4448 | stream->putBe64(cgen_var_316); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4449 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4450 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4451 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4452 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4453 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4454 | uint64_t cgen_var_317; |
| 4455 | stream->handleMapping()->mapHandles_VkPipelineCache_u64(pPipelineCache, &cgen_var_317, 1); |
| 4456 | stream->write((uint64_t*)&cgen_var_317, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4457 | stream->setHandleMapping(resources->unwrapMapping()); |
| 4458 | stream->setHandleMapping(resources->createMapping()); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4459 | uint64_t cgen_var_318; |
| 4460 | stream->read((uint64_t*)&cgen_var_318, 8); |
| 4461 | stream->handleMapping()->mapHandles_u64_VkPipelineCache(&cgen_var_318, (VkPipelineCache*)pPipelineCache, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4462 | stream->unsetHandleMapping(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4463 | VkResult vkCreatePipelineCache_VkResult_return = (VkResult)0; |
| 4464 | stream->read(&vkCreatePipelineCache_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 4465 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4466 | countingStream->clearPool(); |
| 4467 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 4468 | mImpl->log("finish vkCreatePipelineCache");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4469 | return vkCreatePipelineCache_VkResult_return; |
| 4470 | } |
| 4471 | |
| 4472 | void VkEncoder::vkDestroyPipelineCache( |
| 4473 | VkDevice device, |
| 4474 | VkPipelineCache pipelineCache, |
| 4475 | const VkAllocationCallbacks* pAllocator) |
| 4476 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 4477 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 4478 | mImpl->log("start vkDestroyPipelineCache"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4479 | auto stream = mImpl->stream(); |
| 4480 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4481 | auto resources = mImpl->resources(); |
| 4482 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4483 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4484 | VkDevice local_device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 4485 | VkPipelineCache local_pipelineCache; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4486 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 4487 | local_device = device; |
| 4488 | local_pipelineCache = pipelineCache; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4489 | local_pAllocator = nullptr; |
| 4490 | if (pAllocator) |
| 4491 | { |
| 4492 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 4493 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 4494 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 4495 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 4496 | if (local_pAllocator) |
| 4497 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 4498 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 4499 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4500 | countingStream->rewind(); |
| 4501 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4502 | uint64_t cgen_var_319; |
| 4503 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_319, 1); |
| 4504 | countingStream->write((uint64_t*)&cgen_var_319, 1 * 8); |
| 4505 | uint64_t cgen_var_320; |
| 4506 | countingStream->handleMapping()->mapHandles_VkPipelineCache_u64(&local_pipelineCache, &cgen_var_320, 1); |
| 4507 | countingStream->write((uint64_t*)&cgen_var_320, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4508 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4509 | uint64_t cgen_var_321 = (uint64_t)(uintptr_t)local_pAllocator; |
| 4510 | countingStream->putBe64(cgen_var_321); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4511 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4512 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4513 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4514 | } |
| 4515 | } |
| 4516 | uint32_t packetSize_vkDestroyPipelineCache = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 4517 | countingStream->rewind(); |
| 4518 | uint32_t opcode_vkDestroyPipelineCache = OP_vkDestroyPipelineCache; |
| 4519 | stream->write(&opcode_vkDestroyPipelineCache, sizeof(uint32_t)); |
| 4520 | stream->write(&packetSize_vkDestroyPipelineCache, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4521 | uint64_t cgen_var_322; |
| 4522 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_322, 1); |
| 4523 | stream->write((uint64_t*)&cgen_var_322, 1 * 8); |
| 4524 | uint64_t cgen_var_323; |
| 4525 | stream->handleMapping()->mapHandles_VkPipelineCache_u64(&local_pipelineCache, &cgen_var_323, 1); |
| 4526 | stream->write((uint64_t*)&cgen_var_323, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4527 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4528 | uint64_t cgen_var_324 = (uint64_t)(uintptr_t)local_pAllocator; |
| 4529 | stream->putBe64(cgen_var_324); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4530 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4531 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4532 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4533 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4534 | resources->destroyMapping()->mapHandles_VkPipelineCache((VkPipelineCache*)&pipelineCache); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 4535 | pool->freeAll(); |
| 4536 | countingStream->clearPool(); |
| 4537 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 4538 | mImpl->log("finish vkDestroyPipelineCache");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4539 | } |
| 4540 | |
| 4541 | VkResult VkEncoder::vkGetPipelineCacheData( |
| 4542 | VkDevice device, |
| 4543 | VkPipelineCache pipelineCache, |
| 4544 | size_t* pDataSize, |
| 4545 | void* pData) |
| 4546 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 4547 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 4548 | mImpl->log("start vkGetPipelineCacheData"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4549 | auto stream = mImpl->stream(); |
| 4550 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4551 | auto resources = mImpl->resources(); |
| 4552 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4553 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4554 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4555 | VkPipelineCache local_pipelineCache; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 4556 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4557 | local_pipelineCache = pipelineCache; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4558 | countingStream->rewind(); |
| 4559 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4560 | uint64_t cgen_var_325; |
| 4561 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_325, 1); |
| 4562 | countingStream->write((uint64_t*)&cgen_var_325, 1 * 8); |
| 4563 | uint64_t cgen_var_326; |
| 4564 | countingStream->handleMapping()->mapHandles_VkPipelineCache_u64(&local_pipelineCache, &cgen_var_326, 1); |
| 4565 | countingStream->write((uint64_t*)&cgen_var_326, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4566 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4567 | uint64_t cgen_var_327 = (uint64_t)(uintptr_t)pDataSize; |
| 4568 | countingStream->putBe64(cgen_var_327); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4569 | if (pDataSize) |
| 4570 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4571 | uint64_t cgen_var_328 = (uint64_t)(*pDataSize); |
| 4572 | countingStream->putBe64(cgen_var_328); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4573 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4574 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4575 | uint64_t cgen_var_329 = (uint64_t)(uintptr_t)pData; |
| 4576 | countingStream->putBe64(cgen_var_329); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4577 | if (pData) |
| 4578 | { |
| 4579 | countingStream->write((void*)pData, (*(pDataSize)) * sizeof(uint8_t)); |
| 4580 | } |
| 4581 | } |
| 4582 | uint32_t packetSize_vkGetPipelineCacheData = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 4583 | countingStream->rewind(); |
| 4584 | uint32_t opcode_vkGetPipelineCacheData = OP_vkGetPipelineCacheData; |
| 4585 | stream->write(&opcode_vkGetPipelineCacheData, sizeof(uint32_t)); |
| 4586 | stream->write(&packetSize_vkGetPipelineCacheData, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4587 | uint64_t cgen_var_330; |
| 4588 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_330, 1); |
| 4589 | stream->write((uint64_t*)&cgen_var_330, 1 * 8); |
| 4590 | uint64_t cgen_var_331; |
| 4591 | stream->handleMapping()->mapHandles_VkPipelineCache_u64(&local_pipelineCache, &cgen_var_331, 1); |
| 4592 | stream->write((uint64_t*)&cgen_var_331, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4593 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4594 | uint64_t cgen_var_332 = (uint64_t)(uintptr_t)pDataSize; |
| 4595 | stream->putBe64(cgen_var_332); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4596 | if (pDataSize) |
| 4597 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4598 | uint64_t cgen_var_333 = (uint64_t)(*pDataSize); |
| 4599 | stream->putBe64(cgen_var_333); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4600 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4601 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4602 | uint64_t cgen_var_334 = (uint64_t)(uintptr_t)pData; |
| 4603 | stream->putBe64(cgen_var_334); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4604 | if (pData) |
| 4605 | { |
| 4606 | stream->write((void*)pData, (*(pDataSize)) * sizeof(uint8_t)); |
| 4607 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4608 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4609 | size_t* check_pDataSize; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4610 | check_pDataSize = (size_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4611 | if (pDataSize) |
| 4612 | { |
| 4613 | if (!(check_pDataSize)) |
| 4614 | { |
| 4615 | fprintf(stderr, "fatal: pDataSize inconsistent between guest and host\n"); |
| 4616 | } |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 4617 | (*pDataSize) = (size_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4618 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4619 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4620 | void* check_pData; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4621 | check_pData = (void*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4622 | if (pData) |
| 4623 | { |
| 4624 | if (!(check_pData)) |
| 4625 | { |
| 4626 | fprintf(stderr, "fatal: pData inconsistent between guest and host\n"); |
| 4627 | } |
| 4628 | stream->read((void*)pData, (*(pDataSize)) * sizeof(uint8_t)); |
| 4629 | } |
| 4630 | VkResult vkGetPipelineCacheData_VkResult_return = (VkResult)0; |
| 4631 | stream->read(&vkGetPipelineCacheData_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 4632 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4633 | countingStream->clearPool(); |
| 4634 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 4635 | mImpl->log("finish vkGetPipelineCacheData");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4636 | return vkGetPipelineCacheData_VkResult_return; |
| 4637 | } |
| 4638 | |
| 4639 | VkResult VkEncoder::vkMergePipelineCaches( |
| 4640 | VkDevice device, |
| 4641 | VkPipelineCache dstCache, |
| 4642 | uint32_t srcCacheCount, |
| 4643 | const VkPipelineCache* pSrcCaches) |
| 4644 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 4645 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 4646 | mImpl->log("start vkMergePipelineCaches"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4647 | auto stream = mImpl->stream(); |
| 4648 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4649 | auto resources = mImpl->resources(); |
| 4650 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4651 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4652 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4653 | VkPipelineCache local_dstCache; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4654 | uint32_t local_srcCacheCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4655 | VkPipelineCache* local_pSrcCaches; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 4656 | local_device = device; |
| 4657 | local_dstCache = dstCache; |
| 4658 | local_srcCacheCount = srcCacheCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4659 | local_pSrcCaches = nullptr; |
| 4660 | if (pSrcCaches) |
| 4661 | { |
| 4662 | local_pSrcCaches = (VkPipelineCache*)pool->dupArray(pSrcCaches, ((srcCacheCount)) * sizeof(const VkPipelineCache)); |
| 4663 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4664 | countingStream->rewind(); |
| 4665 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4666 | uint64_t cgen_var_338; |
| 4667 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_338, 1); |
| 4668 | countingStream->write((uint64_t*)&cgen_var_338, 1 * 8); |
| 4669 | uint64_t cgen_var_339; |
| 4670 | countingStream->handleMapping()->mapHandles_VkPipelineCache_u64(&local_dstCache, &cgen_var_339, 1); |
| 4671 | countingStream->write((uint64_t*)&cgen_var_339, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4672 | countingStream->write((uint32_t*)&local_srcCacheCount, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4673 | if (((srcCacheCount))) |
| 4674 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4675 | uint64_t* cgen_var_340; |
| 4676 | countingStream->alloc((void**)&cgen_var_340, ((srcCacheCount)) * 8); |
| 4677 | countingStream->handleMapping()->mapHandles_VkPipelineCache_u64(local_pSrcCaches, cgen_var_340, ((srcCacheCount))); |
| 4678 | countingStream->write((uint64_t*)cgen_var_340, ((srcCacheCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4679 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4680 | } |
| 4681 | uint32_t packetSize_vkMergePipelineCaches = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 4682 | countingStream->rewind(); |
| 4683 | uint32_t opcode_vkMergePipelineCaches = OP_vkMergePipelineCaches; |
| 4684 | stream->write(&opcode_vkMergePipelineCaches, sizeof(uint32_t)); |
| 4685 | stream->write(&packetSize_vkMergePipelineCaches, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4686 | uint64_t cgen_var_341; |
| 4687 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_341, 1); |
| 4688 | stream->write((uint64_t*)&cgen_var_341, 1 * 8); |
| 4689 | uint64_t cgen_var_342; |
| 4690 | stream->handleMapping()->mapHandles_VkPipelineCache_u64(&local_dstCache, &cgen_var_342, 1); |
| 4691 | stream->write((uint64_t*)&cgen_var_342, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4692 | stream->write((uint32_t*)&local_srcCacheCount, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4693 | if (((srcCacheCount))) |
| 4694 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4695 | uint64_t* cgen_var_343; |
| 4696 | stream->alloc((void**)&cgen_var_343, ((srcCacheCount)) * 8); |
| 4697 | stream->handleMapping()->mapHandles_VkPipelineCache_u64(local_pSrcCaches, cgen_var_343, ((srcCacheCount))); |
| 4698 | stream->write((uint64_t*)cgen_var_343, ((srcCacheCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4699 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4700 | VkResult vkMergePipelineCaches_VkResult_return = (VkResult)0; |
| 4701 | stream->read(&vkMergePipelineCaches_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 4702 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4703 | countingStream->clearPool(); |
| 4704 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 4705 | mImpl->log("finish vkMergePipelineCaches");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4706 | return vkMergePipelineCaches_VkResult_return; |
| 4707 | } |
| 4708 | |
| 4709 | VkResult VkEncoder::vkCreateGraphicsPipelines( |
| 4710 | VkDevice device, |
| 4711 | VkPipelineCache pipelineCache, |
| 4712 | uint32_t createInfoCount, |
| 4713 | const VkGraphicsPipelineCreateInfo* pCreateInfos, |
| 4714 | const VkAllocationCallbacks* pAllocator, |
| 4715 | VkPipeline* pPipelines) |
| 4716 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 4717 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 4718 | mImpl->log("start vkCreateGraphicsPipelines"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4719 | auto stream = mImpl->stream(); |
| 4720 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4721 | auto resources = mImpl->resources(); |
| 4722 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4723 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4724 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4725 | VkPipelineCache local_pipelineCache; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4726 | uint32_t local_createInfoCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4727 | VkGraphicsPipelineCreateInfo* local_pCreateInfos; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 4728 | VkAllocationCallbacks* local_pAllocator; |
| 4729 | local_device = device; |
| 4730 | local_pipelineCache = pipelineCache; |
| 4731 | local_createInfoCount = createInfoCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4732 | local_pCreateInfos = nullptr; |
| 4733 | if (pCreateInfos) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4734 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4735 | local_pCreateInfos = (VkGraphicsPipelineCreateInfo*)pool->alloc(((createInfoCount)) * sizeof(const VkGraphicsPipelineCreateInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4736 | for (uint32_t i = 0; i < (uint32_t)((createInfoCount)); ++i) |
| 4737 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4738 | deepcopy_VkGraphicsPipelineCreateInfo(pool, pCreateInfos + i, (VkGraphicsPipelineCreateInfo*)(local_pCreateInfos + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4739 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4740 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4741 | local_pAllocator = nullptr; |
| 4742 | if (pAllocator) |
| 4743 | { |
| 4744 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 4745 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 4746 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 4747 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 4748 | if (local_pCreateInfos) |
| 4749 | { |
| 4750 | for (uint32_t i = 0; i < (uint32_t)((createInfoCount)); ++i) |
| 4751 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 4752 | transform_tohost_VkGraphicsPipelineCreateInfo(mImpl->resources(), (VkGraphicsPipelineCreateInfo*)(local_pCreateInfos + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 4753 | } |
| 4754 | } |
| 4755 | if (local_pAllocator) |
| 4756 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 4757 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 4758 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4759 | countingStream->rewind(); |
| 4760 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4761 | uint64_t cgen_var_344; |
| 4762 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_344, 1); |
| 4763 | countingStream->write((uint64_t*)&cgen_var_344, 1 * 8); |
| 4764 | uint64_t cgen_var_345; |
| 4765 | countingStream->handleMapping()->mapHandles_VkPipelineCache_u64(&local_pipelineCache, &cgen_var_345, 1); |
| 4766 | countingStream->write((uint64_t*)&cgen_var_345, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4767 | countingStream->write((uint32_t*)&local_createInfoCount, sizeof(uint32_t)); |
| 4768 | for (uint32_t i = 0; i < (uint32_t)((createInfoCount)); ++i) |
| 4769 | { |
| 4770 | marshal_VkGraphicsPipelineCreateInfo(countingStream, (VkGraphicsPipelineCreateInfo*)(local_pCreateInfos + i)); |
| 4771 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4772 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4773 | uint64_t cgen_var_346 = (uint64_t)(uintptr_t)local_pAllocator; |
| 4774 | countingStream->putBe64(cgen_var_346); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4775 | if (local_pAllocator) |
| 4776 | { |
| 4777 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4778 | } |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4779 | if (((createInfoCount))) |
| 4780 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4781 | uint64_t* cgen_var_347; |
| 4782 | countingStream->alloc((void**)&cgen_var_347, ((createInfoCount)) * 8); |
| 4783 | countingStream->handleMapping()->mapHandles_VkPipeline_u64(pPipelines, cgen_var_347, ((createInfoCount))); |
| 4784 | countingStream->write((uint64_t*)cgen_var_347, ((createInfoCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4785 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4786 | } |
| 4787 | uint32_t packetSize_vkCreateGraphicsPipelines = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 4788 | countingStream->rewind(); |
| 4789 | uint32_t opcode_vkCreateGraphicsPipelines = OP_vkCreateGraphicsPipelines; |
| 4790 | stream->write(&opcode_vkCreateGraphicsPipelines, sizeof(uint32_t)); |
| 4791 | stream->write(&packetSize_vkCreateGraphicsPipelines, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4792 | uint64_t cgen_var_348; |
| 4793 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_348, 1); |
| 4794 | stream->write((uint64_t*)&cgen_var_348, 1 * 8); |
| 4795 | uint64_t cgen_var_349; |
| 4796 | stream->handleMapping()->mapHandles_VkPipelineCache_u64(&local_pipelineCache, &cgen_var_349, 1); |
| 4797 | stream->write((uint64_t*)&cgen_var_349, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4798 | stream->write((uint32_t*)&local_createInfoCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4799 | for (uint32_t i = 0; i < (uint32_t)((createInfoCount)); ++i) |
| 4800 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4801 | marshal_VkGraphicsPipelineCreateInfo(stream, (VkGraphicsPipelineCreateInfo*)(local_pCreateInfos + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4802 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4803 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4804 | uint64_t cgen_var_350 = (uint64_t)(uintptr_t)local_pAllocator; |
| 4805 | stream->putBe64(cgen_var_350); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4806 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4807 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4808 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4809 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4810 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4811 | if (((createInfoCount))) |
| 4812 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4813 | uint64_t* cgen_var_351; |
| 4814 | stream->alloc((void**)&cgen_var_351, ((createInfoCount)) * 8); |
| 4815 | stream->handleMapping()->mapHandles_VkPipeline_u64(pPipelines, cgen_var_351, ((createInfoCount))); |
| 4816 | stream->write((uint64_t*)cgen_var_351, ((createInfoCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4817 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4818 | stream->setHandleMapping(resources->unwrapMapping()); |
| 4819 | stream->setHandleMapping(resources->createMapping()); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4820 | if (((createInfoCount))) |
| 4821 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4822 | uint64_t* cgen_var_352; |
| 4823 | stream->alloc((void**)&cgen_var_352, ((createInfoCount)) * 8); |
| 4824 | stream->read((uint64_t*)cgen_var_352, ((createInfoCount)) * 8); |
| 4825 | stream->handleMapping()->mapHandles_u64_VkPipeline(cgen_var_352, (VkPipeline*)pPipelines, ((createInfoCount))); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4826 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4827 | stream->unsetHandleMapping(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4828 | VkResult vkCreateGraphicsPipelines_VkResult_return = (VkResult)0; |
| 4829 | stream->read(&vkCreateGraphicsPipelines_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 4830 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4831 | countingStream->clearPool(); |
| 4832 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 4833 | mImpl->log("finish vkCreateGraphicsPipelines");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4834 | return vkCreateGraphicsPipelines_VkResult_return; |
| 4835 | } |
| 4836 | |
| 4837 | VkResult VkEncoder::vkCreateComputePipelines( |
| 4838 | VkDevice device, |
| 4839 | VkPipelineCache pipelineCache, |
| 4840 | uint32_t createInfoCount, |
| 4841 | const VkComputePipelineCreateInfo* pCreateInfos, |
| 4842 | const VkAllocationCallbacks* pAllocator, |
| 4843 | VkPipeline* pPipelines) |
| 4844 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 4845 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 4846 | mImpl->log("start vkCreateComputePipelines"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4847 | auto stream = mImpl->stream(); |
| 4848 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4849 | auto resources = mImpl->resources(); |
| 4850 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4851 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4852 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4853 | VkPipelineCache local_pipelineCache; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4854 | uint32_t local_createInfoCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4855 | VkComputePipelineCreateInfo* local_pCreateInfos; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 4856 | VkAllocationCallbacks* local_pAllocator; |
| 4857 | local_device = device; |
| 4858 | local_pipelineCache = pipelineCache; |
| 4859 | local_createInfoCount = createInfoCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4860 | local_pCreateInfos = nullptr; |
| 4861 | if (pCreateInfos) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4862 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4863 | local_pCreateInfos = (VkComputePipelineCreateInfo*)pool->alloc(((createInfoCount)) * sizeof(const VkComputePipelineCreateInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4864 | for (uint32_t i = 0; i < (uint32_t)((createInfoCount)); ++i) |
| 4865 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4866 | deepcopy_VkComputePipelineCreateInfo(pool, pCreateInfos + i, (VkComputePipelineCreateInfo*)(local_pCreateInfos + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4867 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4868 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4869 | local_pAllocator = nullptr; |
| 4870 | if (pAllocator) |
| 4871 | { |
| 4872 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 4873 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 4874 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 4875 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 4876 | if (local_pCreateInfos) |
| 4877 | { |
| 4878 | for (uint32_t i = 0; i < (uint32_t)((createInfoCount)); ++i) |
| 4879 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 4880 | transform_tohost_VkComputePipelineCreateInfo(mImpl->resources(), (VkComputePipelineCreateInfo*)(local_pCreateInfos + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 4881 | } |
| 4882 | } |
| 4883 | if (local_pAllocator) |
| 4884 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 4885 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 4886 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4887 | countingStream->rewind(); |
| 4888 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4889 | uint64_t cgen_var_353; |
| 4890 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_353, 1); |
| 4891 | countingStream->write((uint64_t*)&cgen_var_353, 1 * 8); |
| 4892 | uint64_t cgen_var_354; |
| 4893 | countingStream->handleMapping()->mapHandles_VkPipelineCache_u64(&local_pipelineCache, &cgen_var_354, 1); |
| 4894 | countingStream->write((uint64_t*)&cgen_var_354, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4895 | countingStream->write((uint32_t*)&local_createInfoCount, sizeof(uint32_t)); |
| 4896 | for (uint32_t i = 0; i < (uint32_t)((createInfoCount)); ++i) |
| 4897 | { |
| 4898 | marshal_VkComputePipelineCreateInfo(countingStream, (VkComputePipelineCreateInfo*)(local_pCreateInfos + i)); |
| 4899 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4900 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4901 | uint64_t cgen_var_355 = (uint64_t)(uintptr_t)local_pAllocator; |
| 4902 | countingStream->putBe64(cgen_var_355); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4903 | if (local_pAllocator) |
| 4904 | { |
| 4905 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4906 | } |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4907 | if (((createInfoCount))) |
| 4908 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4909 | uint64_t* cgen_var_356; |
| 4910 | countingStream->alloc((void**)&cgen_var_356, ((createInfoCount)) * 8); |
| 4911 | countingStream->handleMapping()->mapHandles_VkPipeline_u64(pPipelines, cgen_var_356, ((createInfoCount))); |
| 4912 | countingStream->write((uint64_t*)cgen_var_356, ((createInfoCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4913 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4914 | } |
| 4915 | uint32_t packetSize_vkCreateComputePipelines = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 4916 | countingStream->rewind(); |
| 4917 | uint32_t opcode_vkCreateComputePipelines = OP_vkCreateComputePipelines; |
| 4918 | stream->write(&opcode_vkCreateComputePipelines, sizeof(uint32_t)); |
| 4919 | stream->write(&packetSize_vkCreateComputePipelines, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4920 | uint64_t cgen_var_357; |
| 4921 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_357, 1); |
| 4922 | stream->write((uint64_t*)&cgen_var_357, 1 * 8); |
| 4923 | uint64_t cgen_var_358; |
| 4924 | stream->handleMapping()->mapHandles_VkPipelineCache_u64(&local_pipelineCache, &cgen_var_358, 1); |
| 4925 | stream->write((uint64_t*)&cgen_var_358, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4926 | stream->write((uint32_t*)&local_createInfoCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4927 | for (uint32_t i = 0; i < (uint32_t)((createInfoCount)); ++i) |
| 4928 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4929 | marshal_VkComputePipelineCreateInfo(stream, (VkComputePipelineCreateInfo*)(local_pCreateInfos + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4930 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 4931 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4932 | uint64_t cgen_var_359 = (uint64_t)(uintptr_t)local_pAllocator; |
| 4933 | stream->putBe64(cgen_var_359); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4934 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4935 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4936 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4937 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4938 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4939 | if (((createInfoCount))) |
| 4940 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4941 | uint64_t* cgen_var_360; |
| 4942 | stream->alloc((void**)&cgen_var_360, ((createInfoCount)) * 8); |
| 4943 | stream->handleMapping()->mapHandles_VkPipeline_u64(pPipelines, cgen_var_360, ((createInfoCount))); |
| 4944 | stream->write((uint64_t*)cgen_var_360, ((createInfoCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4945 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4946 | stream->setHandleMapping(resources->unwrapMapping()); |
| 4947 | stream->setHandleMapping(resources->createMapping()); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4948 | if (((createInfoCount))) |
| 4949 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4950 | uint64_t* cgen_var_361; |
| 4951 | stream->alloc((void**)&cgen_var_361, ((createInfoCount)) * 8); |
| 4952 | stream->read((uint64_t*)cgen_var_361, ((createInfoCount)) * 8); |
| 4953 | stream->handleMapping()->mapHandles_u64_VkPipeline(cgen_var_361, (VkPipeline*)pPipelines, ((createInfoCount))); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4954 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4955 | stream->unsetHandleMapping(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4956 | VkResult vkCreateComputePipelines_VkResult_return = (VkResult)0; |
| 4957 | stream->read(&vkCreateComputePipelines_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 4958 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 4959 | countingStream->clearPool(); |
| 4960 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 4961 | mImpl->log("finish vkCreateComputePipelines");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4962 | return vkCreateComputePipelines_VkResult_return; |
| 4963 | } |
| 4964 | |
| 4965 | void VkEncoder::vkDestroyPipeline( |
| 4966 | VkDevice device, |
| 4967 | VkPipeline pipeline, |
| 4968 | const VkAllocationCallbacks* pAllocator) |
| 4969 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 4970 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 4971 | mImpl->log("start vkDestroyPipeline"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4972 | auto stream = mImpl->stream(); |
| 4973 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4974 | auto resources = mImpl->resources(); |
| 4975 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 4976 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4977 | VkDevice local_device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 4978 | VkPipeline local_pipeline; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4979 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 4980 | local_device = device; |
| 4981 | local_pipeline = pipeline; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 4982 | local_pAllocator = nullptr; |
| 4983 | if (pAllocator) |
| 4984 | { |
| 4985 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 4986 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 4987 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 4988 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 4989 | if (local_pAllocator) |
| 4990 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 4991 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 4992 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 4993 | countingStream->rewind(); |
| 4994 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 4995 | uint64_t cgen_var_362; |
| 4996 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_362, 1); |
| 4997 | countingStream->write((uint64_t*)&cgen_var_362, 1 * 8); |
| 4998 | uint64_t cgen_var_363; |
| 4999 | countingStream->handleMapping()->mapHandles_VkPipeline_u64(&local_pipeline, &cgen_var_363, 1); |
| 5000 | countingStream->write((uint64_t*)&cgen_var_363, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 5001 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5002 | uint64_t cgen_var_364 = (uint64_t)(uintptr_t)local_pAllocator; |
| 5003 | countingStream->putBe64(cgen_var_364); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5004 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5005 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5006 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5007 | } |
| 5008 | } |
| 5009 | uint32_t packetSize_vkDestroyPipeline = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 5010 | countingStream->rewind(); |
| 5011 | uint32_t opcode_vkDestroyPipeline = OP_vkDestroyPipeline; |
| 5012 | stream->write(&opcode_vkDestroyPipeline, sizeof(uint32_t)); |
| 5013 | stream->write(&packetSize_vkDestroyPipeline, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5014 | uint64_t cgen_var_365; |
| 5015 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_365, 1); |
| 5016 | stream->write((uint64_t*)&cgen_var_365, 1 * 8); |
| 5017 | uint64_t cgen_var_366; |
| 5018 | stream->handleMapping()->mapHandles_VkPipeline_u64(&local_pipeline, &cgen_var_366, 1); |
| 5019 | stream->write((uint64_t*)&cgen_var_366, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 5020 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5021 | uint64_t cgen_var_367 = (uint64_t)(uintptr_t)local_pAllocator; |
| 5022 | stream->putBe64(cgen_var_367); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5023 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5024 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5025 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5026 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5027 | resources->destroyMapping()->mapHandles_VkPipeline((VkPipeline*)&pipeline); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 5028 | pool->freeAll(); |
| 5029 | countingStream->clearPool(); |
| 5030 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 5031 | mImpl->log("finish vkDestroyPipeline");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5032 | } |
| 5033 | |
| 5034 | VkResult VkEncoder::vkCreatePipelineLayout( |
| 5035 | VkDevice device, |
| 5036 | const VkPipelineLayoutCreateInfo* pCreateInfo, |
| 5037 | const VkAllocationCallbacks* pAllocator, |
| 5038 | VkPipelineLayout* pPipelineLayout) |
| 5039 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 5040 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 5041 | mImpl->log("start vkCreatePipelineLayout"); |
| 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 | VkPipelineLayoutCreateInfo* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 5049 | VkAllocationCallbacks* local_pAllocator; |
| 5050 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5051 | local_pCreateInfo = nullptr; |
| 5052 | if (pCreateInfo) |
| 5053 | { |
| 5054 | local_pCreateInfo = (VkPipelineLayoutCreateInfo*)pool->alloc(sizeof(const VkPipelineLayoutCreateInfo)); |
| 5055 | deepcopy_VkPipelineLayoutCreateInfo(pool, pCreateInfo, (VkPipelineLayoutCreateInfo*)(local_pCreateInfo)); |
| 5056 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5057 | local_pAllocator = nullptr; |
| 5058 | if (pAllocator) |
| 5059 | { |
| 5060 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 5061 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 5062 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 5063 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5064 | if (local_pCreateInfo) |
| 5065 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 5066 | transform_tohost_VkPipelineLayoutCreateInfo(mImpl->resources(), (VkPipelineLayoutCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5067 | } |
| 5068 | if (local_pAllocator) |
| 5069 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 5070 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5071 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5072 | countingStream->rewind(); |
| 5073 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5074 | uint64_t cgen_var_368; |
| 5075 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_368, 1); |
| 5076 | countingStream->write((uint64_t*)&cgen_var_368, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5077 | marshal_VkPipelineLayoutCreateInfo(countingStream, (VkPipelineLayoutCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 5078 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5079 | uint64_t cgen_var_369 = (uint64_t)(uintptr_t)local_pAllocator; |
| 5080 | countingStream->putBe64(cgen_var_369); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5081 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5082 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5083 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5084 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5085 | uint64_t cgen_var_370; |
| 5086 | countingStream->handleMapping()->mapHandles_VkPipelineLayout_u64(pPipelineLayout, &cgen_var_370, 1); |
| 5087 | countingStream->write((uint64_t*)&cgen_var_370, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5088 | } |
| 5089 | uint32_t packetSize_vkCreatePipelineLayout = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 5090 | countingStream->rewind(); |
| 5091 | uint32_t opcode_vkCreatePipelineLayout = OP_vkCreatePipelineLayout; |
| 5092 | stream->write(&opcode_vkCreatePipelineLayout, sizeof(uint32_t)); |
| 5093 | stream->write(&packetSize_vkCreatePipelineLayout, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5094 | uint64_t cgen_var_371; |
| 5095 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_371, 1); |
| 5096 | stream->write((uint64_t*)&cgen_var_371, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5097 | marshal_VkPipelineLayoutCreateInfo(stream, (VkPipelineLayoutCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 5098 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5099 | uint64_t cgen_var_372 = (uint64_t)(uintptr_t)local_pAllocator; |
| 5100 | stream->putBe64(cgen_var_372); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5101 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5102 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5103 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5104 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5105 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5106 | uint64_t cgen_var_373; |
| 5107 | stream->handleMapping()->mapHandles_VkPipelineLayout_u64(pPipelineLayout, &cgen_var_373, 1); |
| 5108 | stream->write((uint64_t*)&cgen_var_373, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5109 | stream->setHandleMapping(resources->unwrapMapping()); |
| 5110 | stream->setHandleMapping(resources->createMapping()); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5111 | uint64_t cgen_var_374; |
| 5112 | stream->read((uint64_t*)&cgen_var_374, 8); |
| 5113 | stream->handleMapping()->mapHandles_u64_VkPipelineLayout(&cgen_var_374, (VkPipelineLayout*)pPipelineLayout, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5114 | stream->unsetHandleMapping(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5115 | VkResult vkCreatePipelineLayout_VkResult_return = (VkResult)0; |
| 5116 | stream->read(&vkCreatePipelineLayout_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 5117 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5118 | countingStream->clearPool(); |
| 5119 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 5120 | mImpl->log("finish vkCreatePipelineLayout");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5121 | return vkCreatePipelineLayout_VkResult_return; |
| 5122 | } |
| 5123 | |
| 5124 | void VkEncoder::vkDestroyPipelineLayout( |
| 5125 | VkDevice device, |
| 5126 | VkPipelineLayout pipelineLayout, |
| 5127 | const VkAllocationCallbacks* pAllocator) |
| 5128 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 5129 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 5130 | mImpl->log("start vkDestroyPipelineLayout"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5131 | auto stream = mImpl->stream(); |
| 5132 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5133 | auto resources = mImpl->resources(); |
| 5134 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5135 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5136 | VkDevice local_device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 5137 | VkPipelineLayout local_pipelineLayout; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5138 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 5139 | local_device = device; |
| 5140 | local_pipelineLayout = pipelineLayout; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5141 | local_pAllocator = nullptr; |
| 5142 | if (pAllocator) |
| 5143 | { |
| 5144 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 5145 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 5146 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 5147 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5148 | if (local_pAllocator) |
| 5149 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 5150 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5151 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5152 | countingStream->rewind(); |
| 5153 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5154 | uint64_t cgen_var_375; |
| 5155 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_375, 1); |
| 5156 | countingStream->write((uint64_t*)&cgen_var_375, 1 * 8); |
| 5157 | uint64_t cgen_var_376; |
| 5158 | countingStream->handleMapping()->mapHandles_VkPipelineLayout_u64(&local_pipelineLayout, &cgen_var_376, 1); |
| 5159 | countingStream->write((uint64_t*)&cgen_var_376, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 5160 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5161 | uint64_t cgen_var_377 = (uint64_t)(uintptr_t)local_pAllocator; |
| 5162 | countingStream->putBe64(cgen_var_377); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5163 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5164 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5165 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5166 | } |
| 5167 | } |
| 5168 | uint32_t packetSize_vkDestroyPipelineLayout = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 5169 | countingStream->rewind(); |
| 5170 | uint32_t opcode_vkDestroyPipelineLayout = OP_vkDestroyPipelineLayout; |
| 5171 | stream->write(&opcode_vkDestroyPipelineLayout, sizeof(uint32_t)); |
| 5172 | stream->write(&packetSize_vkDestroyPipelineLayout, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5173 | uint64_t cgen_var_378; |
| 5174 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_378, 1); |
| 5175 | stream->write((uint64_t*)&cgen_var_378, 1 * 8); |
| 5176 | uint64_t cgen_var_379; |
| 5177 | stream->handleMapping()->mapHandles_VkPipelineLayout_u64(&local_pipelineLayout, &cgen_var_379, 1); |
| 5178 | stream->write((uint64_t*)&cgen_var_379, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 5179 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5180 | uint64_t cgen_var_380 = (uint64_t)(uintptr_t)local_pAllocator; |
| 5181 | stream->putBe64(cgen_var_380); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5182 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5183 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5184 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5185 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5186 | resources->destroyMapping()->mapHandles_VkPipelineLayout((VkPipelineLayout*)&pipelineLayout); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 5187 | pool->freeAll(); |
| 5188 | countingStream->clearPool(); |
| 5189 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 5190 | mImpl->log("finish vkDestroyPipelineLayout");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5191 | } |
| 5192 | |
| 5193 | VkResult VkEncoder::vkCreateSampler( |
| 5194 | VkDevice device, |
| 5195 | const VkSamplerCreateInfo* pCreateInfo, |
| 5196 | const VkAllocationCallbacks* pAllocator, |
| 5197 | VkSampler* pSampler) |
| 5198 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 5199 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 5200 | mImpl->log("start vkCreateSampler"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5201 | auto stream = mImpl->stream(); |
| 5202 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5203 | auto resources = mImpl->resources(); |
| 5204 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5205 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5206 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5207 | VkSamplerCreateInfo* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 5208 | VkAllocationCallbacks* local_pAllocator; |
| 5209 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5210 | local_pCreateInfo = nullptr; |
| 5211 | if (pCreateInfo) |
| 5212 | { |
| 5213 | local_pCreateInfo = (VkSamplerCreateInfo*)pool->alloc(sizeof(const VkSamplerCreateInfo)); |
| 5214 | deepcopy_VkSamplerCreateInfo(pool, pCreateInfo, (VkSamplerCreateInfo*)(local_pCreateInfo)); |
| 5215 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5216 | local_pAllocator = nullptr; |
| 5217 | if (pAllocator) |
| 5218 | { |
| 5219 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 5220 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 5221 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 5222 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5223 | if (local_pCreateInfo) |
| 5224 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 5225 | transform_tohost_VkSamplerCreateInfo(mImpl->resources(), (VkSamplerCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5226 | } |
| 5227 | if (local_pAllocator) |
| 5228 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 5229 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5230 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5231 | countingStream->rewind(); |
| 5232 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5233 | uint64_t cgen_var_381; |
| 5234 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_381, 1); |
| 5235 | countingStream->write((uint64_t*)&cgen_var_381, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5236 | marshal_VkSamplerCreateInfo(countingStream, (VkSamplerCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 5237 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5238 | uint64_t cgen_var_382 = (uint64_t)(uintptr_t)local_pAllocator; |
| 5239 | countingStream->putBe64(cgen_var_382); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5240 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5241 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5242 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5243 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5244 | uint64_t cgen_var_383; |
| 5245 | countingStream->handleMapping()->mapHandles_VkSampler_u64(pSampler, &cgen_var_383, 1); |
| 5246 | countingStream->write((uint64_t*)&cgen_var_383, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5247 | } |
| 5248 | uint32_t packetSize_vkCreateSampler = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 5249 | countingStream->rewind(); |
| 5250 | uint32_t opcode_vkCreateSampler = OP_vkCreateSampler; |
| 5251 | stream->write(&opcode_vkCreateSampler, sizeof(uint32_t)); |
| 5252 | stream->write(&packetSize_vkCreateSampler, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5253 | uint64_t cgen_var_384; |
| 5254 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_384, 1); |
| 5255 | stream->write((uint64_t*)&cgen_var_384, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5256 | marshal_VkSamplerCreateInfo(stream, (VkSamplerCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 5257 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5258 | uint64_t cgen_var_385 = (uint64_t)(uintptr_t)local_pAllocator; |
| 5259 | stream->putBe64(cgen_var_385); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5260 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5261 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5262 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5263 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5264 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5265 | uint64_t cgen_var_386; |
| 5266 | stream->handleMapping()->mapHandles_VkSampler_u64(pSampler, &cgen_var_386, 1); |
| 5267 | stream->write((uint64_t*)&cgen_var_386, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5268 | stream->setHandleMapping(resources->unwrapMapping()); |
| 5269 | stream->setHandleMapping(resources->createMapping()); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5270 | uint64_t cgen_var_387; |
| 5271 | stream->read((uint64_t*)&cgen_var_387, 8); |
| 5272 | stream->handleMapping()->mapHandles_u64_VkSampler(&cgen_var_387, (VkSampler*)pSampler, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5273 | stream->unsetHandleMapping(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5274 | VkResult vkCreateSampler_VkResult_return = (VkResult)0; |
| 5275 | stream->read(&vkCreateSampler_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 5276 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5277 | countingStream->clearPool(); |
| 5278 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 5279 | mImpl->log("finish vkCreateSampler");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5280 | return vkCreateSampler_VkResult_return; |
| 5281 | } |
| 5282 | |
| 5283 | void VkEncoder::vkDestroySampler( |
| 5284 | VkDevice device, |
| 5285 | VkSampler sampler, |
| 5286 | const VkAllocationCallbacks* pAllocator) |
| 5287 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 5288 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 5289 | mImpl->log("start vkDestroySampler"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5290 | auto stream = mImpl->stream(); |
| 5291 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5292 | auto resources = mImpl->resources(); |
| 5293 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5294 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5295 | VkDevice local_device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 5296 | VkSampler local_sampler; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5297 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 5298 | local_device = device; |
| 5299 | local_sampler = sampler; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5300 | local_pAllocator = nullptr; |
| 5301 | if (pAllocator) |
| 5302 | { |
| 5303 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 5304 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 5305 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 5306 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5307 | if (local_pAllocator) |
| 5308 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 5309 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5310 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5311 | countingStream->rewind(); |
| 5312 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5313 | uint64_t cgen_var_388; |
| 5314 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_388, 1); |
| 5315 | countingStream->write((uint64_t*)&cgen_var_388, 1 * 8); |
| 5316 | uint64_t cgen_var_389; |
| 5317 | countingStream->handleMapping()->mapHandles_VkSampler_u64(&local_sampler, &cgen_var_389, 1); |
| 5318 | countingStream->write((uint64_t*)&cgen_var_389, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 5319 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5320 | uint64_t cgen_var_390 = (uint64_t)(uintptr_t)local_pAllocator; |
| 5321 | countingStream->putBe64(cgen_var_390); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5322 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5323 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5324 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5325 | } |
| 5326 | } |
| 5327 | uint32_t packetSize_vkDestroySampler = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 5328 | countingStream->rewind(); |
| 5329 | uint32_t opcode_vkDestroySampler = OP_vkDestroySampler; |
| 5330 | stream->write(&opcode_vkDestroySampler, sizeof(uint32_t)); |
| 5331 | stream->write(&packetSize_vkDestroySampler, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5332 | uint64_t cgen_var_391; |
| 5333 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_391, 1); |
| 5334 | stream->write((uint64_t*)&cgen_var_391, 1 * 8); |
| 5335 | uint64_t cgen_var_392; |
| 5336 | stream->handleMapping()->mapHandles_VkSampler_u64(&local_sampler, &cgen_var_392, 1); |
| 5337 | stream->write((uint64_t*)&cgen_var_392, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 5338 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5339 | uint64_t cgen_var_393 = (uint64_t)(uintptr_t)local_pAllocator; |
| 5340 | stream->putBe64(cgen_var_393); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5341 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5342 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5343 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5344 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5345 | resources->destroyMapping()->mapHandles_VkSampler((VkSampler*)&sampler); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 5346 | pool->freeAll(); |
| 5347 | countingStream->clearPool(); |
| 5348 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 5349 | mImpl->log("finish vkDestroySampler");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5350 | } |
| 5351 | |
| 5352 | VkResult VkEncoder::vkCreateDescriptorSetLayout( |
| 5353 | VkDevice device, |
| 5354 | const VkDescriptorSetLayoutCreateInfo* pCreateInfo, |
| 5355 | const VkAllocationCallbacks* pAllocator, |
| 5356 | VkDescriptorSetLayout* pSetLayout) |
| 5357 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 5358 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 5359 | mImpl->log("start vkCreateDescriptorSetLayout"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5360 | auto stream = mImpl->stream(); |
| 5361 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5362 | auto resources = mImpl->resources(); |
| 5363 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5364 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5365 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5366 | VkDescriptorSetLayoutCreateInfo* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 5367 | VkAllocationCallbacks* local_pAllocator; |
| 5368 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5369 | local_pCreateInfo = nullptr; |
| 5370 | if (pCreateInfo) |
| 5371 | { |
| 5372 | local_pCreateInfo = (VkDescriptorSetLayoutCreateInfo*)pool->alloc(sizeof(const VkDescriptorSetLayoutCreateInfo)); |
| 5373 | deepcopy_VkDescriptorSetLayoutCreateInfo(pool, pCreateInfo, (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo)); |
| 5374 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5375 | local_pAllocator = nullptr; |
| 5376 | if (pAllocator) |
| 5377 | { |
| 5378 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 5379 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 5380 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 5381 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5382 | if (local_pCreateInfo) |
| 5383 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 5384 | transform_tohost_VkDescriptorSetLayoutCreateInfo(mImpl->resources(), (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5385 | } |
| 5386 | if (local_pAllocator) |
| 5387 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 5388 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5389 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5390 | countingStream->rewind(); |
| 5391 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5392 | uint64_t cgen_var_394; |
| 5393 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_394, 1); |
| 5394 | countingStream->write((uint64_t*)&cgen_var_394, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5395 | marshal_VkDescriptorSetLayoutCreateInfo(countingStream, (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 5396 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5397 | uint64_t cgen_var_395 = (uint64_t)(uintptr_t)local_pAllocator; |
| 5398 | countingStream->putBe64(cgen_var_395); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5399 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5400 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5401 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5402 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5403 | uint64_t cgen_var_396; |
| 5404 | countingStream->handleMapping()->mapHandles_VkDescriptorSetLayout_u64(pSetLayout, &cgen_var_396, 1); |
| 5405 | countingStream->write((uint64_t*)&cgen_var_396, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5406 | } |
| 5407 | uint32_t packetSize_vkCreateDescriptorSetLayout = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 5408 | countingStream->rewind(); |
| 5409 | uint32_t opcode_vkCreateDescriptorSetLayout = OP_vkCreateDescriptorSetLayout; |
| 5410 | stream->write(&opcode_vkCreateDescriptorSetLayout, sizeof(uint32_t)); |
| 5411 | stream->write(&packetSize_vkCreateDescriptorSetLayout, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5412 | uint64_t cgen_var_397; |
| 5413 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_397, 1); |
| 5414 | stream->write((uint64_t*)&cgen_var_397, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5415 | marshal_VkDescriptorSetLayoutCreateInfo(stream, (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 5416 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5417 | uint64_t cgen_var_398 = (uint64_t)(uintptr_t)local_pAllocator; |
| 5418 | stream->putBe64(cgen_var_398); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5419 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5420 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5421 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5422 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5423 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5424 | uint64_t cgen_var_399; |
| 5425 | stream->handleMapping()->mapHandles_VkDescriptorSetLayout_u64(pSetLayout, &cgen_var_399, 1); |
| 5426 | stream->write((uint64_t*)&cgen_var_399, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5427 | stream->setHandleMapping(resources->unwrapMapping()); |
| 5428 | stream->setHandleMapping(resources->createMapping()); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5429 | uint64_t cgen_var_400; |
| 5430 | stream->read((uint64_t*)&cgen_var_400, 8); |
| 5431 | stream->handleMapping()->mapHandles_u64_VkDescriptorSetLayout(&cgen_var_400, (VkDescriptorSetLayout*)pSetLayout, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5432 | stream->unsetHandleMapping(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5433 | VkResult vkCreateDescriptorSetLayout_VkResult_return = (VkResult)0; |
| 5434 | stream->read(&vkCreateDescriptorSetLayout_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 5435 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5436 | countingStream->clearPool(); |
| 5437 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 5438 | mImpl->log("finish vkCreateDescriptorSetLayout");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5439 | return vkCreateDescriptorSetLayout_VkResult_return; |
| 5440 | } |
| 5441 | |
| 5442 | void VkEncoder::vkDestroyDescriptorSetLayout( |
| 5443 | VkDevice device, |
| 5444 | VkDescriptorSetLayout descriptorSetLayout, |
| 5445 | const VkAllocationCallbacks* pAllocator) |
| 5446 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 5447 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 5448 | mImpl->log("start vkDestroyDescriptorSetLayout"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5449 | auto stream = mImpl->stream(); |
| 5450 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5451 | auto resources = mImpl->resources(); |
| 5452 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5453 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5454 | VkDevice local_device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 5455 | VkDescriptorSetLayout local_descriptorSetLayout; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5456 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 5457 | local_device = device; |
| 5458 | local_descriptorSetLayout = descriptorSetLayout; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5459 | local_pAllocator = nullptr; |
| 5460 | if (pAllocator) |
| 5461 | { |
| 5462 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 5463 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 5464 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 5465 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5466 | if (local_pAllocator) |
| 5467 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 5468 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5469 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5470 | countingStream->rewind(); |
| 5471 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5472 | uint64_t cgen_var_401; |
| 5473 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_401, 1); |
| 5474 | countingStream->write((uint64_t*)&cgen_var_401, 1 * 8); |
| 5475 | uint64_t cgen_var_402; |
| 5476 | countingStream->handleMapping()->mapHandles_VkDescriptorSetLayout_u64(&local_descriptorSetLayout, &cgen_var_402, 1); |
| 5477 | countingStream->write((uint64_t*)&cgen_var_402, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 5478 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5479 | uint64_t cgen_var_403 = (uint64_t)(uintptr_t)local_pAllocator; |
| 5480 | countingStream->putBe64(cgen_var_403); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5481 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5482 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5483 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5484 | } |
| 5485 | } |
| 5486 | uint32_t packetSize_vkDestroyDescriptorSetLayout = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 5487 | countingStream->rewind(); |
| 5488 | uint32_t opcode_vkDestroyDescriptorSetLayout = OP_vkDestroyDescriptorSetLayout; |
| 5489 | stream->write(&opcode_vkDestroyDescriptorSetLayout, sizeof(uint32_t)); |
| 5490 | stream->write(&packetSize_vkDestroyDescriptorSetLayout, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5491 | uint64_t cgen_var_404; |
| 5492 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_404, 1); |
| 5493 | stream->write((uint64_t*)&cgen_var_404, 1 * 8); |
| 5494 | uint64_t cgen_var_405; |
| 5495 | stream->handleMapping()->mapHandles_VkDescriptorSetLayout_u64(&local_descriptorSetLayout, &cgen_var_405, 1); |
| 5496 | stream->write((uint64_t*)&cgen_var_405, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 5497 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5498 | uint64_t cgen_var_406 = (uint64_t)(uintptr_t)local_pAllocator; |
| 5499 | stream->putBe64(cgen_var_406); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5500 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5501 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5502 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5503 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5504 | resources->destroyMapping()->mapHandles_VkDescriptorSetLayout((VkDescriptorSetLayout*)&descriptorSetLayout); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 5505 | pool->freeAll(); |
| 5506 | countingStream->clearPool(); |
| 5507 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 5508 | mImpl->log("finish vkDestroyDescriptorSetLayout");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5509 | } |
| 5510 | |
| 5511 | VkResult VkEncoder::vkCreateDescriptorPool( |
| 5512 | VkDevice device, |
| 5513 | const VkDescriptorPoolCreateInfo* pCreateInfo, |
| 5514 | const VkAllocationCallbacks* pAllocator, |
| 5515 | VkDescriptorPool* pDescriptorPool) |
| 5516 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 5517 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 5518 | mImpl->log("start vkCreateDescriptorPool"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5519 | auto stream = mImpl->stream(); |
| 5520 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5521 | auto resources = mImpl->resources(); |
| 5522 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5523 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5524 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5525 | VkDescriptorPoolCreateInfo* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 5526 | VkAllocationCallbacks* local_pAllocator; |
| 5527 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5528 | local_pCreateInfo = nullptr; |
| 5529 | if (pCreateInfo) |
| 5530 | { |
| 5531 | local_pCreateInfo = (VkDescriptorPoolCreateInfo*)pool->alloc(sizeof(const VkDescriptorPoolCreateInfo)); |
| 5532 | deepcopy_VkDescriptorPoolCreateInfo(pool, pCreateInfo, (VkDescriptorPoolCreateInfo*)(local_pCreateInfo)); |
| 5533 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5534 | local_pAllocator = nullptr; |
| 5535 | if (pAllocator) |
| 5536 | { |
| 5537 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 5538 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 5539 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 5540 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5541 | if (local_pCreateInfo) |
| 5542 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 5543 | transform_tohost_VkDescriptorPoolCreateInfo(mImpl->resources(), (VkDescriptorPoolCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5544 | } |
| 5545 | if (local_pAllocator) |
| 5546 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 5547 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5548 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5549 | countingStream->rewind(); |
| 5550 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5551 | uint64_t cgen_var_407; |
| 5552 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_407, 1); |
| 5553 | countingStream->write((uint64_t*)&cgen_var_407, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5554 | marshal_VkDescriptorPoolCreateInfo(countingStream, (VkDescriptorPoolCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 5555 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5556 | uint64_t cgen_var_408 = (uint64_t)(uintptr_t)local_pAllocator; |
| 5557 | countingStream->putBe64(cgen_var_408); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5558 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5559 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5560 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5561 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5562 | uint64_t cgen_var_409; |
| 5563 | countingStream->handleMapping()->mapHandles_VkDescriptorPool_u64(pDescriptorPool, &cgen_var_409, 1); |
| 5564 | countingStream->write((uint64_t*)&cgen_var_409, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5565 | } |
| 5566 | uint32_t packetSize_vkCreateDescriptorPool = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 5567 | countingStream->rewind(); |
| 5568 | uint32_t opcode_vkCreateDescriptorPool = OP_vkCreateDescriptorPool; |
| 5569 | stream->write(&opcode_vkCreateDescriptorPool, sizeof(uint32_t)); |
| 5570 | stream->write(&packetSize_vkCreateDescriptorPool, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5571 | uint64_t cgen_var_410; |
| 5572 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_410, 1); |
| 5573 | stream->write((uint64_t*)&cgen_var_410, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5574 | marshal_VkDescriptorPoolCreateInfo(stream, (VkDescriptorPoolCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 5575 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5576 | uint64_t cgen_var_411 = (uint64_t)(uintptr_t)local_pAllocator; |
| 5577 | stream->putBe64(cgen_var_411); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5578 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5579 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5580 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5581 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5582 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5583 | uint64_t cgen_var_412; |
| 5584 | stream->handleMapping()->mapHandles_VkDescriptorPool_u64(pDescriptorPool, &cgen_var_412, 1); |
| 5585 | stream->write((uint64_t*)&cgen_var_412, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5586 | stream->setHandleMapping(resources->unwrapMapping()); |
| 5587 | stream->setHandleMapping(resources->createMapping()); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5588 | uint64_t cgen_var_413; |
| 5589 | stream->read((uint64_t*)&cgen_var_413, 8); |
| 5590 | stream->handleMapping()->mapHandles_u64_VkDescriptorPool(&cgen_var_413, (VkDescriptorPool*)pDescriptorPool, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5591 | stream->unsetHandleMapping(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5592 | VkResult vkCreateDescriptorPool_VkResult_return = (VkResult)0; |
| 5593 | stream->read(&vkCreateDescriptorPool_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 5594 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5595 | countingStream->clearPool(); |
| 5596 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 5597 | mImpl->log("finish vkCreateDescriptorPool");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5598 | return vkCreateDescriptorPool_VkResult_return; |
| 5599 | } |
| 5600 | |
| 5601 | void VkEncoder::vkDestroyDescriptorPool( |
| 5602 | VkDevice device, |
| 5603 | VkDescriptorPool descriptorPool, |
| 5604 | const VkAllocationCallbacks* pAllocator) |
| 5605 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 5606 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 5607 | mImpl->log("start vkDestroyDescriptorPool"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5608 | auto stream = mImpl->stream(); |
| 5609 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5610 | auto resources = mImpl->resources(); |
| 5611 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5612 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5613 | VkDevice local_device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 5614 | VkDescriptorPool local_descriptorPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5615 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 5616 | local_device = device; |
| 5617 | local_descriptorPool = descriptorPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5618 | local_pAllocator = nullptr; |
| 5619 | if (pAllocator) |
| 5620 | { |
| 5621 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 5622 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 5623 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 5624 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5625 | if (local_pAllocator) |
| 5626 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 5627 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5628 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5629 | countingStream->rewind(); |
| 5630 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5631 | uint64_t cgen_var_414; |
| 5632 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_414, 1); |
| 5633 | countingStream->write((uint64_t*)&cgen_var_414, 1 * 8); |
| 5634 | uint64_t cgen_var_415; |
| 5635 | countingStream->handleMapping()->mapHandles_VkDescriptorPool_u64(&local_descriptorPool, &cgen_var_415, 1); |
| 5636 | countingStream->write((uint64_t*)&cgen_var_415, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 5637 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5638 | uint64_t cgen_var_416 = (uint64_t)(uintptr_t)local_pAllocator; |
| 5639 | countingStream->putBe64(cgen_var_416); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5640 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5641 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5642 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5643 | } |
| 5644 | } |
| 5645 | uint32_t packetSize_vkDestroyDescriptorPool = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 5646 | countingStream->rewind(); |
| 5647 | uint32_t opcode_vkDestroyDescriptorPool = OP_vkDestroyDescriptorPool; |
| 5648 | stream->write(&opcode_vkDestroyDescriptorPool, sizeof(uint32_t)); |
| 5649 | stream->write(&packetSize_vkDestroyDescriptorPool, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5650 | uint64_t cgen_var_417; |
| 5651 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_417, 1); |
| 5652 | stream->write((uint64_t*)&cgen_var_417, 1 * 8); |
| 5653 | uint64_t cgen_var_418; |
| 5654 | stream->handleMapping()->mapHandles_VkDescriptorPool_u64(&local_descriptorPool, &cgen_var_418, 1); |
| 5655 | stream->write((uint64_t*)&cgen_var_418, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 5656 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5657 | uint64_t cgen_var_419 = (uint64_t)(uintptr_t)local_pAllocator; |
| 5658 | stream->putBe64(cgen_var_419); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5659 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5660 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5661 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5662 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5663 | resources->destroyMapping()->mapHandles_VkDescriptorPool((VkDescriptorPool*)&descriptorPool); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 5664 | pool->freeAll(); |
| 5665 | countingStream->clearPool(); |
| 5666 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 5667 | mImpl->log("finish vkDestroyDescriptorPool");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5668 | } |
| 5669 | |
| 5670 | VkResult VkEncoder::vkResetDescriptorPool( |
| 5671 | VkDevice device, |
| 5672 | VkDescriptorPool descriptorPool, |
| 5673 | VkDescriptorPoolResetFlags flags) |
| 5674 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 5675 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 5676 | mImpl->log("start vkResetDescriptorPool"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5677 | auto stream = mImpl->stream(); |
| 5678 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5679 | auto resources = mImpl->resources(); |
| 5680 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5681 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5682 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5683 | VkDescriptorPool local_descriptorPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5684 | VkDescriptorPoolResetFlags local_flags; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 5685 | local_device = device; |
| 5686 | local_descriptorPool = descriptorPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5687 | local_flags = flags; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5688 | countingStream->rewind(); |
| 5689 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5690 | uint64_t cgen_var_420; |
| 5691 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_420, 1); |
| 5692 | countingStream->write((uint64_t*)&cgen_var_420, 1 * 8); |
| 5693 | uint64_t cgen_var_421; |
| 5694 | countingStream->handleMapping()->mapHandles_VkDescriptorPool_u64(&local_descriptorPool, &cgen_var_421, 1); |
| 5695 | countingStream->write((uint64_t*)&cgen_var_421, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5696 | countingStream->write((VkDescriptorPoolResetFlags*)&local_flags, sizeof(VkDescriptorPoolResetFlags)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5697 | } |
| 5698 | uint32_t packetSize_vkResetDescriptorPool = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 5699 | countingStream->rewind(); |
| 5700 | uint32_t opcode_vkResetDescriptorPool = OP_vkResetDescriptorPool; |
| 5701 | stream->write(&opcode_vkResetDescriptorPool, sizeof(uint32_t)); |
| 5702 | stream->write(&packetSize_vkResetDescriptorPool, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5703 | uint64_t cgen_var_422; |
| 5704 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_422, 1); |
| 5705 | stream->write((uint64_t*)&cgen_var_422, 1 * 8); |
| 5706 | uint64_t cgen_var_423; |
| 5707 | stream->handleMapping()->mapHandles_VkDescriptorPool_u64(&local_descriptorPool, &cgen_var_423, 1); |
| 5708 | stream->write((uint64_t*)&cgen_var_423, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5709 | stream->write((VkDescriptorPoolResetFlags*)&local_flags, sizeof(VkDescriptorPoolResetFlags)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5710 | VkResult vkResetDescriptorPool_VkResult_return = (VkResult)0; |
| 5711 | stream->read(&vkResetDescriptorPool_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 5712 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5713 | countingStream->clearPool(); |
| 5714 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 5715 | mImpl->log("finish vkResetDescriptorPool");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5716 | return vkResetDescriptorPool_VkResult_return; |
| 5717 | } |
| 5718 | |
| 5719 | VkResult VkEncoder::vkAllocateDescriptorSets( |
| 5720 | VkDevice device, |
| 5721 | const VkDescriptorSetAllocateInfo* pAllocateInfo, |
| 5722 | VkDescriptorSet* pDescriptorSets) |
| 5723 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 5724 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 5725 | mImpl->log("start vkAllocateDescriptorSets"); |
| 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 | VkDescriptorSetAllocateInfo* local_pAllocateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 5733 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5734 | local_pAllocateInfo = nullptr; |
| 5735 | if (pAllocateInfo) |
| 5736 | { |
| 5737 | local_pAllocateInfo = (VkDescriptorSetAllocateInfo*)pool->alloc(sizeof(const VkDescriptorSetAllocateInfo)); |
| 5738 | deepcopy_VkDescriptorSetAllocateInfo(pool, pAllocateInfo, (VkDescriptorSetAllocateInfo*)(local_pAllocateInfo)); |
| 5739 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5740 | if (local_pAllocateInfo) |
| 5741 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 5742 | transform_tohost_VkDescriptorSetAllocateInfo(mImpl->resources(), (VkDescriptorSetAllocateInfo*)(local_pAllocateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5743 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5744 | countingStream->rewind(); |
| 5745 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5746 | uint64_t cgen_var_424; |
| 5747 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_424, 1); |
| 5748 | countingStream->write((uint64_t*)&cgen_var_424, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5749 | marshal_VkDescriptorSetAllocateInfo(countingStream, (VkDescriptorSetAllocateInfo*)(local_pAllocateInfo)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5750 | if (pAllocateInfo->descriptorSetCount) |
| 5751 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5752 | uint64_t* cgen_var_425; |
| 5753 | countingStream->alloc((void**)&cgen_var_425, pAllocateInfo->descriptorSetCount * 8); |
| 5754 | countingStream->handleMapping()->mapHandles_VkDescriptorSet_u64(pDescriptorSets, cgen_var_425, pAllocateInfo->descriptorSetCount); |
| 5755 | countingStream->write((uint64_t*)cgen_var_425, pAllocateInfo->descriptorSetCount * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5756 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5757 | } |
| 5758 | uint32_t packetSize_vkAllocateDescriptorSets = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 5759 | countingStream->rewind(); |
| 5760 | uint32_t opcode_vkAllocateDescriptorSets = OP_vkAllocateDescriptorSets; |
| 5761 | stream->write(&opcode_vkAllocateDescriptorSets, sizeof(uint32_t)); |
| 5762 | stream->write(&packetSize_vkAllocateDescriptorSets, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5763 | uint64_t cgen_var_426; |
| 5764 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_426, 1); |
| 5765 | stream->write((uint64_t*)&cgen_var_426, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5766 | marshal_VkDescriptorSetAllocateInfo(stream, (VkDescriptorSetAllocateInfo*)(local_pAllocateInfo)); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5767 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5768 | if (pAllocateInfo->descriptorSetCount) |
| 5769 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5770 | uint64_t* cgen_var_427; |
| 5771 | stream->alloc((void**)&cgen_var_427, pAllocateInfo->descriptorSetCount * 8); |
| 5772 | stream->handleMapping()->mapHandles_VkDescriptorSet_u64(pDescriptorSets, cgen_var_427, pAllocateInfo->descriptorSetCount); |
| 5773 | stream->write((uint64_t*)cgen_var_427, pAllocateInfo->descriptorSetCount * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5774 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5775 | stream->setHandleMapping(resources->unwrapMapping()); |
| 5776 | stream->setHandleMapping(resources->createMapping()); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5777 | if (pAllocateInfo->descriptorSetCount) |
| 5778 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5779 | uint64_t* cgen_var_428; |
| 5780 | stream->alloc((void**)&cgen_var_428, pAllocateInfo->descriptorSetCount * 8); |
| 5781 | stream->read((uint64_t*)cgen_var_428, pAllocateInfo->descriptorSetCount * 8); |
| 5782 | stream->handleMapping()->mapHandles_u64_VkDescriptorSet(cgen_var_428, (VkDescriptorSet*)pDescriptorSets, pAllocateInfo->descriptorSetCount); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5783 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5784 | stream->unsetHandleMapping(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5785 | VkResult vkAllocateDescriptorSets_VkResult_return = (VkResult)0; |
| 5786 | stream->read(&vkAllocateDescriptorSets_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 5787 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5788 | countingStream->clearPool(); |
| 5789 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 5790 | mImpl->log("finish vkAllocateDescriptorSets");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5791 | return vkAllocateDescriptorSets_VkResult_return; |
| 5792 | } |
| 5793 | |
| 5794 | VkResult VkEncoder::vkFreeDescriptorSets( |
| 5795 | VkDevice device, |
| 5796 | VkDescriptorPool descriptorPool, |
| 5797 | uint32_t descriptorSetCount, |
| 5798 | const VkDescriptorSet* pDescriptorSets) |
| 5799 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 5800 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 5801 | mImpl->log("start vkFreeDescriptorSets"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5802 | auto stream = mImpl->stream(); |
| 5803 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5804 | auto resources = mImpl->resources(); |
| 5805 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5806 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5807 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5808 | VkDescriptorPool local_descriptorPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5809 | uint32_t local_descriptorSetCount; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 5810 | VkDescriptorSet* local_pDescriptorSets; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 5811 | local_device = device; |
| 5812 | local_descriptorPool = descriptorPool; |
| 5813 | local_descriptorSetCount = descriptorSetCount; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 5814 | local_pDescriptorSets = nullptr; |
| 5815 | if (pDescriptorSets) |
| 5816 | { |
| 5817 | local_pDescriptorSets = (VkDescriptorSet*)pool->dupArray(pDescriptorSets, ((descriptorSetCount)) * sizeof(const VkDescriptorSet)); |
| 5818 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5819 | countingStream->rewind(); |
| 5820 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5821 | uint64_t cgen_var_429; |
| 5822 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_429, 1); |
| 5823 | countingStream->write((uint64_t*)&cgen_var_429, 1 * 8); |
| 5824 | uint64_t cgen_var_430; |
| 5825 | countingStream->handleMapping()->mapHandles_VkDescriptorPool_u64(&local_descriptorPool, &cgen_var_430, 1); |
| 5826 | countingStream->write((uint64_t*)&cgen_var_430, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5827 | countingStream->write((uint32_t*)&local_descriptorSetCount, sizeof(uint32_t)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 5828 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5829 | uint64_t cgen_var_431 = (uint64_t)(uintptr_t)local_pDescriptorSets; |
| 5830 | countingStream->putBe64(cgen_var_431); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 5831 | if (local_pDescriptorSets) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5832 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5833 | if (((descriptorSetCount))) |
| 5834 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5835 | uint64_t* cgen_var_432; |
| 5836 | countingStream->alloc((void**)&cgen_var_432, ((descriptorSetCount)) * 8); |
| 5837 | countingStream->handleMapping()->mapHandles_VkDescriptorSet_u64(local_pDescriptorSets, cgen_var_432, ((descriptorSetCount))); |
| 5838 | countingStream->write((uint64_t*)cgen_var_432, ((descriptorSetCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5839 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5840 | } |
| 5841 | } |
| 5842 | uint32_t packetSize_vkFreeDescriptorSets = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 5843 | countingStream->rewind(); |
| 5844 | uint32_t opcode_vkFreeDescriptorSets = OP_vkFreeDescriptorSets; |
| 5845 | stream->write(&opcode_vkFreeDescriptorSets, sizeof(uint32_t)); |
| 5846 | stream->write(&packetSize_vkFreeDescriptorSets, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5847 | uint64_t cgen_var_433; |
| 5848 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_433, 1); |
| 5849 | stream->write((uint64_t*)&cgen_var_433, 1 * 8); |
| 5850 | uint64_t cgen_var_434; |
| 5851 | stream->handleMapping()->mapHandles_VkDescriptorPool_u64(&local_descriptorPool, &cgen_var_434, 1); |
| 5852 | stream->write((uint64_t*)&cgen_var_434, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5853 | stream->write((uint32_t*)&local_descriptorSetCount, sizeof(uint32_t)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 5854 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5855 | uint64_t cgen_var_435 = (uint64_t)(uintptr_t)local_pDescriptorSets; |
| 5856 | stream->putBe64(cgen_var_435); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 5857 | if (local_pDescriptorSets) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5858 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5859 | if (((descriptorSetCount))) |
| 5860 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5861 | uint64_t* cgen_var_436; |
| 5862 | stream->alloc((void**)&cgen_var_436, ((descriptorSetCount)) * 8); |
| 5863 | stream->handleMapping()->mapHandles_VkDescriptorSet_u64(local_pDescriptorSets, cgen_var_436, ((descriptorSetCount))); |
| 5864 | stream->write((uint64_t*)cgen_var_436, ((descriptorSetCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 5865 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5866 | } |
| 5867 | VkResult vkFreeDescriptorSets_VkResult_return = (VkResult)0; |
| 5868 | stream->read(&vkFreeDescriptorSets_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 6ab1b0d | 2018-11-27 23:36:03 -0800 | [diff] [blame] | 5869 | if (pDescriptorSets) |
| 5870 | { |
| 5871 | resources->destroyMapping()->mapHandles_VkDescriptorSet((VkDescriptorSet*)pDescriptorSets, ((descriptorSetCount))); |
| 5872 | } |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 5873 | pool->freeAll(); |
| 5874 | countingStream->clearPool(); |
| 5875 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 5876 | mImpl->log("finish vkFreeDescriptorSets");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5877 | return vkFreeDescriptorSets_VkResult_return; |
| 5878 | } |
| 5879 | |
| 5880 | void VkEncoder::vkUpdateDescriptorSets( |
| 5881 | VkDevice device, |
| 5882 | uint32_t descriptorWriteCount, |
| 5883 | const VkWriteDescriptorSet* pDescriptorWrites, |
| 5884 | uint32_t descriptorCopyCount, |
| 5885 | const VkCopyDescriptorSet* pDescriptorCopies) |
| 5886 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 5887 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 5888 | mImpl->log("start vkUpdateDescriptorSets"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5889 | auto stream = mImpl->stream(); |
| 5890 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5891 | auto resources = mImpl->resources(); |
| 5892 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5893 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5894 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5895 | uint32_t local_descriptorWriteCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5896 | VkWriteDescriptorSet* local_pDescriptorWrites; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 5897 | uint32_t local_descriptorCopyCount; |
| 5898 | VkCopyDescriptorSet* local_pDescriptorCopies; |
| 5899 | local_device = device; |
| 5900 | local_descriptorWriteCount = descriptorWriteCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5901 | local_pDescriptorWrites = nullptr; |
| 5902 | if (pDescriptorWrites) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5903 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5904 | local_pDescriptorWrites = (VkWriteDescriptorSet*)pool->alloc(((descriptorWriteCount)) * sizeof(const VkWriteDescriptorSet)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5905 | for (uint32_t i = 0; i < (uint32_t)((descriptorWriteCount)); ++i) |
| 5906 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5907 | deepcopy_VkWriteDescriptorSet(pool, pDescriptorWrites + i, (VkWriteDescriptorSet*)(local_pDescriptorWrites + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5908 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5909 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5910 | local_descriptorCopyCount = descriptorCopyCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5911 | local_pDescriptorCopies = nullptr; |
| 5912 | if (pDescriptorCopies) |
| 5913 | { |
| 5914 | local_pDescriptorCopies = (VkCopyDescriptorSet*)pool->alloc(((descriptorCopyCount)) * sizeof(const VkCopyDescriptorSet)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5915 | for (uint32_t i = 0; i < (uint32_t)((descriptorCopyCount)); ++i) |
| 5916 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5917 | deepcopy_VkCopyDescriptorSet(pool, pDescriptorCopies + i, (VkCopyDescriptorSet*)(local_pDescriptorCopies + i)); |
| 5918 | } |
| 5919 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5920 | if (local_pDescriptorWrites) |
| 5921 | { |
| 5922 | for (uint32_t i = 0; i < (uint32_t)((descriptorWriteCount)); ++i) |
| 5923 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 5924 | transform_tohost_VkWriteDescriptorSet(mImpl->resources(), (VkWriteDescriptorSet*)(local_pDescriptorWrites + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5925 | } |
| 5926 | } |
| 5927 | if (local_pDescriptorCopies) |
| 5928 | { |
| 5929 | for (uint32_t i = 0; i < (uint32_t)((descriptorCopyCount)); ++i) |
| 5930 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 5931 | transform_tohost_VkCopyDescriptorSet(mImpl->resources(), (VkCopyDescriptorSet*)(local_pDescriptorCopies + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 5932 | } |
| 5933 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5934 | countingStream->rewind(); |
| 5935 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5936 | uint64_t cgen_var_437; |
| 5937 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_437, 1); |
| 5938 | countingStream->write((uint64_t*)&cgen_var_437, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5939 | countingStream->write((uint32_t*)&local_descriptorWriteCount, sizeof(uint32_t)); |
| 5940 | for (uint32_t i = 0; i < (uint32_t)((descriptorWriteCount)); ++i) |
| 5941 | { |
| 5942 | marshal_VkWriteDescriptorSet(countingStream, (VkWriteDescriptorSet*)(local_pDescriptorWrites + i)); |
| 5943 | } |
| 5944 | countingStream->write((uint32_t*)&local_descriptorCopyCount, sizeof(uint32_t)); |
| 5945 | for (uint32_t i = 0; i < (uint32_t)((descriptorCopyCount)); ++i) |
| 5946 | { |
| 5947 | marshal_VkCopyDescriptorSet(countingStream, (VkCopyDescriptorSet*)(local_pDescriptorCopies + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5948 | } |
| 5949 | } |
| 5950 | uint32_t packetSize_vkUpdateDescriptorSets = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 5951 | countingStream->rewind(); |
| 5952 | uint32_t opcode_vkUpdateDescriptorSets = OP_vkUpdateDescriptorSets; |
| 5953 | stream->write(&opcode_vkUpdateDescriptorSets, sizeof(uint32_t)); |
| 5954 | stream->write(&packetSize_vkUpdateDescriptorSets, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 5955 | uint64_t cgen_var_438; |
| 5956 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_438, 1); |
| 5957 | stream->write((uint64_t*)&cgen_var_438, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5958 | stream->write((uint32_t*)&local_descriptorWriteCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5959 | for (uint32_t i = 0; i < (uint32_t)((descriptorWriteCount)); ++i) |
| 5960 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5961 | marshal_VkWriteDescriptorSet(stream, (VkWriteDescriptorSet*)(local_pDescriptorWrites + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5962 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5963 | stream->write((uint32_t*)&local_descriptorCopyCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5964 | for (uint32_t i = 0; i < (uint32_t)((descriptorCopyCount)); ++i) |
| 5965 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5966 | marshal_VkCopyDescriptorSet(stream, (VkCopyDescriptorSet*)(local_pDescriptorCopies + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5967 | } |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 5968 | pool->freeAll(); |
| 5969 | countingStream->clearPool(); |
| 5970 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 5971 | mImpl->log("finish vkUpdateDescriptorSets");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5972 | } |
| 5973 | |
| 5974 | VkResult VkEncoder::vkCreateFramebuffer( |
| 5975 | VkDevice device, |
| 5976 | const VkFramebufferCreateInfo* pCreateInfo, |
| 5977 | const VkAllocationCallbacks* pAllocator, |
| 5978 | VkFramebuffer* pFramebuffer) |
| 5979 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 5980 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 5981 | mImpl->log("start vkCreateFramebuffer"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 5982 | auto stream = mImpl->stream(); |
| 5983 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5984 | auto resources = mImpl->resources(); |
| 5985 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 5986 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5987 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5988 | VkFramebufferCreateInfo* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 5989 | VkAllocationCallbacks* local_pAllocator; |
| 5990 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5991 | local_pCreateInfo = nullptr; |
| 5992 | if (pCreateInfo) |
| 5993 | { |
| 5994 | local_pCreateInfo = (VkFramebufferCreateInfo*)pool->alloc(sizeof(const VkFramebufferCreateInfo)); |
| 5995 | deepcopy_VkFramebufferCreateInfo(pool, pCreateInfo, (VkFramebufferCreateInfo*)(local_pCreateInfo)); |
| 5996 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 5997 | local_pAllocator = nullptr; |
| 5998 | if (pAllocator) |
| 5999 | { |
| 6000 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 6001 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 6002 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 6003 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 6004 | if (local_pCreateInfo) |
| 6005 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 6006 | transform_tohost_VkFramebufferCreateInfo(mImpl->resources(), (VkFramebufferCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 6007 | } |
| 6008 | if (local_pAllocator) |
| 6009 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 6010 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 6011 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6012 | countingStream->rewind(); |
| 6013 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6014 | uint64_t cgen_var_439; |
| 6015 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_439, 1); |
| 6016 | countingStream->write((uint64_t*)&cgen_var_439, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6017 | marshal_VkFramebufferCreateInfo(countingStream, (VkFramebufferCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 6018 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6019 | uint64_t cgen_var_440 = (uint64_t)(uintptr_t)local_pAllocator; |
| 6020 | countingStream->putBe64(cgen_var_440); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6021 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6022 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6023 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6024 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6025 | uint64_t cgen_var_441; |
| 6026 | countingStream->handleMapping()->mapHandles_VkFramebuffer_u64(pFramebuffer, &cgen_var_441, 1); |
| 6027 | countingStream->write((uint64_t*)&cgen_var_441, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6028 | } |
| 6029 | uint32_t packetSize_vkCreateFramebuffer = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 6030 | countingStream->rewind(); |
| 6031 | uint32_t opcode_vkCreateFramebuffer = OP_vkCreateFramebuffer; |
| 6032 | stream->write(&opcode_vkCreateFramebuffer, sizeof(uint32_t)); |
| 6033 | stream->write(&packetSize_vkCreateFramebuffer, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6034 | uint64_t cgen_var_442; |
| 6035 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_442, 1); |
| 6036 | stream->write((uint64_t*)&cgen_var_442, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6037 | marshal_VkFramebufferCreateInfo(stream, (VkFramebufferCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 6038 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6039 | uint64_t cgen_var_443 = (uint64_t)(uintptr_t)local_pAllocator; |
| 6040 | stream->putBe64(cgen_var_443); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6041 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6042 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6043 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6044 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6045 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6046 | uint64_t cgen_var_444; |
| 6047 | stream->handleMapping()->mapHandles_VkFramebuffer_u64(pFramebuffer, &cgen_var_444, 1); |
| 6048 | stream->write((uint64_t*)&cgen_var_444, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6049 | stream->setHandleMapping(resources->unwrapMapping()); |
| 6050 | stream->setHandleMapping(resources->createMapping()); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6051 | uint64_t cgen_var_445; |
| 6052 | stream->read((uint64_t*)&cgen_var_445, 8); |
| 6053 | stream->handleMapping()->mapHandles_u64_VkFramebuffer(&cgen_var_445, (VkFramebuffer*)pFramebuffer, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6054 | stream->unsetHandleMapping(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6055 | VkResult vkCreateFramebuffer_VkResult_return = (VkResult)0; |
| 6056 | stream->read(&vkCreateFramebuffer_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 6057 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6058 | countingStream->clearPool(); |
| 6059 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6060 | mImpl->log("finish vkCreateFramebuffer");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6061 | return vkCreateFramebuffer_VkResult_return; |
| 6062 | } |
| 6063 | |
| 6064 | void VkEncoder::vkDestroyFramebuffer( |
| 6065 | VkDevice device, |
| 6066 | VkFramebuffer framebuffer, |
| 6067 | const VkAllocationCallbacks* pAllocator) |
| 6068 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 6069 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6070 | mImpl->log("start vkDestroyFramebuffer"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6071 | auto stream = mImpl->stream(); |
| 6072 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6073 | auto resources = mImpl->resources(); |
| 6074 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6075 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6076 | VkDevice local_device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 6077 | VkFramebuffer local_framebuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6078 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 6079 | local_device = device; |
| 6080 | local_framebuffer = framebuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6081 | local_pAllocator = nullptr; |
| 6082 | if (pAllocator) |
| 6083 | { |
| 6084 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 6085 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 6086 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 6087 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 6088 | if (local_pAllocator) |
| 6089 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 6090 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 6091 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6092 | countingStream->rewind(); |
| 6093 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6094 | uint64_t cgen_var_446; |
| 6095 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_446, 1); |
| 6096 | countingStream->write((uint64_t*)&cgen_var_446, 1 * 8); |
| 6097 | uint64_t cgen_var_447; |
| 6098 | countingStream->handleMapping()->mapHandles_VkFramebuffer_u64(&local_framebuffer, &cgen_var_447, 1); |
| 6099 | countingStream->write((uint64_t*)&cgen_var_447, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 6100 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6101 | uint64_t cgen_var_448 = (uint64_t)(uintptr_t)local_pAllocator; |
| 6102 | countingStream->putBe64(cgen_var_448); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6103 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6104 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6105 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6106 | } |
| 6107 | } |
| 6108 | uint32_t packetSize_vkDestroyFramebuffer = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 6109 | countingStream->rewind(); |
| 6110 | uint32_t opcode_vkDestroyFramebuffer = OP_vkDestroyFramebuffer; |
| 6111 | stream->write(&opcode_vkDestroyFramebuffer, sizeof(uint32_t)); |
| 6112 | stream->write(&packetSize_vkDestroyFramebuffer, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6113 | uint64_t cgen_var_449; |
| 6114 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_449, 1); |
| 6115 | stream->write((uint64_t*)&cgen_var_449, 1 * 8); |
| 6116 | uint64_t cgen_var_450; |
| 6117 | stream->handleMapping()->mapHandles_VkFramebuffer_u64(&local_framebuffer, &cgen_var_450, 1); |
| 6118 | stream->write((uint64_t*)&cgen_var_450, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 6119 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6120 | uint64_t cgen_var_451 = (uint64_t)(uintptr_t)local_pAllocator; |
| 6121 | stream->putBe64(cgen_var_451); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6122 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6123 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6124 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6125 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6126 | resources->destroyMapping()->mapHandles_VkFramebuffer((VkFramebuffer*)&framebuffer); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 6127 | pool->freeAll(); |
| 6128 | countingStream->clearPool(); |
| 6129 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6130 | mImpl->log("finish vkDestroyFramebuffer");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6131 | } |
| 6132 | |
| 6133 | VkResult VkEncoder::vkCreateRenderPass( |
| 6134 | VkDevice device, |
| 6135 | const VkRenderPassCreateInfo* pCreateInfo, |
| 6136 | const VkAllocationCallbacks* pAllocator, |
| 6137 | VkRenderPass* pRenderPass) |
| 6138 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 6139 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6140 | mImpl->log("start vkCreateRenderPass"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6141 | auto stream = mImpl->stream(); |
| 6142 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6143 | auto resources = mImpl->resources(); |
| 6144 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6145 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6146 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6147 | VkRenderPassCreateInfo* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 6148 | VkAllocationCallbacks* local_pAllocator; |
| 6149 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6150 | local_pCreateInfo = nullptr; |
| 6151 | if (pCreateInfo) |
| 6152 | { |
| 6153 | local_pCreateInfo = (VkRenderPassCreateInfo*)pool->alloc(sizeof(const VkRenderPassCreateInfo)); |
| 6154 | deepcopy_VkRenderPassCreateInfo(pool, pCreateInfo, (VkRenderPassCreateInfo*)(local_pCreateInfo)); |
| 6155 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6156 | local_pAllocator = nullptr; |
| 6157 | if (pAllocator) |
| 6158 | { |
| 6159 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 6160 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 6161 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 6162 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 6163 | if (local_pCreateInfo) |
| 6164 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 6165 | transform_tohost_VkRenderPassCreateInfo(mImpl->resources(), (VkRenderPassCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 6166 | } |
| 6167 | if (local_pAllocator) |
| 6168 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 6169 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 6170 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6171 | countingStream->rewind(); |
| 6172 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6173 | uint64_t cgen_var_452; |
| 6174 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_452, 1); |
| 6175 | countingStream->write((uint64_t*)&cgen_var_452, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6176 | marshal_VkRenderPassCreateInfo(countingStream, (VkRenderPassCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 6177 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6178 | uint64_t cgen_var_453 = (uint64_t)(uintptr_t)local_pAllocator; |
| 6179 | countingStream->putBe64(cgen_var_453); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6180 | if (local_pAllocator) |
| 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 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6183 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6184 | uint64_t cgen_var_454; |
| 6185 | countingStream->handleMapping()->mapHandles_VkRenderPass_u64(pRenderPass, &cgen_var_454, 1); |
| 6186 | countingStream->write((uint64_t*)&cgen_var_454, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6187 | } |
| 6188 | uint32_t packetSize_vkCreateRenderPass = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 6189 | countingStream->rewind(); |
| 6190 | uint32_t opcode_vkCreateRenderPass = OP_vkCreateRenderPass; |
| 6191 | stream->write(&opcode_vkCreateRenderPass, sizeof(uint32_t)); |
| 6192 | stream->write(&packetSize_vkCreateRenderPass, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6193 | uint64_t cgen_var_455; |
| 6194 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_455, 1); |
| 6195 | stream->write((uint64_t*)&cgen_var_455, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6196 | marshal_VkRenderPassCreateInfo(stream, (VkRenderPassCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 6197 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6198 | uint64_t cgen_var_456 = (uint64_t)(uintptr_t)local_pAllocator; |
| 6199 | stream->putBe64(cgen_var_456); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6200 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6201 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6202 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6203 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6204 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6205 | uint64_t cgen_var_457; |
| 6206 | stream->handleMapping()->mapHandles_VkRenderPass_u64(pRenderPass, &cgen_var_457, 1); |
| 6207 | stream->write((uint64_t*)&cgen_var_457, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6208 | stream->setHandleMapping(resources->unwrapMapping()); |
| 6209 | stream->setHandleMapping(resources->createMapping()); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6210 | uint64_t cgen_var_458; |
| 6211 | stream->read((uint64_t*)&cgen_var_458, 8); |
| 6212 | stream->handleMapping()->mapHandles_u64_VkRenderPass(&cgen_var_458, (VkRenderPass*)pRenderPass, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6213 | stream->unsetHandleMapping(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6214 | VkResult vkCreateRenderPass_VkResult_return = (VkResult)0; |
| 6215 | stream->read(&vkCreateRenderPass_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 6216 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6217 | countingStream->clearPool(); |
| 6218 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6219 | mImpl->log("finish vkCreateRenderPass");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6220 | return vkCreateRenderPass_VkResult_return; |
| 6221 | } |
| 6222 | |
| 6223 | void VkEncoder::vkDestroyRenderPass( |
| 6224 | VkDevice device, |
| 6225 | VkRenderPass renderPass, |
| 6226 | const VkAllocationCallbacks* pAllocator) |
| 6227 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 6228 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6229 | mImpl->log("start vkDestroyRenderPass"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6230 | auto stream = mImpl->stream(); |
| 6231 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6232 | auto resources = mImpl->resources(); |
| 6233 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6234 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6235 | VkDevice local_device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 6236 | VkRenderPass local_renderPass; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6237 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 6238 | local_device = device; |
| 6239 | local_renderPass = renderPass; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6240 | local_pAllocator = nullptr; |
| 6241 | if (pAllocator) |
| 6242 | { |
| 6243 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 6244 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 6245 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 6246 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 6247 | if (local_pAllocator) |
| 6248 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 6249 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 6250 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6251 | countingStream->rewind(); |
| 6252 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6253 | uint64_t cgen_var_459; |
| 6254 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_459, 1); |
| 6255 | countingStream->write((uint64_t*)&cgen_var_459, 1 * 8); |
| 6256 | uint64_t cgen_var_460; |
| 6257 | countingStream->handleMapping()->mapHandles_VkRenderPass_u64(&local_renderPass, &cgen_var_460, 1); |
| 6258 | countingStream->write((uint64_t*)&cgen_var_460, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 6259 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6260 | uint64_t cgen_var_461 = (uint64_t)(uintptr_t)local_pAllocator; |
| 6261 | countingStream->putBe64(cgen_var_461); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6262 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6263 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6264 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6265 | } |
| 6266 | } |
| 6267 | uint32_t packetSize_vkDestroyRenderPass = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 6268 | countingStream->rewind(); |
| 6269 | uint32_t opcode_vkDestroyRenderPass = OP_vkDestroyRenderPass; |
| 6270 | stream->write(&opcode_vkDestroyRenderPass, sizeof(uint32_t)); |
| 6271 | stream->write(&packetSize_vkDestroyRenderPass, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6272 | uint64_t cgen_var_462; |
| 6273 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_462, 1); |
| 6274 | stream->write((uint64_t*)&cgen_var_462, 1 * 8); |
| 6275 | uint64_t cgen_var_463; |
| 6276 | stream->handleMapping()->mapHandles_VkRenderPass_u64(&local_renderPass, &cgen_var_463, 1); |
| 6277 | stream->write((uint64_t*)&cgen_var_463, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 6278 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6279 | uint64_t cgen_var_464 = (uint64_t)(uintptr_t)local_pAllocator; |
| 6280 | stream->putBe64(cgen_var_464); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6281 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6282 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6283 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6284 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6285 | resources->destroyMapping()->mapHandles_VkRenderPass((VkRenderPass*)&renderPass); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 6286 | pool->freeAll(); |
| 6287 | countingStream->clearPool(); |
| 6288 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6289 | mImpl->log("finish vkDestroyRenderPass");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6290 | } |
| 6291 | |
| 6292 | void VkEncoder::vkGetRenderAreaGranularity( |
| 6293 | VkDevice device, |
| 6294 | VkRenderPass renderPass, |
| 6295 | VkExtent2D* pGranularity) |
| 6296 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 6297 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6298 | mImpl->log("start vkGetRenderAreaGranularity"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6299 | auto stream = mImpl->stream(); |
| 6300 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6301 | auto resources = mImpl->resources(); |
| 6302 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6303 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6304 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6305 | VkRenderPass local_renderPass; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 6306 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6307 | local_renderPass = renderPass; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6308 | countingStream->rewind(); |
| 6309 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6310 | uint64_t cgen_var_465; |
| 6311 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_465, 1); |
| 6312 | countingStream->write((uint64_t*)&cgen_var_465, 1 * 8); |
| 6313 | uint64_t cgen_var_466; |
| 6314 | countingStream->handleMapping()->mapHandles_VkRenderPass_u64(&local_renderPass, &cgen_var_466, 1); |
| 6315 | countingStream->write((uint64_t*)&cgen_var_466, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6316 | marshal_VkExtent2D(countingStream, (VkExtent2D*)(pGranularity)); |
| 6317 | } |
| 6318 | uint32_t packetSize_vkGetRenderAreaGranularity = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 6319 | countingStream->rewind(); |
| 6320 | uint32_t opcode_vkGetRenderAreaGranularity = OP_vkGetRenderAreaGranularity; |
| 6321 | stream->write(&opcode_vkGetRenderAreaGranularity, sizeof(uint32_t)); |
| 6322 | stream->write(&packetSize_vkGetRenderAreaGranularity, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6323 | uint64_t cgen_var_467; |
| 6324 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_467, 1); |
| 6325 | stream->write((uint64_t*)&cgen_var_467, 1 * 8); |
| 6326 | uint64_t cgen_var_468; |
| 6327 | stream->handleMapping()->mapHandles_VkRenderPass_u64(&local_renderPass, &cgen_var_468, 1); |
| 6328 | stream->write((uint64_t*)&cgen_var_468, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6329 | marshal_VkExtent2D(stream, (VkExtent2D*)(pGranularity)); |
| 6330 | unmarshal_VkExtent2D(stream, (VkExtent2D*)(pGranularity)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 6331 | if (pGranularity) |
| 6332 | { |
| 6333 | transform_fromhost_VkExtent2D(mImpl->resources(), (VkExtent2D*)(pGranularity)); |
| 6334 | } |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 6335 | pool->freeAll(); |
| 6336 | countingStream->clearPool(); |
| 6337 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6338 | mImpl->log("finish vkGetRenderAreaGranularity");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6339 | } |
| 6340 | |
| 6341 | VkResult VkEncoder::vkCreateCommandPool( |
| 6342 | VkDevice device, |
| 6343 | const VkCommandPoolCreateInfo* pCreateInfo, |
| 6344 | const VkAllocationCallbacks* pAllocator, |
| 6345 | VkCommandPool* pCommandPool) |
| 6346 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 6347 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6348 | mImpl->log("start vkCreateCommandPool"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6349 | auto stream = mImpl->stream(); |
| 6350 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6351 | auto resources = mImpl->resources(); |
| 6352 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6353 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6354 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6355 | VkCommandPoolCreateInfo* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 6356 | VkAllocationCallbacks* local_pAllocator; |
| 6357 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6358 | local_pCreateInfo = nullptr; |
| 6359 | if (pCreateInfo) |
| 6360 | { |
| 6361 | local_pCreateInfo = (VkCommandPoolCreateInfo*)pool->alloc(sizeof(const VkCommandPoolCreateInfo)); |
| 6362 | deepcopy_VkCommandPoolCreateInfo(pool, pCreateInfo, (VkCommandPoolCreateInfo*)(local_pCreateInfo)); |
| 6363 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6364 | local_pAllocator = nullptr; |
| 6365 | if (pAllocator) |
| 6366 | { |
| 6367 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 6368 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 6369 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 6370 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 6371 | if (local_pCreateInfo) |
| 6372 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 6373 | transform_tohost_VkCommandPoolCreateInfo(mImpl->resources(), (VkCommandPoolCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 6374 | } |
| 6375 | if (local_pAllocator) |
| 6376 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 6377 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 6378 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6379 | countingStream->rewind(); |
| 6380 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6381 | uint64_t cgen_var_469; |
| 6382 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_469, 1); |
| 6383 | countingStream->write((uint64_t*)&cgen_var_469, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6384 | marshal_VkCommandPoolCreateInfo(countingStream, (VkCommandPoolCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 6385 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6386 | uint64_t cgen_var_470 = (uint64_t)(uintptr_t)local_pAllocator; |
| 6387 | countingStream->putBe64(cgen_var_470); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6388 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6389 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6390 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6391 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6392 | uint64_t cgen_var_471; |
| 6393 | countingStream->handleMapping()->mapHandles_VkCommandPool_u64(pCommandPool, &cgen_var_471, 1); |
| 6394 | countingStream->write((uint64_t*)&cgen_var_471, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6395 | } |
| 6396 | uint32_t packetSize_vkCreateCommandPool = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 6397 | countingStream->rewind(); |
| 6398 | uint32_t opcode_vkCreateCommandPool = OP_vkCreateCommandPool; |
| 6399 | stream->write(&opcode_vkCreateCommandPool, sizeof(uint32_t)); |
| 6400 | stream->write(&packetSize_vkCreateCommandPool, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6401 | uint64_t cgen_var_472; |
| 6402 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_472, 1); |
| 6403 | stream->write((uint64_t*)&cgen_var_472, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6404 | marshal_VkCommandPoolCreateInfo(stream, (VkCommandPoolCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 6405 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6406 | uint64_t cgen_var_473 = (uint64_t)(uintptr_t)local_pAllocator; |
| 6407 | stream->putBe64(cgen_var_473); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6408 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6409 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6410 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6411 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6412 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6413 | uint64_t cgen_var_474; |
| 6414 | stream->handleMapping()->mapHandles_VkCommandPool_u64(pCommandPool, &cgen_var_474, 1); |
| 6415 | stream->write((uint64_t*)&cgen_var_474, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6416 | stream->setHandleMapping(resources->unwrapMapping()); |
| 6417 | stream->setHandleMapping(resources->createMapping()); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6418 | uint64_t cgen_var_475; |
| 6419 | stream->read((uint64_t*)&cgen_var_475, 8); |
| 6420 | stream->handleMapping()->mapHandles_u64_VkCommandPool(&cgen_var_475, (VkCommandPool*)pCommandPool, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6421 | stream->unsetHandleMapping(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6422 | VkResult vkCreateCommandPool_VkResult_return = (VkResult)0; |
| 6423 | stream->read(&vkCreateCommandPool_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 6424 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6425 | countingStream->clearPool(); |
| 6426 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6427 | mImpl->log("finish vkCreateCommandPool");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6428 | return vkCreateCommandPool_VkResult_return; |
| 6429 | } |
| 6430 | |
| 6431 | void VkEncoder::vkDestroyCommandPool( |
| 6432 | VkDevice device, |
| 6433 | VkCommandPool commandPool, |
| 6434 | const VkAllocationCallbacks* pAllocator) |
| 6435 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 6436 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6437 | mImpl->log("start vkDestroyCommandPool"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6438 | auto stream = mImpl->stream(); |
| 6439 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6440 | auto resources = mImpl->resources(); |
| 6441 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6442 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6443 | VkDevice local_device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 6444 | VkCommandPool local_commandPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6445 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 6446 | local_device = device; |
| 6447 | local_commandPool = commandPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6448 | local_pAllocator = nullptr; |
| 6449 | if (pAllocator) |
| 6450 | { |
| 6451 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 6452 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 6453 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 6454 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 6455 | if (local_pAllocator) |
| 6456 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 6457 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 6458 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6459 | countingStream->rewind(); |
| 6460 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6461 | uint64_t cgen_var_476; |
| 6462 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_476, 1); |
| 6463 | countingStream->write((uint64_t*)&cgen_var_476, 1 * 8); |
| 6464 | uint64_t cgen_var_477; |
| 6465 | countingStream->handleMapping()->mapHandles_VkCommandPool_u64(&local_commandPool, &cgen_var_477, 1); |
| 6466 | countingStream->write((uint64_t*)&cgen_var_477, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 6467 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6468 | uint64_t cgen_var_478 = (uint64_t)(uintptr_t)local_pAllocator; |
| 6469 | countingStream->putBe64(cgen_var_478); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6470 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6471 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6472 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6473 | } |
| 6474 | } |
| 6475 | uint32_t packetSize_vkDestroyCommandPool = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 6476 | countingStream->rewind(); |
| 6477 | uint32_t opcode_vkDestroyCommandPool = OP_vkDestroyCommandPool; |
| 6478 | stream->write(&opcode_vkDestroyCommandPool, sizeof(uint32_t)); |
| 6479 | stream->write(&packetSize_vkDestroyCommandPool, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6480 | uint64_t cgen_var_479; |
| 6481 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_479, 1); |
| 6482 | stream->write((uint64_t*)&cgen_var_479, 1 * 8); |
| 6483 | uint64_t cgen_var_480; |
| 6484 | stream->handleMapping()->mapHandles_VkCommandPool_u64(&local_commandPool, &cgen_var_480, 1); |
| 6485 | stream->write((uint64_t*)&cgen_var_480, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 6486 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6487 | uint64_t cgen_var_481 = (uint64_t)(uintptr_t)local_pAllocator; |
| 6488 | stream->putBe64(cgen_var_481); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6489 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6490 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6491 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6492 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6493 | resources->destroyMapping()->mapHandles_VkCommandPool((VkCommandPool*)&commandPool); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 6494 | pool->freeAll(); |
| 6495 | countingStream->clearPool(); |
| 6496 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6497 | mImpl->log("finish vkDestroyCommandPool");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6498 | } |
| 6499 | |
| 6500 | VkResult VkEncoder::vkResetCommandPool( |
| 6501 | VkDevice device, |
| 6502 | VkCommandPool commandPool, |
| 6503 | VkCommandPoolResetFlags flags) |
| 6504 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 6505 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6506 | mImpl->log("start vkResetCommandPool"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6507 | auto stream = mImpl->stream(); |
| 6508 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6509 | auto resources = mImpl->resources(); |
| 6510 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6511 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6512 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6513 | VkCommandPool local_commandPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6514 | VkCommandPoolResetFlags local_flags; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 6515 | local_device = device; |
| 6516 | local_commandPool = commandPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6517 | local_flags = flags; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6518 | countingStream->rewind(); |
| 6519 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6520 | uint64_t cgen_var_482; |
| 6521 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_482, 1); |
| 6522 | countingStream->write((uint64_t*)&cgen_var_482, 1 * 8); |
| 6523 | uint64_t cgen_var_483; |
| 6524 | countingStream->handleMapping()->mapHandles_VkCommandPool_u64(&local_commandPool, &cgen_var_483, 1); |
| 6525 | countingStream->write((uint64_t*)&cgen_var_483, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6526 | countingStream->write((VkCommandPoolResetFlags*)&local_flags, sizeof(VkCommandPoolResetFlags)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6527 | } |
| 6528 | uint32_t packetSize_vkResetCommandPool = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 6529 | countingStream->rewind(); |
| 6530 | uint32_t opcode_vkResetCommandPool = OP_vkResetCommandPool; |
| 6531 | stream->write(&opcode_vkResetCommandPool, sizeof(uint32_t)); |
| 6532 | stream->write(&packetSize_vkResetCommandPool, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6533 | uint64_t cgen_var_484; |
| 6534 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_484, 1); |
| 6535 | stream->write((uint64_t*)&cgen_var_484, 1 * 8); |
| 6536 | uint64_t cgen_var_485; |
| 6537 | stream->handleMapping()->mapHandles_VkCommandPool_u64(&local_commandPool, &cgen_var_485, 1); |
| 6538 | stream->write((uint64_t*)&cgen_var_485, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6539 | stream->write((VkCommandPoolResetFlags*)&local_flags, sizeof(VkCommandPoolResetFlags)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6540 | VkResult vkResetCommandPool_VkResult_return = (VkResult)0; |
| 6541 | stream->read(&vkResetCommandPool_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 6542 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6543 | countingStream->clearPool(); |
| 6544 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6545 | mImpl->log("finish vkResetCommandPool");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6546 | return vkResetCommandPool_VkResult_return; |
| 6547 | } |
| 6548 | |
| 6549 | VkResult VkEncoder::vkAllocateCommandBuffers( |
| 6550 | VkDevice device, |
| 6551 | const VkCommandBufferAllocateInfo* pAllocateInfo, |
| 6552 | VkCommandBuffer* pCommandBuffers) |
| 6553 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 6554 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6555 | mImpl->log("start vkAllocateCommandBuffers"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6556 | auto stream = mImpl->stream(); |
| 6557 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6558 | auto resources = mImpl->resources(); |
| 6559 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6560 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6561 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6562 | VkCommandBufferAllocateInfo* local_pAllocateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 6563 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6564 | local_pAllocateInfo = nullptr; |
| 6565 | if (pAllocateInfo) |
| 6566 | { |
| 6567 | local_pAllocateInfo = (VkCommandBufferAllocateInfo*)pool->alloc(sizeof(const VkCommandBufferAllocateInfo)); |
| 6568 | deepcopy_VkCommandBufferAllocateInfo(pool, pAllocateInfo, (VkCommandBufferAllocateInfo*)(local_pAllocateInfo)); |
| 6569 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 6570 | if (local_pAllocateInfo) |
| 6571 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 6572 | transform_tohost_VkCommandBufferAllocateInfo(mImpl->resources(), (VkCommandBufferAllocateInfo*)(local_pAllocateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 6573 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6574 | countingStream->rewind(); |
| 6575 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6576 | uint64_t cgen_var_486; |
| 6577 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_486, 1); |
| 6578 | countingStream->write((uint64_t*)&cgen_var_486, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6579 | marshal_VkCommandBufferAllocateInfo(countingStream, (VkCommandBufferAllocateInfo*)(local_pAllocateInfo)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6580 | if (pAllocateInfo->commandBufferCount) |
| 6581 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6582 | uint64_t* cgen_var_487; |
| 6583 | countingStream->alloc((void**)&cgen_var_487, pAllocateInfo->commandBufferCount * 8); |
| 6584 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(pCommandBuffers, cgen_var_487, pAllocateInfo->commandBufferCount); |
| 6585 | countingStream->write((uint64_t*)cgen_var_487, pAllocateInfo->commandBufferCount * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6586 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6587 | } |
| 6588 | uint32_t packetSize_vkAllocateCommandBuffers = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 6589 | countingStream->rewind(); |
| 6590 | uint32_t opcode_vkAllocateCommandBuffers = OP_vkAllocateCommandBuffers; |
| 6591 | stream->write(&opcode_vkAllocateCommandBuffers, sizeof(uint32_t)); |
| 6592 | stream->write(&packetSize_vkAllocateCommandBuffers, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6593 | uint64_t cgen_var_488; |
| 6594 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_488, 1); |
| 6595 | stream->write((uint64_t*)&cgen_var_488, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6596 | marshal_VkCommandBufferAllocateInfo(stream, (VkCommandBufferAllocateInfo*)(local_pAllocateInfo)); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6597 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6598 | if (pAllocateInfo->commandBufferCount) |
| 6599 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6600 | uint64_t* cgen_var_489; |
| 6601 | stream->alloc((void**)&cgen_var_489, pAllocateInfo->commandBufferCount * 8); |
| 6602 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(pCommandBuffers, cgen_var_489, pAllocateInfo->commandBufferCount); |
| 6603 | stream->write((uint64_t*)cgen_var_489, pAllocateInfo->commandBufferCount * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6604 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6605 | stream->setHandleMapping(resources->unwrapMapping()); |
| 6606 | stream->setHandleMapping(resources->createMapping()); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6607 | if (pAllocateInfo->commandBufferCount) |
| 6608 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6609 | uint64_t* cgen_var_490; |
| 6610 | stream->alloc((void**)&cgen_var_490, pAllocateInfo->commandBufferCount * 8); |
| 6611 | stream->read((uint64_t*)cgen_var_490, pAllocateInfo->commandBufferCount * 8); |
| 6612 | stream->handleMapping()->mapHandles_u64_VkCommandBuffer(cgen_var_490, (VkCommandBuffer*)pCommandBuffers, pAllocateInfo->commandBufferCount); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6613 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6614 | stream->unsetHandleMapping(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6615 | VkResult vkAllocateCommandBuffers_VkResult_return = (VkResult)0; |
| 6616 | stream->read(&vkAllocateCommandBuffers_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 6617 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6618 | countingStream->clearPool(); |
| 6619 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6620 | mImpl->log("finish vkAllocateCommandBuffers");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6621 | return vkAllocateCommandBuffers_VkResult_return; |
| 6622 | } |
| 6623 | |
| 6624 | void VkEncoder::vkFreeCommandBuffers( |
| 6625 | VkDevice device, |
| 6626 | VkCommandPool commandPool, |
| 6627 | uint32_t commandBufferCount, |
| 6628 | const VkCommandBuffer* pCommandBuffers) |
| 6629 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 6630 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6631 | mImpl->log("start vkFreeCommandBuffers"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6632 | auto stream = mImpl->stream(); |
| 6633 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6634 | auto resources = mImpl->resources(); |
| 6635 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6636 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6637 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6638 | VkCommandPool local_commandPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6639 | uint32_t local_commandBufferCount; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 6640 | VkCommandBuffer* local_pCommandBuffers; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 6641 | local_device = device; |
| 6642 | local_commandPool = commandPool; |
| 6643 | local_commandBufferCount = commandBufferCount; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 6644 | local_pCommandBuffers = nullptr; |
| 6645 | if (pCommandBuffers) |
| 6646 | { |
| 6647 | local_pCommandBuffers = (VkCommandBuffer*)pool->dupArray(pCommandBuffers, ((commandBufferCount)) * sizeof(const VkCommandBuffer)); |
| 6648 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6649 | countingStream->rewind(); |
| 6650 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6651 | uint64_t cgen_var_491; |
| 6652 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_491, 1); |
| 6653 | countingStream->write((uint64_t*)&cgen_var_491, 1 * 8); |
| 6654 | uint64_t cgen_var_492; |
| 6655 | countingStream->handleMapping()->mapHandles_VkCommandPool_u64(&local_commandPool, &cgen_var_492, 1); |
| 6656 | countingStream->write((uint64_t*)&cgen_var_492, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6657 | countingStream->write((uint32_t*)&local_commandBufferCount, sizeof(uint32_t)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 6658 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6659 | uint64_t cgen_var_493 = (uint64_t)(uintptr_t)local_pCommandBuffers; |
| 6660 | countingStream->putBe64(cgen_var_493); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 6661 | if (local_pCommandBuffers) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6662 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6663 | if (((commandBufferCount))) |
| 6664 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6665 | uint64_t* cgen_var_494; |
| 6666 | countingStream->alloc((void**)&cgen_var_494, ((commandBufferCount)) * 8); |
| 6667 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(local_pCommandBuffers, cgen_var_494, ((commandBufferCount))); |
| 6668 | countingStream->write((uint64_t*)cgen_var_494, ((commandBufferCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6669 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6670 | } |
| 6671 | } |
| 6672 | uint32_t packetSize_vkFreeCommandBuffers = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 6673 | countingStream->rewind(); |
| 6674 | uint32_t opcode_vkFreeCommandBuffers = OP_vkFreeCommandBuffers; |
| 6675 | stream->write(&opcode_vkFreeCommandBuffers, sizeof(uint32_t)); |
| 6676 | stream->write(&packetSize_vkFreeCommandBuffers, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6677 | uint64_t cgen_var_495; |
| 6678 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_495, 1); |
| 6679 | stream->write((uint64_t*)&cgen_var_495, 1 * 8); |
| 6680 | uint64_t cgen_var_496; |
| 6681 | stream->handleMapping()->mapHandles_VkCommandPool_u64(&local_commandPool, &cgen_var_496, 1); |
| 6682 | stream->write((uint64_t*)&cgen_var_496, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6683 | stream->write((uint32_t*)&local_commandBufferCount, sizeof(uint32_t)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 6684 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6685 | uint64_t cgen_var_497 = (uint64_t)(uintptr_t)local_pCommandBuffers; |
| 6686 | stream->putBe64(cgen_var_497); |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 6687 | if (local_pCommandBuffers) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6688 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6689 | if (((commandBufferCount))) |
| 6690 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6691 | uint64_t* cgen_var_498; |
| 6692 | stream->alloc((void**)&cgen_var_498, ((commandBufferCount)) * 8); |
| 6693 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(local_pCommandBuffers, cgen_var_498, ((commandBufferCount))); |
| 6694 | stream->write((uint64_t*)cgen_var_498, ((commandBufferCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6695 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6696 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6697 | if (pCommandBuffers) |
| 6698 | { |
| 6699 | resources->destroyMapping()->mapHandles_VkCommandBuffer((VkCommandBuffer*)pCommandBuffers, ((commandBufferCount))); |
| 6700 | } |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 6701 | pool->freeAll(); |
| 6702 | countingStream->clearPool(); |
| 6703 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6704 | mImpl->log("finish vkFreeCommandBuffers");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6705 | } |
| 6706 | |
| 6707 | VkResult VkEncoder::vkBeginCommandBuffer( |
| 6708 | VkCommandBuffer commandBuffer, |
| 6709 | const VkCommandBufferBeginInfo* pBeginInfo) |
| 6710 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 6711 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6712 | mImpl->log("start vkBeginCommandBuffer"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6713 | auto stream = mImpl->stream(); |
| 6714 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6715 | auto resources = mImpl->resources(); |
| 6716 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6717 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6718 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6719 | VkCommandBufferBeginInfo* local_pBeginInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 6720 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6721 | local_pBeginInfo = nullptr; |
| 6722 | if (pBeginInfo) |
| 6723 | { |
| 6724 | local_pBeginInfo = (VkCommandBufferBeginInfo*)pool->alloc(sizeof(const VkCommandBufferBeginInfo)); |
| 6725 | deepcopy_VkCommandBufferBeginInfo(pool, pBeginInfo, (VkCommandBufferBeginInfo*)(local_pBeginInfo)); |
| 6726 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 6727 | if (local_pBeginInfo) |
| 6728 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 6729 | transform_tohost_VkCommandBufferBeginInfo(mImpl->resources(), (VkCommandBufferBeginInfo*)(local_pBeginInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 6730 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6731 | countingStream->rewind(); |
| 6732 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6733 | uint64_t cgen_var_499; |
| 6734 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_499, 1); |
| 6735 | countingStream->write((uint64_t*)&cgen_var_499, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6736 | marshal_VkCommandBufferBeginInfo(countingStream, (VkCommandBufferBeginInfo*)(local_pBeginInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6737 | } |
| 6738 | uint32_t packetSize_vkBeginCommandBuffer = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 6739 | countingStream->rewind(); |
| 6740 | uint32_t opcode_vkBeginCommandBuffer = OP_vkBeginCommandBuffer; |
| 6741 | stream->write(&opcode_vkBeginCommandBuffer, sizeof(uint32_t)); |
| 6742 | stream->write(&packetSize_vkBeginCommandBuffer, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6743 | uint64_t cgen_var_500; |
| 6744 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_500, 1); |
| 6745 | stream->write((uint64_t*)&cgen_var_500, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6746 | marshal_VkCommandBufferBeginInfo(stream, (VkCommandBufferBeginInfo*)(local_pBeginInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6747 | VkResult vkBeginCommandBuffer_VkResult_return = (VkResult)0; |
| 6748 | stream->read(&vkBeginCommandBuffer_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 6749 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6750 | countingStream->clearPool(); |
| 6751 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6752 | mImpl->log("finish vkBeginCommandBuffer");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6753 | return vkBeginCommandBuffer_VkResult_return; |
| 6754 | } |
| 6755 | |
| 6756 | VkResult VkEncoder::vkEndCommandBuffer( |
| 6757 | VkCommandBuffer commandBuffer) |
| 6758 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 6759 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6760 | mImpl->log("start vkEndCommandBuffer"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6761 | auto stream = mImpl->stream(); |
| 6762 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6763 | auto resources = mImpl->resources(); |
| 6764 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6765 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6766 | VkCommandBuffer local_commandBuffer; |
| 6767 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6768 | countingStream->rewind(); |
| 6769 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6770 | uint64_t cgen_var_501; |
| 6771 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_501, 1); |
| 6772 | countingStream->write((uint64_t*)&cgen_var_501, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6773 | } |
| 6774 | uint32_t packetSize_vkEndCommandBuffer = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 6775 | countingStream->rewind(); |
| 6776 | uint32_t opcode_vkEndCommandBuffer = OP_vkEndCommandBuffer; |
| 6777 | stream->write(&opcode_vkEndCommandBuffer, sizeof(uint32_t)); |
| 6778 | stream->write(&packetSize_vkEndCommandBuffer, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6779 | uint64_t cgen_var_502; |
| 6780 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_502, 1); |
| 6781 | stream->write((uint64_t*)&cgen_var_502, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6782 | VkResult vkEndCommandBuffer_VkResult_return = (VkResult)0; |
| 6783 | stream->read(&vkEndCommandBuffer_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 6784 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6785 | countingStream->clearPool(); |
| 6786 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6787 | mImpl->log("finish vkEndCommandBuffer");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6788 | return vkEndCommandBuffer_VkResult_return; |
| 6789 | } |
| 6790 | |
| 6791 | VkResult VkEncoder::vkResetCommandBuffer( |
| 6792 | VkCommandBuffer commandBuffer, |
| 6793 | VkCommandBufferResetFlags flags) |
| 6794 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 6795 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6796 | mImpl->log("start vkResetCommandBuffer"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6797 | auto stream = mImpl->stream(); |
| 6798 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6799 | auto resources = mImpl->resources(); |
| 6800 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6801 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6802 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6803 | VkCommandBufferResetFlags local_flags; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 6804 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6805 | local_flags = flags; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6806 | countingStream->rewind(); |
| 6807 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6808 | uint64_t cgen_var_503; |
| 6809 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_503, 1); |
| 6810 | countingStream->write((uint64_t*)&cgen_var_503, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6811 | countingStream->write((VkCommandBufferResetFlags*)&local_flags, sizeof(VkCommandBufferResetFlags)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6812 | } |
| 6813 | uint32_t packetSize_vkResetCommandBuffer = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 6814 | countingStream->rewind(); |
| 6815 | uint32_t opcode_vkResetCommandBuffer = OP_vkResetCommandBuffer; |
| 6816 | stream->write(&opcode_vkResetCommandBuffer, sizeof(uint32_t)); |
| 6817 | stream->write(&packetSize_vkResetCommandBuffer, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6818 | uint64_t cgen_var_504; |
| 6819 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_504, 1); |
| 6820 | stream->write((uint64_t*)&cgen_var_504, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6821 | stream->write((VkCommandBufferResetFlags*)&local_flags, sizeof(VkCommandBufferResetFlags)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6822 | VkResult vkResetCommandBuffer_VkResult_return = (VkResult)0; |
| 6823 | stream->read(&vkResetCommandBuffer_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 6824 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 6825 | countingStream->clearPool(); |
| 6826 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6827 | mImpl->log("finish vkResetCommandBuffer");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6828 | return vkResetCommandBuffer_VkResult_return; |
| 6829 | } |
| 6830 | |
| 6831 | void VkEncoder::vkCmdBindPipeline( |
| 6832 | VkCommandBuffer commandBuffer, |
| 6833 | VkPipelineBindPoint pipelineBindPoint, |
| 6834 | VkPipeline pipeline) |
| 6835 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 6836 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6837 | mImpl->log("start vkCmdBindPipeline"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6838 | auto stream = mImpl->stream(); |
| 6839 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6840 | auto resources = mImpl->resources(); |
| 6841 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6842 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6843 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6844 | VkPipelineBindPoint local_pipelineBindPoint; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6845 | VkPipeline local_pipeline; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 6846 | local_commandBuffer = commandBuffer; |
| 6847 | local_pipelineBindPoint = pipelineBindPoint; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6848 | local_pipeline = pipeline; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6849 | countingStream->rewind(); |
| 6850 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6851 | uint64_t cgen_var_505; |
| 6852 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_505, 1); |
| 6853 | countingStream->write((uint64_t*)&cgen_var_505, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6854 | countingStream->write((VkPipelineBindPoint*)&local_pipelineBindPoint, sizeof(VkPipelineBindPoint)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6855 | uint64_t cgen_var_506; |
| 6856 | countingStream->handleMapping()->mapHandles_VkPipeline_u64(&local_pipeline, &cgen_var_506, 1); |
| 6857 | countingStream->write((uint64_t*)&cgen_var_506, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6858 | } |
| 6859 | uint32_t packetSize_vkCmdBindPipeline = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 6860 | countingStream->rewind(); |
| 6861 | uint32_t opcode_vkCmdBindPipeline = OP_vkCmdBindPipeline; |
| 6862 | stream->write(&opcode_vkCmdBindPipeline, sizeof(uint32_t)); |
| 6863 | stream->write(&packetSize_vkCmdBindPipeline, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6864 | uint64_t cgen_var_507; |
| 6865 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_507, 1); |
| 6866 | stream->write((uint64_t*)&cgen_var_507, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6867 | stream->write((VkPipelineBindPoint*)&local_pipelineBindPoint, sizeof(VkPipelineBindPoint)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6868 | uint64_t cgen_var_508; |
| 6869 | stream->handleMapping()->mapHandles_VkPipeline_u64(&local_pipeline, &cgen_var_508, 1); |
| 6870 | stream->write((uint64_t*)&cgen_var_508, 1 * 8); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 6871 | pool->freeAll(); |
| 6872 | countingStream->clearPool(); |
| 6873 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6874 | mImpl->log("finish vkCmdBindPipeline");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6875 | } |
| 6876 | |
| 6877 | void VkEncoder::vkCmdSetViewport( |
| 6878 | VkCommandBuffer commandBuffer, |
| 6879 | uint32_t firstViewport, |
| 6880 | uint32_t viewportCount, |
| 6881 | const VkViewport* pViewports) |
| 6882 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 6883 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6884 | mImpl->log("start vkCmdSetViewport"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6885 | auto stream = mImpl->stream(); |
| 6886 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6887 | auto resources = mImpl->resources(); |
| 6888 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6889 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6890 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6891 | uint32_t local_firstViewport; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6892 | uint32_t local_viewportCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6893 | VkViewport* local_pViewports; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 6894 | local_commandBuffer = commandBuffer; |
| 6895 | local_firstViewport = firstViewport; |
| 6896 | local_viewportCount = viewportCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6897 | local_pViewports = nullptr; |
| 6898 | if (pViewports) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6899 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6900 | local_pViewports = (VkViewport*)pool->alloc(((viewportCount)) * sizeof(const VkViewport)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6901 | for (uint32_t i = 0; i < (uint32_t)((viewportCount)); ++i) |
| 6902 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6903 | deepcopy_VkViewport(pool, pViewports + i, (VkViewport*)(local_pViewports + i)); |
| 6904 | } |
| 6905 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 6906 | if (local_pViewports) |
| 6907 | { |
| 6908 | for (uint32_t i = 0; i < (uint32_t)((viewportCount)); ++i) |
| 6909 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 6910 | transform_tohost_VkViewport(mImpl->resources(), (VkViewport*)(local_pViewports + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 6911 | } |
| 6912 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6913 | countingStream->rewind(); |
| 6914 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6915 | uint64_t cgen_var_509; |
| 6916 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_509, 1); |
| 6917 | countingStream->write((uint64_t*)&cgen_var_509, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6918 | countingStream->write((uint32_t*)&local_firstViewport, sizeof(uint32_t)); |
| 6919 | countingStream->write((uint32_t*)&local_viewportCount, sizeof(uint32_t)); |
| 6920 | for (uint32_t i = 0; i < (uint32_t)((viewportCount)); ++i) |
| 6921 | { |
| 6922 | marshal_VkViewport(countingStream, (VkViewport*)(local_pViewports + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6923 | } |
| 6924 | } |
| 6925 | uint32_t packetSize_vkCmdSetViewport = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 6926 | countingStream->rewind(); |
| 6927 | uint32_t opcode_vkCmdSetViewport = OP_vkCmdSetViewport; |
| 6928 | stream->write(&opcode_vkCmdSetViewport, sizeof(uint32_t)); |
| 6929 | stream->write(&packetSize_vkCmdSetViewport, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6930 | uint64_t cgen_var_510; |
| 6931 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_510, 1); |
| 6932 | stream->write((uint64_t*)&cgen_var_510, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6933 | stream->write((uint32_t*)&local_firstViewport, sizeof(uint32_t)); |
| 6934 | stream->write((uint32_t*)&local_viewportCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6935 | for (uint32_t i = 0; i < (uint32_t)((viewportCount)); ++i) |
| 6936 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6937 | marshal_VkViewport(stream, (VkViewport*)(local_pViewports + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6938 | } |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 6939 | pool->freeAll(); |
| 6940 | countingStream->clearPool(); |
| 6941 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6942 | mImpl->log("finish vkCmdSetViewport");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6943 | } |
| 6944 | |
| 6945 | void VkEncoder::vkCmdSetScissor( |
| 6946 | VkCommandBuffer commandBuffer, |
| 6947 | uint32_t firstScissor, |
| 6948 | uint32_t scissorCount, |
| 6949 | const VkRect2D* pScissors) |
| 6950 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 6951 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 6952 | mImpl->log("start vkCmdSetScissor"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6953 | auto stream = mImpl->stream(); |
| 6954 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6955 | auto resources = mImpl->resources(); |
| 6956 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 6957 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6958 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6959 | uint32_t local_firstScissor; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6960 | uint32_t local_scissorCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6961 | VkRect2D* local_pScissors; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 6962 | local_commandBuffer = commandBuffer; |
| 6963 | local_firstScissor = firstScissor; |
| 6964 | local_scissorCount = scissorCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6965 | local_pScissors = nullptr; |
| 6966 | if (pScissors) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6967 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6968 | local_pScissors = (VkRect2D*)pool->alloc(((scissorCount)) * sizeof(const VkRect2D)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6969 | for (uint32_t i = 0; i < (uint32_t)((scissorCount)); ++i) |
| 6970 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6971 | deepcopy_VkRect2D(pool, pScissors + i, (VkRect2D*)(local_pScissors + i)); |
| 6972 | } |
| 6973 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 6974 | if (local_pScissors) |
| 6975 | { |
| 6976 | for (uint32_t i = 0; i < (uint32_t)((scissorCount)); ++i) |
| 6977 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 6978 | transform_tohost_VkRect2D(mImpl->resources(), (VkRect2D*)(local_pScissors + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 6979 | } |
| 6980 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6981 | countingStream->rewind(); |
| 6982 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6983 | uint64_t cgen_var_511; |
| 6984 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_511, 1); |
| 6985 | countingStream->write((uint64_t*)&cgen_var_511, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 6986 | countingStream->write((uint32_t*)&local_firstScissor, sizeof(uint32_t)); |
| 6987 | countingStream->write((uint32_t*)&local_scissorCount, sizeof(uint32_t)); |
| 6988 | for (uint32_t i = 0; i < (uint32_t)((scissorCount)); ++i) |
| 6989 | { |
| 6990 | marshal_VkRect2D(countingStream, (VkRect2D*)(local_pScissors + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 6991 | } |
| 6992 | } |
| 6993 | uint32_t packetSize_vkCmdSetScissor = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 6994 | countingStream->rewind(); |
| 6995 | uint32_t opcode_vkCmdSetScissor = OP_vkCmdSetScissor; |
| 6996 | stream->write(&opcode_vkCmdSetScissor, sizeof(uint32_t)); |
| 6997 | stream->write(&packetSize_vkCmdSetScissor, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 6998 | uint64_t cgen_var_512; |
| 6999 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_512, 1); |
| 7000 | stream->write((uint64_t*)&cgen_var_512, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7001 | stream->write((uint32_t*)&local_firstScissor, sizeof(uint32_t)); |
| 7002 | stream->write((uint32_t*)&local_scissorCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7003 | for (uint32_t i = 0; i < (uint32_t)((scissorCount)); ++i) |
| 7004 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7005 | marshal_VkRect2D(stream, (VkRect2D*)(local_pScissors + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7006 | } |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 7007 | pool->freeAll(); |
| 7008 | countingStream->clearPool(); |
| 7009 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7010 | mImpl->log("finish vkCmdSetScissor");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7011 | } |
| 7012 | |
| 7013 | void VkEncoder::vkCmdSetLineWidth( |
| 7014 | VkCommandBuffer commandBuffer, |
| 7015 | float lineWidth) |
| 7016 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 7017 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7018 | mImpl->log("start vkCmdSetLineWidth"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7019 | auto stream = mImpl->stream(); |
| 7020 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7021 | auto resources = mImpl->resources(); |
| 7022 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 7023 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7024 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7025 | float local_lineWidth; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 7026 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7027 | local_lineWidth = lineWidth; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7028 | countingStream->rewind(); |
| 7029 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7030 | uint64_t cgen_var_513; |
| 7031 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_513, 1); |
| 7032 | countingStream->write((uint64_t*)&cgen_var_513, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7033 | countingStream->write((float*)&local_lineWidth, sizeof(float)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7034 | } |
| 7035 | uint32_t packetSize_vkCmdSetLineWidth = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7036 | countingStream->rewind(); |
| 7037 | uint32_t opcode_vkCmdSetLineWidth = OP_vkCmdSetLineWidth; |
| 7038 | stream->write(&opcode_vkCmdSetLineWidth, sizeof(uint32_t)); |
| 7039 | stream->write(&packetSize_vkCmdSetLineWidth, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7040 | uint64_t cgen_var_514; |
| 7041 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_514, 1); |
| 7042 | stream->write((uint64_t*)&cgen_var_514, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7043 | stream->write((float*)&local_lineWidth, sizeof(float)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 7044 | pool->freeAll(); |
| 7045 | countingStream->clearPool(); |
| 7046 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7047 | mImpl->log("finish vkCmdSetLineWidth");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7048 | } |
| 7049 | |
| 7050 | void VkEncoder::vkCmdSetDepthBias( |
| 7051 | VkCommandBuffer commandBuffer, |
| 7052 | float depthBiasConstantFactor, |
| 7053 | float depthBiasClamp, |
| 7054 | float depthBiasSlopeFactor) |
| 7055 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 7056 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7057 | mImpl->log("start vkCmdSetDepthBias"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7058 | auto stream = mImpl->stream(); |
| 7059 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7060 | auto resources = mImpl->resources(); |
| 7061 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 7062 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7063 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7064 | float local_depthBiasConstantFactor; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7065 | float local_depthBiasClamp; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7066 | float local_depthBiasSlopeFactor; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 7067 | local_commandBuffer = commandBuffer; |
| 7068 | local_depthBiasConstantFactor = depthBiasConstantFactor; |
| 7069 | local_depthBiasClamp = depthBiasClamp; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7070 | local_depthBiasSlopeFactor = depthBiasSlopeFactor; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7071 | countingStream->rewind(); |
| 7072 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7073 | uint64_t cgen_var_515; |
| 7074 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_515, 1); |
| 7075 | countingStream->write((uint64_t*)&cgen_var_515, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7076 | countingStream->write((float*)&local_depthBiasConstantFactor, sizeof(float)); |
| 7077 | countingStream->write((float*)&local_depthBiasClamp, sizeof(float)); |
| 7078 | countingStream->write((float*)&local_depthBiasSlopeFactor, sizeof(float)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7079 | } |
| 7080 | uint32_t packetSize_vkCmdSetDepthBias = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7081 | countingStream->rewind(); |
| 7082 | uint32_t opcode_vkCmdSetDepthBias = OP_vkCmdSetDepthBias; |
| 7083 | stream->write(&opcode_vkCmdSetDepthBias, sizeof(uint32_t)); |
| 7084 | stream->write(&packetSize_vkCmdSetDepthBias, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7085 | uint64_t cgen_var_516; |
| 7086 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_516, 1); |
| 7087 | stream->write((uint64_t*)&cgen_var_516, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7088 | stream->write((float*)&local_depthBiasConstantFactor, sizeof(float)); |
| 7089 | stream->write((float*)&local_depthBiasClamp, sizeof(float)); |
| 7090 | stream->write((float*)&local_depthBiasSlopeFactor, sizeof(float)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 7091 | pool->freeAll(); |
| 7092 | countingStream->clearPool(); |
| 7093 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7094 | mImpl->log("finish vkCmdSetDepthBias");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7095 | } |
| 7096 | |
| 7097 | void VkEncoder::vkCmdSetBlendConstants( |
| 7098 | VkCommandBuffer commandBuffer, |
| Lingfeng Yang | 97ddeb8 | 2019-04-20 14:32:52 -0700 | [diff] [blame] | 7099 | const float blendConstants[4]) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7100 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 7101 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7102 | mImpl->log("start vkCmdSetBlendConstants"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7103 | auto stream = mImpl->stream(); |
| 7104 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7105 | auto resources = mImpl->resources(); |
| 7106 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 7107 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7108 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7109 | float local_blendConstants[4]; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 7110 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | bb775b2 | 2019-08-09 08:28:28 -0700 | [diff] [blame] | 7111 | memcpy(local_blendConstants, blendConstants, 4 * sizeof(const float)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7112 | countingStream->rewind(); |
| 7113 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7114 | uint64_t cgen_var_517; |
| 7115 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_517, 1); |
| 7116 | countingStream->write((uint64_t*)&cgen_var_517, 1 * 8); |
| Lingfeng Yang | bb775b2 | 2019-08-09 08:28:28 -0700 | [diff] [blame] | 7117 | countingStream->write((float*)local_blendConstants, 4 * sizeof(float)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7118 | } |
| 7119 | uint32_t packetSize_vkCmdSetBlendConstants = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7120 | countingStream->rewind(); |
| 7121 | uint32_t opcode_vkCmdSetBlendConstants = OP_vkCmdSetBlendConstants; |
| 7122 | stream->write(&opcode_vkCmdSetBlendConstants, sizeof(uint32_t)); |
| 7123 | stream->write(&packetSize_vkCmdSetBlendConstants, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7124 | uint64_t cgen_var_518; |
| 7125 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_518, 1); |
| 7126 | stream->write((uint64_t*)&cgen_var_518, 1 * 8); |
| Lingfeng Yang | bb775b2 | 2019-08-09 08:28:28 -0700 | [diff] [blame] | 7127 | stream->write((float*)local_blendConstants, 4 * sizeof(float)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 7128 | pool->freeAll(); |
| 7129 | countingStream->clearPool(); |
| 7130 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7131 | mImpl->log("finish vkCmdSetBlendConstants");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7132 | } |
| 7133 | |
| 7134 | void VkEncoder::vkCmdSetDepthBounds( |
| 7135 | VkCommandBuffer commandBuffer, |
| 7136 | float minDepthBounds, |
| 7137 | float maxDepthBounds) |
| 7138 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 7139 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7140 | mImpl->log("start vkCmdSetDepthBounds"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7141 | auto stream = mImpl->stream(); |
| 7142 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7143 | auto resources = mImpl->resources(); |
| 7144 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 7145 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7146 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7147 | float local_minDepthBounds; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7148 | float local_maxDepthBounds; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 7149 | local_commandBuffer = commandBuffer; |
| 7150 | local_minDepthBounds = minDepthBounds; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7151 | local_maxDepthBounds = maxDepthBounds; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7152 | countingStream->rewind(); |
| 7153 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7154 | uint64_t cgen_var_519; |
| 7155 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_519, 1); |
| 7156 | countingStream->write((uint64_t*)&cgen_var_519, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7157 | countingStream->write((float*)&local_minDepthBounds, sizeof(float)); |
| 7158 | countingStream->write((float*)&local_maxDepthBounds, sizeof(float)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7159 | } |
| 7160 | uint32_t packetSize_vkCmdSetDepthBounds = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7161 | countingStream->rewind(); |
| 7162 | uint32_t opcode_vkCmdSetDepthBounds = OP_vkCmdSetDepthBounds; |
| 7163 | stream->write(&opcode_vkCmdSetDepthBounds, sizeof(uint32_t)); |
| 7164 | stream->write(&packetSize_vkCmdSetDepthBounds, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7165 | uint64_t cgen_var_520; |
| 7166 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_520, 1); |
| 7167 | stream->write((uint64_t*)&cgen_var_520, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7168 | stream->write((float*)&local_minDepthBounds, sizeof(float)); |
| 7169 | stream->write((float*)&local_maxDepthBounds, sizeof(float)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 7170 | pool->freeAll(); |
| 7171 | countingStream->clearPool(); |
| 7172 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7173 | mImpl->log("finish vkCmdSetDepthBounds");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7174 | } |
| 7175 | |
| 7176 | void VkEncoder::vkCmdSetStencilCompareMask( |
| 7177 | VkCommandBuffer commandBuffer, |
| 7178 | VkStencilFaceFlags faceMask, |
| 7179 | uint32_t compareMask) |
| 7180 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 7181 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7182 | mImpl->log("start vkCmdSetStencilCompareMask"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7183 | auto stream = mImpl->stream(); |
| 7184 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7185 | auto resources = mImpl->resources(); |
| 7186 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 7187 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7188 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7189 | VkStencilFaceFlags local_faceMask; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7190 | uint32_t local_compareMask; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 7191 | local_commandBuffer = commandBuffer; |
| 7192 | local_faceMask = faceMask; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7193 | local_compareMask = compareMask; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7194 | countingStream->rewind(); |
| 7195 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7196 | uint64_t cgen_var_521; |
| 7197 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_521, 1); |
| 7198 | countingStream->write((uint64_t*)&cgen_var_521, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7199 | countingStream->write((VkStencilFaceFlags*)&local_faceMask, sizeof(VkStencilFaceFlags)); |
| 7200 | countingStream->write((uint32_t*)&local_compareMask, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7201 | } |
| 7202 | uint32_t packetSize_vkCmdSetStencilCompareMask = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7203 | countingStream->rewind(); |
| 7204 | uint32_t opcode_vkCmdSetStencilCompareMask = OP_vkCmdSetStencilCompareMask; |
| 7205 | stream->write(&opcode_vkCmdSetStencilCompareMask, sizeof(uint32_t)); |
| 7206 | stream->write(&packetSize_vkCmdSetStencilCompareMask, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7207 | uint64_t cgen_var_522; |
| 7208 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_522, 1); |
| 7209 | stream->write((uint64_t*)&cgen_var_522, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7210 | stream->write((VkStencilFaceFlags*)&local_faceMask, sizeof(VkStencilFaceFlags)); |
| 7211 | stream->write((uint32_t*)&local_compareMask, sizeof(uint32_t)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 7212 | pool->freeAll(); |
| 7213 | countingStream->clearPool(); |
| 7214 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7215 | mImpl->log("finish vkCmdSetStencilCompareMask");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7216 | } |
| 7217 | |
| 7218 | void VkEncoder::vkCmdSetStencilWriteMask( |
| 7219 | VkCommandBuffer commandBuffer, |
| 7220 | VkStencilFaceFlags faceMask, |
| 7221 | uint32_t writeMask) |
| 7222 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 7223 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7224 | mImpl->log("start vkCmdSetStencilWriteMask"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7225 | auto stream = mImpl->stream(); |
| 7226 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7227 | auto resources = mImpl->resources(); |
| 7228 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 7229 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7230 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7231 | VkStencilFaceFlags local_faceMask; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7232 | uint32_t local_writeMask; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 7233 | local_commandBuffer = commandBuffer; |
| 7234 | local_faceMask = faceMask; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7235 | local_writeMask = writeMask; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7236 | countingStream->rewind(); |
| 7237 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7238 | uint64_t cgen_var_523; |
| 7239 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_523, 1); |
| 7240 | countingStream->write((uint64_t*)&cgen_var_523, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7241 | countingStream->write((VkStencilFaceFlags*)&local_faceMask, sizeof(VkStencilFaceFlags)); |
| 7242 | countingStream->write((uint32_t*)&local_writeMask, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7243 | } |
| 7244 | uint32_t packetSize_vkCmdSetStencilWriteMask = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7245 | countingStream->rewind(); |
| 7246 | uint32_t opcode_vkCmdSetStencilWriteMask = OP_vkCmdSetStencilWriteMask; |
| 7247 | stream->write(&opcode_vkCmdSetStencilWriteMask, sizeof(uint32_t)); |
| 7248 | stream->write(&packetSize_vkCmdSetStencilWriteMask, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7249 | uint64_t cgen_var_524; |
| 7250 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_524, 1); |
| 7251 | stream->write((uint64_t*)&cgen_var_524, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7252 | stream->write((VkStencilFaceFlags*)&local_faceMask, sizeof(VkStencilFaceFlags)); |
| 7253 | stream->write((uint32_t*)&local_writeMask, sizeof(uint32_t)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 7254 | pool->freeAll(); |
| 7255 | countingStream->clearPool(); |
| 7256 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7257 | mImpl->log("finish vkCmdSetStencilWriteMask");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7258 | } |
| 7259 | |
| 7260 | void VkEncoder::vkCmdSetStencilReference( |
| 7261 | VkCommandBuffer commandBuffer, |
| 7262 | VkStencilFaceFlags faceMask, |
| 7263 | uint32_t reference) |
| 7264 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 7265 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7266 | mImpl->log("start vkCmdSetStencilReference"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7267 | auto stream = mImpl->stream(); |
| 7268 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7269 | auto resources = mImpl->resources(); |
| 7270 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 7271 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7272 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7273 | VkStencilFaceFlags local_faceMask; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7274 | uint32_t local_reference; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 7275 | local_commandBuffer = commandBuffer; |
| 7276 | local_faceMask = faceMask; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7277 | local_reference = reference; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7278 | countingStream->rewind(); |
| 7279 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7280 | uint64_t cgen_var_525; |
| 7281 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_525, 1); |
| 7282 | countingStream->write((uint64_t*)&cgen_var_525, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7283 | countingStream->write((VkStencilFaceFlags*)&local_faceMask, sizeof(VkStencilFaceFlags)); |
| 7284 | countingStream->write((uint32_t*)&local_reference, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7285 | } |
| 7286 | uint32_t packetSize_vkCmdSetStencilReference = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7287 | countingStream->rewind(); |
| 7288 | uint32_t opcode_vkCmdSetStencilReference = OP_vkCmdSetStencilReference; |
| 7289 | stream->write(&opcode_vkCmdSetStencilReference, sizeof(uint32_t)); |
| 7290 | stream->write(&packetSize_vkCmdSetStencilReference, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7291 | uint64_t cgen_var_526; |
| 7292 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_526, 1); |
| 7293 | stream->write((uint64_t*)&cgen_var_526, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7294 | stream->write((VkStencilFaceFlags*)&local_faceMask, sizeof(VkStencilFaceFlags)); |
| 7295 | stream->write((uint32_t*)&local_reference, sizeof(uint32_t)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 7296 | pool->freeAll(); |
| 7297 | countingStream->clearPool(); |
| 7298 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7299 | mImpl->log("finish vkCmdSetStencilReference");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7300 | } |
| 7301 | |
| 7302 | void VkEncoder::vkCmdBindDescriptorSets( |
| 7303 | VkCommandBuffer commandBuffer, |
| 7304 | VkPipelineBindPoint pipelineBindPoint, |
| 7305 | VkPipelineLayout layout, |
| 7306 | uint32_t firstSet, |
| 7307 | uint32_t descriptorSetCount, |
| 7308 | const VkDescriptorSet* pDescriptorSets, |
| 7309 | uint32_t dynamicOffsetCount, |
| 7310 | const uint32_t* pDynamicOffsets) |
| 7311 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 7312 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7313 | mImpl->log("start vkCmdBindDescriptorSets"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7314 | auto stream = mImpl->stream(); |
| 7315 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7316 | auto resources = mImpl->resources(); |
| 7317 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 7318 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7319 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7320 | VkPipelineBindPoint local_pipelineBindPoint; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7321 | VkPipelineLayout local_layout; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7322 | uint32_t local_firstSet; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7323 | uint32_t local_descriptorSetCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7324 | VkDescriptorSet* local_pDescriptorSets; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 7325 | uint32_t local_dynamicOffsetCount; |
| 7326 | uint32_t* local_pDynamicOffsets; |
| 7327 | local_commandBuffer = commandBuffer; |
| 7328 | local_pipelineBindPoint = pipelineBindPoint; |
| 7329 | local_layout = layout; |
| 7330 | local_firstSet = firstSet; |
| 7331 | local_descriptorSetCount = descriptorSetCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7332 | local_pDescriptorSets = nullptr; |
| 7333 | if (pDescriptorSets) |
| 7334 | { |
| 7335 | local_pDescriptorSets = (VkDescriptorSet*)pool->dupArray(pDescriptorSets, ((descriptorSetCount)) * sizeof(const VkDescriptorSet)); |
| 7336 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7337 | local_dynamicOffsetCount = dynamicOffsetCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7338 | local_pDynamicOffsets = nullptr; |
| 7339 | if (pDynamicOffsets) |
| 7340 | { |
| 7341 | local_pDynamicOffsets = (uint32_t*)pool->dupArray(pDynamicOffsets, ((dynamicOffsetCount)) * sizeof(const uint32_t)); |
| 7342 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7343 | countingStream->rewind(); |
| 7344 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7345 | uint64_t cgen_var_527; |
| 7346 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_527, 1); |
| 7347 | countingStream->write((uint64_t*)&cgen_var_527, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7348 | countingStream->write((VkPipelineBindPoint*)&local_pipelineBindPoint, sizeof(VkPipelineBindPoint)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7349 | uint64_t cgen_var_528; |
| 7350 | countingStream->handleMapping()->mapHandles_VkPipelineLayout_u64(&local_layout, &cgen_var_528, 1); |
| 7351 | countingStream->write((uint64_t*)&cgen_var_528, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7352 | countingStream->write((uint32_t*)&local_firstSet, sizeof(uint32_t)); |
| 7353 | countingStream->write((uint32_t*)&local_descriptorSetCount, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 7354 | if (((descriptorSetCount))) |
| 7355 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7356 | uint64_t* cgen_var_529; |
| 7357 | countingStream->alloc((void**)&cgen_var_529, ((descriptorSetCount)) * 8); |
| 7358 | countingStream->handleMapping()->mapHandles_VkDescriptorSet_u64(local_pDescriptorSets, cgen_var_529, ((descriptorSetCount))); |
| 7359 | countingStream->write((uint64_t*)cgen_var_529, ((descriptorSetCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 7360 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7361 | countingStream->write((uint32_t*)&local_dynamicOffsetCount, sizeof(uint32_t)); |
| 7362 | countingStream->write((uint32_t*)local_pDynamicOffsets, ((dynamicOffsetCount)) * sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7363 | } |
| 7364 | uint32_t packetSize_vkCmdBindDescriptorSets = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7365 | countingStream->rewind(); |
| 7366 | uint32_t opcode_vkCmdBindDescriptorSets = OP_vkCmdBindDescriptorSets; |
| 7367 | stream->write(&opcode_vkCmdBindDescriptorSets, sizeof(uint32_t)); |
| 7368 | stream->write(&packetSize_vkCmdBindDescriptorSets, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7369 | uint64_t cgen_var_530; |
| 7370 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_530, 1); |
| 7371 | stream->write((uint64_t*)&cgen_var_530, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7372 | stream->write((VkPipelineBindPoint*)&local_pipelineBindPoint, sizeof(VkPipelineBindPoint)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7373 | uint64_t cgen_var_531; |
| 7374 | stream->handleMapping()->mapHandles_VkPipelineLayout_u64(&local_layout, &cgen_var_531, 1); |
| 7375 | stream->write((uint64_t*)&cgen_var_531, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7376 | stream->write((uint32_t*)&local_firstSet, sizeof(uint32_t)); |
| 7377 | stream->write((uint32_t*)&local_descriptorSetCount, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 7378 | if (((descriptorSetCount))) |
| 7379 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7380 | uint64_t* cgen_var_532; |
| 7381 | stream->alloc((void**)&cgen_var_532, ((descriptorSetCount)) * 8); |
| 7382 | stream->handleMapping()->mapHandles_VkDescriptorSet_u64(local_pDescriptorSets, cgen_var_532, ((descriptorSetCount))); |
| 7383 | stream->write((uint64_t*)cgen_var_532, ((descriptorSetCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 7384 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7385 | stream->write((uint32_t*)&local_dynamicOffsetCount, sizeof(uint32_t)); |
| 7386 | stream->write((uint32_t*)local_pDynamicOffsets, ((dynamicOffsetCount)) * sizeof(uint32_t)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 7387 | pool->freeAll(); |
| 7388 | countingStream->clearPool(); |
| 7389 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7390 | mImpl->log("finish vkCmdBindDescriptorSets");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7391 | } |
| 7392 | |
| 7393 | void VkEncoder::vkCmdBindIndexBuffer( |
| 7394 | VkCommandBuffer commandBuffer, |
| 7395 | VkBuffer buffer, |
| 7396 | VkDeviceSize offset, |
| 7397 | VkIndexType indexType) |
| 7398 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 7399 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7400 | mImpl->log("start vkCmdBindIndexBuffer"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7401 | auto stream = mImpl->stream(); |
| 7402 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7403 | auto resources = mImpl->resources(); |
| 7404 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 7405 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7406 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7407 | VkBuffer local_buffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7408 | VkDeviceSize local_offset; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7409 | VkIndexType local_indexType; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 7410 | local_commandBuffer = commandBuffer; |
| 7411 | local_buffer = buffer; |
| 7412 | local_offset = offset; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7413 | local_indexType = indexType; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7414 | countingStream->rewind(); |
| 7415 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7416 | uint64_t cgen_var_533; |
| 7417 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_533, 1); |
| 7418 | countingStream->write((uint64_t*)&cgen_var_533, 1 * 8); |
| 7419 | uint64_t cgen_var_534; |
| 7420 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_534, 1); |
| 7421 | countingStream->write((uint64_t*)&cgen_var_534, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7422 | countingStream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize)); |
| 7423 | countingStream->write((VkIndexType*)&local_indexType, sizeof(VkIndexType)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7424 | } |
| 7425 | uint32_t packetSize_vkCmdBindIndexBuffer = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7426 | countingStream->rewind(); |
| 7427 | uint32_t opcode_vkCmdBindIndexBuffer = OP_vkCmdBindIndexBuffer; |
| 7428 | stream->write(&opcode_vkCmdBindIndexBuffer, sizeof(uint32_t)); |
| 7429 | stream->write(&packetSize_vkCmdBindIndexBuffer, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7430 | uint64_t cgen_var_535; |
| 7431 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_535, 1); |
| 7432 | stream->write((uint64_t*)&cgen_var_535, 1 * 8); |
| 7433 | uint64_t cgen_var_536; |
| 7434 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_536, 1); |
| 7435 | stream->write((uint64_t*)&cgen_var_536, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7436 | stream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize)); |
| 7437 | stream->write((VkIndexType*)&local_indexType, sizeof(VkIndexType)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 7438 | pool->freeAll(); |
| 7439 | countingStream->clearPool(); |
| 7440 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7441 | mImpl->log("finish vkCmdBindIndexBuffer");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7442 | } |
| 7443 | |
| 7444 | void VkEncoder::vkCmdBindVertexBuffers( |
| 7445 | VkCommandBuffer commandBuffer, |
| 7446 | uint32_t firstBinding, |
| 7447 | uint32_t bindingCount, |
| 7448 | const VkBuffer* pBuffers, |
| 7449 | const VkDeviceSize* pOffsets) |
| 7450 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 7451 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7452 | mImpl->log("start vkCmdBindVertexBuffers"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7453 | auto stream = mImpl->stream(); |
| 7454 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7455 | auto resources = mImpl->resources(); |
| 7456 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 7457 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7458 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7459 | uint32_t local_firstBinding; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7460 | uint32_t local_bindingCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7461 | VkBuffer* local_pBuffers; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 7462 | VkDeviceSize* local_pOffsets; |
| 7463 | local_commandBuffer = commandBuffer; |
| 7464 | local_firstBinding = firstBinding; |
| 7465 | local_bindingCount = bindingCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7466 | local_pBuffers = nullptr; |
| 7467 | if (pBuffers) |
| 7468 | { |
| 7469 | local_pBuffers = (VkBuffer*)pool->dupArray(pBuffers, ((bindingCount)) * sizeof(const VkBuffer)); |
| 7470 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7471 | local_pOffsets = nullptr; |
| 7472 | if (pOffsets) |
| 7473 | { |
| 7474 | local_pOffsets = (VkDeviceSize*)pool->dupArray(pOffsets, ((bindingCount)) * sizeof(const VkDeviceSize)); |
| 7475 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7476 | countingStream->rewind(); |
| 7477 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7478 | uint64_t cgen_var_537; |
| 7479 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_537, 1); |
| 7480 | countingStream->write((uint64_t*)&cgen_var_537, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7481 | countingStream->write((uint32_t*)&local_firstBinding, sizeof(uint32_t)); |
| 7482 | countingStream->write((uint32_t*)&local_bindingCount, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 7483 | if (((bindingCount))) |
| 7484 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7485 | uint64_t* cgen_var_538; |
| 7486 | countingStream->alloc((void**)&cgen_var_538, ((bindingCount)) * 8); |
| 7487 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(local_pBuffers, cgen_var_538, ((bindingCount))); |
| 7488 | countingStream->write((uint64_t*)cgen_var_538, ((bindingCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 7489 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7490 | countingStream->write((VkDeviceSize*)local_pOffsets, ((bindingCount)) * sizeof(VkDeviceSize)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7491 | } |
| 7492 | uint32_t packetSize_vkCmdBindVertexBuffers = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7493 | countingStream->rewind(); |
| 7494 | uint32_t opcode_vkCmdBindVertexBuffers = OP_vkCmdBindVertexBuffers; |
| 7495 | stream->write(&opcode_vkCmdBindVertexBuffers, sizeof(uint32_t)); |
| 7496 | stream->write(&packetSize_vkCmdBindVertexBuffers, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7497 | uint64_t cgen_var_539; |
| 7498 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_539, 1); |
| 7499 | stream->write((uint64_t*)&cgen_var_539, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7500 | stream->write((uint32_t*)&local_firstBinding, sizeof(uint32_t)); |
| 7501 | stream->write((uint32_t*)&local_bindingCount, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 7502 | if (((bindingCount))) |
| 7503 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7504 | uint64_t* cgen_var_540; |
| 7505 | stream->alloc((void**)&cgen_var_540, ((bindingCount)) * 8); |
| 7506 | stream->handleMapping()->mapHandles_VkBuffer_u64(local_pBuffers, cgen_var_540, ((bindingCount))); |
| 7507 | stream->write((uint64_t*)cgen_var_540, ((bindingCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 7508 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7509 | stream->write((VkDeviceSize*)local_pOffsets, ((bindingCount)) * sizeof(VkDeviceSize)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 7510 | pool->freeAll(); |
| 7511 | countingStream->clearPool(); |
| 7512 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7513 | mImpl->log("finish vkCmdBindVertexBuffers");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7514 | } |
| 7515 | |
| 7516 | void VkEncoder::vkCmdDraw( |
| 7517 | VkCommandBuffer commandBuffer, |
| 7518 | uint32_t vertexCount, |
| 7519 | uint32_t instanceCount, |
| 7520 | uint32_t firstVertex, |
| 7521 | uint32_t firstInstance) |
| 7522 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 7523 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7524 | mImpl->log("start vkCmdDraw"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7525 | auto stream = mImpl->stream(); |
| 7526 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7527 | auto resources = mImpl->resources(); |
| 7528 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 7529 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7530 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7531 | uint32_t local_vertexCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7532 | uint32_t local_instanceCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7533 | uint32_t local_firstVertex; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7534 | uint32_t local_firstInstance; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 7535 | local_commandBuffer = commandBuffer; |
| 7536 | local_vertexCount = vertexCount; |
| 7537 | local_instanceCount = instanceCount; |
| 7538 | local_firstVertex = firstVertex; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7539 | local_firstInstance = firstInstance; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7540 | countingStream->rewind(); |
| 7541 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7542 | uint64_t cgen_var_541; |
| 7543 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_541, 1); |
| 7544 | countingStream->write((uint64_t*)&cgen_var_541, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7545 | countingStream->write((uint32_t*)&local_vertexCount, sizeof(uint32_t)); |
| 7546 | countingStream->write((uint32_t*)&local_instanceCount, sizeof(uint32_t)); |
| 7547 | countingStream->write((uint32_t*)&local_firstVertex, sizeof(uint32_t)); |
| 7548 | countingStream->write((uint32_t*)&local_firstInstance, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7549 | } |
| 7550 | uint32_t packetSize_vkCmdDraw = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7551 | countingStream->rewind(); |
| 7552 | uint32_t opcode_vkCmdDraw = OP_vkCmdDraw; |
| 7553 | stream->write(&opcode_vkCmdDraw, sizeof(uint32_t)); |
| 7554 | stream->write(&packetSize_vkCmdDraw, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7555 | uint64_t cgen_var_542; |
| 7556 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_542, 1); |
| 7557 | stream->write((uint64_t*)&cgen_var_542, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7558 | stream->write((uint32_t*)&local_vertexCount, sizeof(uint32_t)); |
| 7559 | stream->write((uint32_t*)&local_instanceCount, sizeof(uint32_t)); |
| 7560 | stream->write((uint32_t*)&local_firstVertex, sizeof(uint32_t)); |
| 7561 | stream->write((uint32_t*)&local_firstInstance, sizeof(uint32_t)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 7562 | pool->freeAll(); |
| 7563 | countingStream->clearPool(); |
| 7564 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7565 | mImpl->log("finish vkCmdDraw");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7566 | } |
| 7567 | |
| 7568 | void VkEncoder::vkCmdDrawIndexed( |
| 7569 | VkCommandBuffer commandBuffer, |
| 7570 | uint32_t indexCount, |
| 7571 | uint32_t instanceCount, |
| 7572 | uint32_t firstIndex, |
| 7573 | int32_t vertexOffset, |
| 7574 | uint32_t firstInstance) |
| 7575 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 7576 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7577 | mImpl->log("start vkCmdDrawIndexed"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7578 | auto stream = mImpl->stream(); |
| 7579 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7580 | auto resources = mImpl->resources(); |
| 7581 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 7582 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7583 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7584 | uint32_t local_indexCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7585 | uint32_t local_instanceCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7586 | uint32_t local_firstIndex; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7587 | int32_t local_vertexOffset; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7588 | uint32_t local_firstInstance; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 7589 | local_commandBuffer = commandBuffer; |
| 7590 | local_indexCount = indexCount; |
| 7591 | local_instanceCount = instanceCount; |
| 7592 | local_firstIndex = firstIndex; |
| 7593 | local_vertexOffset = vertexOffset; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7594 | local_firstInstance = firstInstance; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7595 | countingStream->rewind(); |
| 7596 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7597 | uint64_t cgen_var_543; |
| 7598 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_543, 1); |
| 7599 | countingStream->write((uint64_t*)&cgen_var_543, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7600 | countingStream->write((uint32_t*)&local_indexCount, sizeof(uint32_t)); |
| 7601 | countingStream->write((uint32_t*)&local_instanceCount, sizeof(uint32_t)); |
| 7602 | countingStream->write((uint32_t*)&local_firstIndex, sizeof(uint32_t)); |
| 7603 | countingStream->write((int32_t*)&local_vertexOffset, sizeof(int32_t)); |
| 7604 | countingStream->write((uint32_t*)&local_firstInstance, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7605 | } |
| 7606 | uint32_t packetSize_vkCmdDrawIndexed = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7607 | countingStream->rewind(); |
| 7608 | uint32_t opcode_vkCmdDrawIndexed = OP_vkCmdDrawIndexed; |
| 7609 | stream->write(&opcode_vkCmdDrawIndexed, sizeof(uint32_t)); |
| 7610 | stream->write(&packetSize_vkCmdDrawIndexed, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7611 | uint64_t cgen_var_544; |
| 7612 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_544, 1); |
| 7613 | stream->write((uint64_t*)&cgen_var_544, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7614 | stream->write((uint32_t*)&local_indexCount, sizeof(uint32_t)); |
| 7615 | stream->write((uint32_t*)&local_instanceCount, sizeof(uint32_t)); |
| 7616 | stream->write((uint32_t*)&local_firstIndex, sizeof(uint32_t)); |
| 7617 | stream->write((int32_t*)&local_vertexOffset, sizeof(int32_t)); |
| 7618 | stream->write((uint32_t*)&local_firstInstance, sizeof(uint32_t)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 7619 | pool->freeAll(); |
| 7620 | countingStream->clearPool(); |
| 7621 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7622 | mImpl->log("finish vkCmdDrawIndexed");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7623 | } |
| 7624 | |
| 7625 | void VkEncoder::vkCmdDrawIndirect( |
| 7626 | VkCommandBuffer commandBuffer, |
| 7627 | VkBuffer buffer, |
| 7628 | VkDeviceSize offset, |
| 7629 | uint32_t drawCount, |
| 7630 | uint32_t stride) |
| 7631 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 7632 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7633 | mImpl->log("start vkCmdDrawIndirect"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7634 | auto stream = mImpl->stream(); |
| 7635 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7636 | auto resources = mImpl->resources(); |
| 7637 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 7638 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7639 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7640 | VkBuffer local_buffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7641 | VkDeviceSize local_offset; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7642 | uint32_t local_drawCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7643 | uint32_t local_stride; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 7644 | local_commandBuffer = commandBuffer; |
| 7645 | local_buffer = buffer; |
| 7646 | local_offset = offset; |
| 7647 | local_drawCount = drawCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7648 | local_stride = stride; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7649 | countingStream->rewind(); |
| 7650 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7651 | uint64_t cgen_var_545; |
| 7652 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_545, 1); |
| 7653 | countingStream->write((uint64_t*)&cgen_var_545, 1 * 8); |
| 7654 | uint64_t cgen_var_546; |
| 7655 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_546, 1); |
| 7656 | countingStream->write((uint64_t*)&cgen_var_546, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7657 | countingStream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize)); |
| 7658 | countingStream->write((uint32_t*)&local_drawCount, sizeof(uint32_t)); |
| 7659 | countingStream->write((uint32_t*)&local_stride, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7660 | } |
| 7661 | uint32_t packetSize_vkCmdDrawIndirect = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7662 | countingStream->rewind(); |
| 7663 | uint32_t opcode_vkCmdDrawIndirect = OP_vkCmdDrawIndirect; |
| 7664 | stream->write(&opcode_vkCmdDrawIndirect, sizeof(uint32_t)); |
| 7665 | stream->write(&packetSize_vkCmdDrawIndirect, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7666 | uint64_t cgen_var_547; |
| 7667 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_547, 1); |
| 7668 | stream->write((uint64_t*)&cgen_var_547, 1 * 8); |
| 7669 | uint64_t cgen_var_548; |
| 7670 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_548, 1); |
| 7671 | stream->write((uint64_t*)&cgen_var_548, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7672 | stream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize)); |
| 7673 | stream->write((uint32_t*)&local_drawCount, sizeof(uint32_t)); |
| 7674 | stream->write((uint32_t*)&local_stride, sizeof(uint32_t)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 7675 | pool->freeAll(); |
| 7676 | countingStream->clearPool(); |
| 7677 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7678 | mImpl->log("finish vkCmdDrawIndirect");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7679 | } |
| 7680 | |
| 7681 | void VkEncoder::vkCmdDrawIndexedIndirect( |
| 7682 | VkCommandBuffer commandBuffer, |
| 7683 | VkBuffer buffer, |
| 7684 | VkDeviceSize offset, |
| 7685 | uint32_t drawCount, |
| 7686 | uint32_t stride) |
| 7687 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 7688 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7689 | mImpl->log("start vkCmdDrawIndexedIndirect"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7690 | auto stream = mImpl->stream(); |
| 7691 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7692 | auto resources = mImpl->resources(); |
| 7693 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 7694 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7695 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7696 | VkBuffer local_buffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7697 | VkDeviceSize local_offset; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7698 | uint32_t local_drawCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7699 | uint32_t local_stride; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 7700 | local_commandBuffer = commandBuffer; |
| 7701 | local_buffer = buffer; |
| 7702 | local_offset = offset; |
| 7703 | local_drawCount = drawCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7704 | local_stride = stride; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7705 | countingStream->rewind(); |
| 7706 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7707 | uint64_t cgen_var_549; |
| 7708 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_549, 1); |
| 7709 | countingStream->write((uint64_t*)&cgen_var_549, 1 * 8); |
| 7710 | uint64_t cgen_var_550; |
| 7711 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_550, 1); |
| 7712 | countingStream->write((uint64_t*)&cgen_var_550, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7713 | countingStream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize)); |
| 7714 | countingStream->write((uint32_t*)&local_drawCount, sizeof(uint32_t)); |
| 7715 | countingStream->write((uint32_t*)&local_stride, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7716 | } |
| 7717 | uint32_t packetSize_vkCmdDrawIndexedIndirect = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7718 | countingStream->rewind(); |
| 7719 | uint32_t opcode_vkCmdDrawIndexedIndirect = OP_vkCmdDrawIndexedIndirect; |
| 7720 | stream->write(&opcode_vkCmdDrawIndexedIndirect, sizeof(uint32_t)); |
| 7721 | stream->write(&packetSize_vkCmdDrawIndexedIndirect, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7722 | uint64_t cgen_var_551; |
| 7723 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_551, 1); |
| 7724 | stream->write((uint64_t*)&cgen_var_551, 1 * 8); |
| 7725 | uint64_t cgen_var_552; |
| 7726 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_552, 1); |
| 7727 | stream->write((uint64_t*)&cgen_var_552, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7728 | stream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize)); |
| 7729 | stream->write((uint32_t*)&local_drawCount, sizeof(uint32_t)); |
| 7730 | stream->write((uint32_t*)&local_stride, sizeof(uint32_t)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 7731 | pool->freeAll(); |
| 7732 | countingStream->clearPool(); |
| 7733 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7734 | mImpl->log("finish vkCmdDrawIndexedIndirect");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7735 | } |
| 7736 | |
| 7737 | void VkEncoder::vkCmdDispatch( |
| 7738 | VkCommandBuffer commandBuffer, |
| 7739 | uint32_t groupCountX, |
| 7740 | uint32_t groupCountY, |
| 7741 | uint32_t groupCountZ) |
| 7742 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 7743 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7744 | mImpl->log("start vkCmdDispatch"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7745 | auto stream = mImpl->stream(); |
| 7746 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7747 | auto resources = mImpl->resources(); |
| 7748 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 7749 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7750 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7751 | uint32_t local_groupCountX; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7752 | uint32_t local_groupCountY; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7753 | uint32_t local_groupCountZ; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 7754 | local_commandBuffer = commandBuffer; |
| 7755 | local_groupCountX = groupCountX; |
| 7756 | local_groupCountY = groupCountY; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7757 | local_groupCountZ = groupCountZ; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7758 | countingStream->rewind(); |
| 7759 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7760 | uint64_t cgen_var_553; |
| 7761 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_553, 1); |
| 7762 | countingStream->write((uint64_t*)&cgen_var_553, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7763 | countingStream->write((uint32_t*)&local_groupCountX, sizeof(uint32_t)); |
| 7764 | countingStream->write((uint32_t*)&local_groupCountY, sizeof(uint32_t)); |
| 7765 | countingStream->write((uint32_t*)&local_groupCountZ, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7766 | } |
| 7767 | uint32_t packetSize_vkCmdDispatch = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7768 | countingStream->rewind(); |
| 7769 | uint32_t opcode_vkCmdDispatch = OP_vkCmdDispatch; |
| 7770 | stream->write(&opcode_vkCmdDispatch, sizeof(uint32_t)); |
| 7771 | stream->write(&packetSize_vkCmdDispatch, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7772 | uint64_t cgen_var_554; |
| 7773 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_554, 1); |
| 7774 | stream->write((uint64_t*)&cgen_var_554, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7775 | stream->write((uint32_t*)&local_groupCountX, sizeof(uint32_t)); |
| 7776 | stream->write((uint32_t*)&local_groupCountY, sizeof(uint32_t)); |
| 7777 | stream->write((uint32_t*)&local_groupCountZ, sizeof(uint32_t)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 7778 | pool->freeAll(); |
| 7779 | countingStream->clearPool(); |
| 7780 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7781 | mImpl->log("finish vkCmdDispatch");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7782 | } |
| 7783 | |
| 7784 | void VkEncoder::vkCmdDispatchIndirect( |
| 7785 | VkCommandBuffer commandBuffer, |
| 7786 | VkBuffer buffer, |
| 7787 | VkDeviceSize offset) |
| 7788 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 7789 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7790 | mImpl->log("start vkCmdDispatchIndirect"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7791 | auto stream = mImpl->stream(); |
| 7792 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7793 | auto resources = mImpl->resources(); |
| 7794 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 7795 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7796 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7797 | VkBuffer local_buffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7798 | VkDeviceSize local_offset; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 7799 | local_commandBuffer = commandBuffer; |
| 7800 | local_buffer = buffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7801 | local_offset = offset; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7802 | countingStream->rewind(); |
| 7803 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7804 | uint64_t cgen_var_555; |
| 7805 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_555, 1); |
| 7806 | countingStream->write((uint64_t*)&cgen_var_555, 1 * 8); |
| 7807 | uint64_t cgen_var_556; |
| 7808 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_556, 1); |
| 7809 | countingStream->write((uint64_t*)&cgen_var_556, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7810 | countingStream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7811 | } |
| 7812 | uint32_t packetSize_vkCmdDispatchIndirect = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7813 | countingStream->rewind(); |
| 7814 | uint32_t opcode_vkCmdDispatchIndirect = OP_vkCmdDispatchIndirect; |
| 7815 | stream->write(&opcode_vkCmdDispatchIndirect, sizeof(uint32_t)); |
| 7816 | stream->write(&packetSize_vkCmdDispatchIndirect, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7817 | uint64_t cgen_var_557; |
| 7818 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_557, 1); |
| 7819 | stream->write((uint64_t*)&cgen_var_557, 1 * 8); |
| 7820 | uint64_t cgen_var_558; |
| 7821 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_558, 1); |
| 7822 | stream->write((uint64_t*)&cgen_var_558, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7823 | stream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 7824 | pool->freeAll(); |
| 7825 | countingStream->clearPool(); |
| 7826 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7827 | mImpl->log("finish vkCmdDispatchIndirect");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7828 | } |
| 7829 | |
| 7830 | void VkEncoder::vkCmdCopyBuffer( |
| 7831 | VkCommandBuffer commandBuffer, |
| 7832 | VkBuffer srcBuffer, |
| 7833 | VkBuffer dstBuffer, |
| 7834 | uint32_t regionCount, |
| 7835 | const VkBufferCopy* pRegions) |
| 7836 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 7837 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7838 | mImpl->log("start vkCmdCopyBuffer"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7839 | auto stream = mImpl->stream(); |
| 7840 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7841 | auto resources = mImpl->resources(); |
| 7842 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 7843 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7844 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7845 | VkBuffer local_srcBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7846 | VkBuffer local_dstBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7847 | uint32_t local_regionCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7848 | VkBufferCopy* local_pRegions; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 7849 | local_commandBuffer = commandBuffer; |
| 7850 | local_srcBuffer = srcBuffer; |
| 7851 | local_dstBuffer = dstBuffer; |
| 7852 | local_regionCount = regionCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7853 | local_pRegions = nullptr; |
| 7854 | if (pRegions) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7855 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7856 | local_pRegions = (VkBufferCopy*)pool->alloc(((regionCount)) * sizeof(const VkBufferCopy)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7857 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 7858 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7859 | deepcopy_VkBufferCopy(pool, pRegions + i, (VkBufferCopy*)(local_pRegions + i)); |
| 7860 | } |
| 7861 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 7862 | if (local_pRegions) |
| 7863 | { |
| 7864 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 7865 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 7866 | transform_tohost_VkBufferCopy(mImpl->resources(), (VkBufferCopy*)(local_pRegions + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 7867 | } |
| 7868 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7869 | countingStream->rewind(); |
| 7870 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7871 | uint64_t cgen_var_559; |
| 7872 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_559, 1); |
| 7873 | countingStream->write((uint64_t*)&cgen_var_559, 1 * 8); |
| 7874 | uint64_t cgen_var_560; |
| 7875 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_srcBuffer, &cgen_var_560, 1); |
| 7876 | countingStream->write((uint64_t*)&cgen_var_560, 1 * 8); |
| 7877 | uint64_t cgen_var_561; |
| 7878 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_dstBuffer, &cgen_var_561, 1); |
| 7879 | countingStream->write((uint64_t*)&cgen_var_561, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7880 | countingStream->write((uint32_t*)&local_regionCount, sizeof(uint32_t)); |
| 7881 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 7882 | { |
| 7883 | marshal_VkBufferCopy(countingStream, (VkBufferCopy*)(local_pRegions + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7884 | } |
| 7885 | } |
| 7886 | uint32_t packetSize_vkCmdCopyBuffer = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7887 | countingStream->rewind(); |
| 7888 | uint32_t opcode_vkCmdCopyBuffer = OP_vkCmdCopyBuffer; |
| 7889 | stream->write(&opcode_vkCmdCopyBuffer, sizeof(uint32_t)); |
| 7890 | stream->write(&packetSize_vkCmdCopyBuffer, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7891 | uint64_t cgen_var_562; |
| 7892 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_562, 1); |
| 7893 | stream->write((uint64_t*)&cgen_var_562, 1 * 8); |
| 7894 | uint64_t cgen_var_563; |
| 7895 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_srcBuffer, &cgen_var_563, 1); |
| 7896 | stream->write((uint64_t*)&cgen_var_563, 1 * 8); |
| 7897 | uint64_t cgen_var_564; |
| 7898 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_dstBuffer, &cgen_var_564, 1); |
| 7899 | stream->write((uint64_t*)&cgen_var_564, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7900 | stream->write((uint32_t*)&local_regionCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7901 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 7902 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7903 | marshal_VkBufferCopy(stream, (VkBufferCopy*)(local_pRegions + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7904 | } |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 7905 | pool->freeAll(); |
| 7906 | countingStream->clearPool(); |
| 7907 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7908 | mImpl->log("finish vkCmdCopyBuffer");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7909 | } |
| 7910 | |
| 7911 | void VkEncoder::vkCmdCopyImage( |
| 7912 | VkCommandBuffer commandBuffer, |
| 7913 | VkImage srcImage, |
| 7914 | VkImageLayout srcImageLayout, |
| 7915 | VkImage dstImage, |
| 7916 | VkImageLayout dstImageLayout, |
| 7917 | uint32_t regionCount, |
| 7918 | const VkImageCopy* pRegions) |
| 7919 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 7920 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7921 | mImpl->log("start vkCmdCopyImage"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7922 | auto stream = mImpl->stream(); |
| 7923 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7924 | auto resources = mImpl->resources(); |
| 7925 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 7926 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7927 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7928 | VkImage local_srcImage; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7929 | VkImageLayout local_srcImageLayout; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7930 | VkImage local_dstImage; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7931 | VkImageLayout local_dstImageLayout; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7932 | uint32_t local_regionCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7933 | VkImageCopy* local_pRegions; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 7934 | local_commandBuffer = commandBuffer; |
| 7935 | local_srcImage = srcImage; |
| 7936 | local_srcImageLayout = srcImageLayout; |
| 7937 | local_dstImage = dstImage; |
| 7938 | local_dstImageLayout = dstImageLayout; |
| 7939 | local_regionCount = regionCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7940 | local_pRegions = nullptr; |
| 7941 | if (pRegions) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7942 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7943 | local_pRegions = (VkImageCopy*)pool->alloc(((regionCount)) * sizeof(const VkImageCopy)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7944 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 7945 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7946 | deepcopy_VkImageCopy(pool, pRegions + i, (VkImageCopy*)(local_pRegions + i)); |
| 7947 | } |
| 7948 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 7949 | if (local_pRegions) |
| 7950 | { |
| 7951 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 7952 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 7953 | transform_tohost_VkImageCopy(mImpl->resources(), (VkImageCopy*)(local_pRegions + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 7954 | } |
| 7955 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7956 | countingStream->rewind(); |
| 7957 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7958 | uint64_t cgen_var_565; |
| 7959 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_565, 1); |
| 7960 | countingStream->write((uint64_t*)&cgen_var_565, 1 * 8); |
| 7961 | uint64_t cgen_var_566; |
| 7962 | countingStream->handleMapping()->mapHandles_VkImage_u64(&local_srcImage, &cgen_var_566, 1); |
| 7963 | countingStream->write((uint64_t*)&cgen_var_566, 1 * 8); |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 7964 | countingStream->write((VkImageLayout*)&local_srcImageLayout, sizeof(VkImageLayout)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7965 | uint64_t cgen_var_567; |
| 7966 | countingStream->handleMapping()->mapHandles_VkImage_u64(&local_dstImage, &cgen_var_567, 1); |
| 7967 | countingStream->write((uint64_t*)&cgen_var_567, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7968 | countingStream->write((VkImageLayout*)&local_dstImageLayout, sizeof(VkImageLayout)); |
| 7969 | countingStream->write((uint32_t*)&local_regionCount, sizeof(uint32_t)); |
| 7970 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 7971 | { |
| 7972 | marshal_VkImageCopy(countingStream, (VkImageCopy*)(local_pRegions + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7973 | } |
| 7974 | } |
| 7975 | uint32_t packetSize_vkCmdCopyImage = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 7976 | countingStream->rewind(); |
| 7977 | uint32_t opcode_vkCmdCopyImage = OP_vkCmdCopyImage; |
| 7978 | stream->write(&opcode_vkCmdCopyImage, sizeof(uint32_t)); |
| 7979 | stream->write(&packetSize_vkCmdCopyImage, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7980 | uint64_t cgen_var_568; |
| 7981 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_568, 1); |
| 7982 | stream->write((uint64_t*)&cgen_var_568, 1 * 8); |
| 7983 | uint64_t cgen_var_569; |
| 7984 | stream->handleMapping()->mapHandles_VkImage_u64(&local_srcImage, &cgen_var_569, 1); |
| 7985 | stream->write((uint64_t*)&cgen_var_569, 1 * 8); |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 7986 | stream->write((VkImageLayout*)&local_srcImageLayout, sizeof(VkImageLayout)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 7987 | uint64_t cgen_var_570; |
| 7988 | stream->handleMapping()->mapHandles_VkImage_u64(&local_dstImage, &cgen_var_570, 1); |
| 7989 | stream->write((uint64_t*)&cgen_var_570, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7990 | stream->write((VkImageLayout*)&local_dstImageLayout, sizeof(VkImageLayout)); |
| 7991 | stream->write((uint32_t*)&local_regionCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7992 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 7993 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 7994 | marshal_VkImageCopy(stream, (VkImageCopy*)(local_pRegions + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 7995 | } |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 7996 | pool->freeAll(); |
| 7997 | countingStream->clearPool(); |
| 7998 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 7999 | mImpl->log("finish vkCmdCopyImage");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8000 | } |
| 8001 | |
| 8002 | void VkEncoder::vkCmdBlitImage( |
| 8003 | VkCommandBuffer commandBuffer, |
| 8004 | VkImage srcImage, |
| 8005 | VkImageLayout srcImageLayout, |
| 8006 | VkImage dstImage, |
| 8007 | VkImageLayout dstImageLayout, |
| 8008 | uint32_t regionCount, |
| 8009 | const VkImageBlit* pRegions, |
| 8010 | VkFilter filter) |
| 8011 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 8012 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 8013 | mImpl->log("start vkCmdBlitImage"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8014 | auto stream = mImpl->stream(); |
| 8015 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8016 | auto resources = mImpl->resources(); |
| 8017 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 8018 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8019 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8020 | VkImage local_srcImage; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8021 | VkImageLayout local_srcImageLayout; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8022 | VkImage local_dstImage; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8023 | VkImageLayout local_dstImageLayout; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8024 | uint32_t local_regionCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8025 | VkImageBlit* local_pRegions; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 8026 | VkFilter local_filter; |
| 8027 | local_commandBuffer = commandBuffer; |
| 8028 | local_srcImage = srcImage; |
| 8029 | local_srcImageLayout = srcImageLayout; |
| 8030 | local_dstImage = dstImage; |
| 8031 | local_dstImageLayout = dstImageLayout; |
| 8032 | local_regionCount = regionCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8033 | local_pRegions = nullptr; |
| 8034 | if (pRegions) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8035 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8036 | local_pRegions = (VkImageBlit*)pool->alloc(((regionCount)) * sizeof(const VkImageBlit)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8037 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 8038 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8039 | deepcopy_VkImageBlit(pool, pRegions + i, (VkImageBlit*)(local_pRegions + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8040 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8041 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8042 | local_filter = filter; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 8043 | if (local_pRegions) |
| 8044 | { |
| 8045 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 8046 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 8047 | transform_tohost_VkImageBlit(mImpl->resources(), (VkImageBlit*)(local_pRegions + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 8048 | } |
| 8049 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8050 | countingStream->rewind(); |
| 8051 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 8052 | uint64_t cgen_var_571; |
| 8053 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_571, 1); |
| 8054 | countingStream->write((uint64_t*)&cgen_var_571, 1 * 8); |
| 8055 | uint64_t cgen_var_572; |
| 8056 | countingStream->handleMapping()->mapHandles_VkImage_u64(&local_srcImage, &cgen_var_572, 1); |
| 8057 | countingStream->write((uint64_t*)&cgen_var_572, 1 * 8); |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 8058 | countingStream->write((VkImageLayout*)&local_srcImageLayout, sizeof(VkImageLayout)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 8059 | uint64_t cgen_var_573; |
| 8060 | countingStream->handleMapping()->mapHandles_VkImage_u64(&local_dstImage, &cgen_var_573, 1); |
| 8061 | countingStream->write((uint64_t*)&cgen_var_573, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8062 | countingStream->write((VkImageLayout*)&local_dstImageLayout, sizeof(VkImageLayout)); |
| 8063 | countingStream->write((uint32_t*)&local_regionCount, sizeof(uint32_t)); |
| 8064 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 8065 | { |
| 8066 | marshal_VkImageBlit(countingStream, (VkImageBlit*)(local_pRegions + i)); |
| 8067 | } |
| 8068 | countingStream->write((VkFilter*)&local_filter, sizeof(VkFilter)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8069 | } |
| 8070 | uint32_t packetSize_vkCmdBlitImage = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 8071 | countingStream->rewind(); |
| 8072 | uint32_t opcode_vkCmdBlitImage = OP_vkCmdBlitImage; |
| 8073 | stream->write(&opcode_vkCmdBlitImage, sizeof(uint32_t)); |
| 8074 | stream->write(&packetSize_vkCmdBlitImage, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 8075 | uint64_t cgen_var_574; |
| 8076 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_574, 1); |
| 8077 | stream->write((uint64_t*)&cgen_var_574, 1 * 8); |
| 8078 | uint64_t cgen_var_575; |
| 8079 | stream->handleMapping()->mapHandles_VkImage_u64(&local_srcImage, &cgen_var_575, 1); |
| 8080 | stream->write((uint64_t*)&cgen_var_575, 1 * 8); |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 8081 | stream->write((VkImageLayout*)&local_srcImageLayout, sizeof(VkImageLayout)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 8082 | uint64_t cgen_var_576; |
| 8083 | stream->handleMapping()->mapHandles_VkImage_u64(&local_dstImage, &cgen_var_576, 1); |
| 8084 | stream->write((uint64_t*)&cgen_var_576, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8085 | stream->write((VkImageLayout*)&local_dstImageLayout, sizeof(VkImageLayout)); |
| 8086 | stream->write((uint32_t*)&local_regionCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8087 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 8088 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8089 | marshal_VkImageBlit(stream, (VkImageBlit*)(local_pRegions + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8090 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8091 | stream->write((VkFilter*)&local_filter, sizeof(VkFilter)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 8092 | pool->freeAll(); |
| 8093 | countingStream->clearPool(); |
| 8094 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 8095 | mImpl->log("finish vkCmdBlitImage");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8096 | } |
| 8097 | |
| 8098 | void VkEncoder::vkCmdCopyBufferToImage( |
| 8099 | VkCommandBuffer commandBuffer, |
| 8100 | VkBuffer srcBuffer, |
| 8101 | VkImage dstImage, |
| 8102 | VkImageLayout dstImageLayout, |
| 8103 | uint32_t regionCount, |
| 8104 | const VkBufferImageCopy* pRegions) |
| 8105 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 8106 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 8107 | mImpl->log("start vkCmdCopyBufferToImage"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8108 | auto stream = mImpl->stream(); |
| 8109 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8110 | auto resources = mImpl->resources(); |
| 8111 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 8112 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8113 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8114 | VkBuffer local_srcBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8115 | VkImage local_dstImage; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8116 | VkImageLayout local_dstImageLayout; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8117 | uint32_t local_regionCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8118 | VkBufferImageCopy* local_pRegions; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 8119 | local_commandBuffer = commandBuffer; |
| 8120 | local_srcBuffer = srcBuffer; |
| 8121 | local_dstImage = dstImage; |
| 8122 | local_dstImageLayout = dstImageLayout; |
| 8123 | local_regionCount = regionCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8124 | local_pRegions = nullptr; |
| 8125 | if (pRegions) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8126 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8127 | local_pRegions = (VkBufferImageCopy*)pool->alloc(((regionCount)) * sizeof(const VkBufferImageCopy)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8128 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 8129 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8130 | deepcopy_VkBufferImageCopy(pool, pRegions + i, (VkBufferImageCopy*)(local_pRegions + i)); |
| 8131 | } |
| 8132 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 8133 | if (local_pRegions) |
| 8134 | { |
| 8135 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 8136 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 8137 | transform_tohost_VkBufferImageCopy(mImpl->resources(), (VkBufferImageCopy*)(local_pRegions + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 8138 | } |
| 8139 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8140 | countingStream->rewind(); |
| 8141 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 8142 | uint64_t cgen_var_577; |
| 8143 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_577, 1); |
| 8144 | countingStream->write((uint64_t*)&cgen_var_577, 1 * 8); |
| 8145 | uint64_t cgen_var_578; |
| 8146 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_srcBuffer, &cgen_var_578, 1); |
| 8147 | countingStream->write((uint64_t*)&cgen_var_578, 1 * 8); |
| 8148 | uint64_t cgen_var_579; |
| 8149 | countingStream->handleMapping()->mapHandles_VkImage_u64(&local_dstImage, &cgen_var_579, 1); |
| 8150 | countingStream->write((uint64_t*)&cgen_var_579, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8151 | countingStream->write((VkImageLayout*)&local_dstImageLayout, sizeof(VkImageLayout)); |
| 8152 | countingStream->write((uint32_t*)&local_regionCount, sizeof(uint32_t)); |
| 8153 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 8154 | { |
| 8155 | marshal_VkBufferImageCopy(countingStream, (VkBufferImageCopy*)(local_pRegions + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8156 | } |
| 8157 | } |
| 8158 | uint32_t packetSize_vkCmdCopyBufferToImage = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 8159 | countingStream->rewind(); |
| 8160 | uint32_t opcode_vkCmdCopyBufferToImage = OP_vkCmdCopyBufferToImage; |
| 8161 | stream->write(&opcode_vkCmdCopyBufferToImage, sizeof(uint32_t)); |
| 8162 | stream->write(&packetSize_vkCmdCopyBufferToImage, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 8163 | uint64_t cgen_var_580; |
| 8164 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_580, 1); |
| 8165 | stream->write((uint64_t*)&cgen_var_580, 1 * 8); |
| 8166 | uint64_t cgen_var_581; |
| 8167 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_srcBuffer, &cgen_var_581, 1); |
| 8168 | stream->write((uint64_t*)&cgen_var_581, 1 * 8); |
| 8169 | uint64_t cgen_var_582; |
| 8170 | stream->handleMapping()->mapHandles_VkImage_u64(&local_dstImage, &cgen_var_582, 1); |
| 8171 | stream->write((uint64_t*)&cgen_var_582, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8172 | stream->write((VkImageLayout*)&local_dstImageLayout, sizeof(VkImageLayout)); |
| 8173 | stream->write((uint32_t*)&local_regionCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8174 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 8175 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8176 | marshal_VkBufferImageCopy(stream, (VkBufferImageCopy*)(local_pRegions + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8177 | } |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 8178 | pool->freeAll(); |
| 8179 | countingStream->clearPool(); |
| 8180 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 8181 | mImpl->log("finish vkCmdCopyBufferToImage");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8182 | } |
| 8183 | |
| 8184 | void VkEncoder::vkCmdCopyImageToBuffer( |
| 8185 | VkCommandBuffer commandBuffer, |
| 8186 | VkImage srcImage, |
| 8187 | VkImageLayout srcImageLayout, |
| 8188 | VkBuffer dstBuffer, |
| 8189 | uint32_t regionCount, |
| 8190 | const VkBufferImageCopy* pRegions) |
| 8191 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 8192 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 8193 | mImpl->log("start vkCmdCopyImageToBuffer"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8194 | auto stream = mImpl->stream(); |
| 8195 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8196 | auto resources = mImpl->resources(); |
| 8197 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 8198 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8199 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8200 | VkImage local_srcImage; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8201 | VkImageLayout local_srcImageLayout; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8202 | VkBuffer local_dstBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8203 | uint32_t local_regionCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8204 | VkBufferImageCopy* local_pRegions; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 8205 | local_commandBuffer = commandBuffer; |
| 8206 | local_srcImage = srcImage; |
| 8207 | local_srcImageLayout = srcImageLayout; |
| 8208 | local_dstBuffer = dstBuffer; |
| 8209 | local_regionCount = regionCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8210 | local_pRegions = nullptr; |
| 8211 | if (pRegions) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8212 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8213 | local_pRegions = (VkBufferImageCopy*)pool->alloc(((regionCount)) * sizeof(const VkBufferImageCopy)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8214 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 8215 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8216 | deepcopy_VkBufferImageCopy(pool, pRegions + i, (VkBufferImageCopy*)(local_pRegions + i)); |
| 8217 | } |
| 8218 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 8219 | if (local_pRegions) |
| 8220 | { |
| 8221 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 8222 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 8223 | transform_tohost_VkBufferImageCopy(mImpl->resources(), (VkBufferImageCopy*)(local_pRegions + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 8224 | } |
| 8225 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8226 | countingStream->rewind(); |
| 8227 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 8228 | uint64_t cgen_var_583; |
| 8229 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_583, 1); |
| 8230 | countingStream->write((uint64_t*)&cgen_var_583, 1 * 8); |
| 8231 | uint64_t cgen_var_584; |
| 8232 | countingStream->handleMapping()->mapHandles_VkImage_u64(&local_srcImage, &cgen_var_584, 1); |
| 8233 | countingStream->write((uint64_t*)&cgen_var_584, 1 * 8); |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 8234 | countingStream->write((VkImageLayout*)&local_srcImageLayout, sizeof(VkImageLayout)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 8235 | uint64_t cgen_var_585; |
| 8236 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_dstBuffer, &cgen_var_585, 1); |
| 8237 | countingStream->write((uint64_t*)&cgen_var_585, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8238 | countingStream->write((uint32_t*)&local_regionCount, sizeof(uint32_t)); |
| 8239 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 8240 | { |
| 8241 | marshal_VkBufferImageCopy(countingStream, (VkBufferImageCopy*)(local_pRegions + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8242 | } |
| 8243 | } |
| 8244 | uint32_t packetSize_vkCmdCopyImageToBuffer = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 8245 | countingStream->rewind(); |
| 8246 | uint32_t opcode_vkCmdCopyImageToBuffer = OP_vkCmdCopyImageToBuffer; |
| 8247 | stream->write(&opcode_vkCmdCopyImageToBuffer, sizeof(uint32_t)); |
| 8248 | stream->write(&packetSize_vkCmdCopyImageToBuffer, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 8249 | uint64_t cgen_var_586; |
| 8250 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_586, 1); |
| 8251 | stream->write((uint64_t*)&cgen_var_586, 1 * 8); |
| 8252 | uint64_t cgen_var_587; |
| 8253 | stream->handleMapping()->mapHandles_VkImage_u64(&local_srcImage, &cgen_var_587, 1); |
| 8254 | stream->write((uint64_t*)&cgen_var_587, 1 * 8); |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 8255 | stream->write((VkImageLayout*)&local_srcImageLayout, sizeof(VkImageLayout)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 8256 | uint64_t cgen_var_588; |
| 8257 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_dstBuffer, &cgen_var_588, 1); |
| 8258 | stream->write((uint64_t*)&cgen_var_588, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8259 | stream->write((uint32_t*)&local_regionCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8260 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 8261 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8262 | marshal_VkBufferImageCopy(stream, (VkBufferImageCopy*)(local_pRegions + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8263 | } |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 8264 | pool->freeAll(); |
| 8265 | countingStream->clearPool(); |
| 8266 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 8267 | mImpl->log("finish vkCmdCopyImageToBuffer");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8268 | } |
| 8269 | |
| 8270 | void VkEncoder::vkCmdUpdateBuffer( |
| 8271 | VkCommandBuffer commandBuffer, |
| 8272 | VkBuffer dstBuffer, |
| 8273 | VkDeviceSize dstOffset, |
| 8274 | VkDeviceSize dataSize, |
| 8275 | const void* pData) |
| 8276 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 8277 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 8278 | mImpl->log("start vkCmdUpdateBuffer"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8279 | auto stream = mImpl->stream(); |
| 8280 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8281 | auto resources = mImpl->resources(); |
| 8282 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 8283 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8284 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8285 | VkBuffer local_dstBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8286 | VkDeviceSize local_dstOffset; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8287 | VkDeviceSize local_dataSize; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8288 | void* local_pData; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 8289 | local_commandBuffer = commandBuffer; |
| 8290 | local_dstBuffer = dstBuffer; |
| 8291 | local_dstOffset = dstOffset; |
| 8292 | local_dataSize = dataSize; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8293 | local_pData = nullptr; |
| 8294 | if (pData) |
| 8295 | { |
| 8296 | local_pData = (void*)pool->dupArray(pData, ((dataSize)) * sizeof(const uint8_t)); |
| 8297 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8298 | countingStream->rewind(); |
| 8299 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 8300 | uint64_t cgen_var_589; |
| 8301 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_589, 1); |
| 8302 | countingStream->write((uint64_t*)&cgen_var_589, 1 * 8); |
| 8303 | uint64_t cgen_var_590; |
| 8304 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_dstBuffer, &cgen_var_590, 1); |
| 8305 | countingStream->write((uint64_t*)&cgen_var_590, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8306 | countingStream->write((VkDeviceSize*)&local_dstOffset, sizeof(VkDeviceSize)); |
| 8307 | countingStream->write((VkDeviceSize*)&local_dataSize, sizeof(VkDeviceSize)); |
| 8308 | countingStream->write((void*)local_pData, ((dataSize)) * sizeof(uint8_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8309 | } |
| 8310 | uint32_t packetSize_vkCmdUpdateBuffer = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 8311 | countingStream->rewind(); |
| 8312 | uint32_t opcode_vkCmdUpdateBuffer = OP_vkCmdUpdateBuffer; |
| 8313 | stream->write(&opcode_vkCmdUpdateBuffer, sizeof(uint32_t)); |
| 8314 | stream->write(&packetSize_vkCmdUpdateBuffer, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 8315 | uint64_t cgen_var_591; |
| 8316 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_591, 1); |
| 8317 | stream->write((uint64_t*)&cgen_var_591, 1 * 8); |
| 8318 | uint64_t cgen_var_592; |
| 8319 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_dstBuffer, &cgen_var_592, 1); |
| 8320 | stream->write((uint64_t*)&cgen_var_592, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8321 | stream->write((VkDeviceSize*)&local_dstOffset, sizeof(VkDeviceSize)); |
| 8322 | stream->write((VkDeviceSize*)&local_dataSize, sizeof(VkDeviceSize)); |
| 8323 | stream->write((void*)local_pData, ((dataSize)) * sizeof(uint8_t)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 8324 | pool->freeAll(); |
| 8325 | countingStream->clearPool(); |
| 8326 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 8327 | mImpl->log("finish vkCmdUpdateBuffer");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8328 | } |
| 8329 | |
| 8330 | void VkEncoder::vkCmdFillBuffer( |
| 8331 | VkCommandBuffer commandBuffer, |
| 8332 | VkBuffer dstBuffer, |
| 8333 | VkDeviceSize dstOffset, |
| 8334 | VkDeviceSize size, |
| 8335 | uint32_t data) |
| 8336 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 8337 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 8338 | mImpl->log("start vkCmdFillBuffer"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8339 | auto stream = mImpl->stream(); |
| 8340 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8341 | auto resources = mImpl->resources(); |
| 8342 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 8343 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8344 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8345 | VkBuffer local_dstBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8346 | VkDeviceSize local_dstOffset; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8347 | VkDeviceSize local_size; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8348 | uint32_t local_data; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 8349 | local_commandBuffer = commandBuffer; |
| 8350 | local_dstBuffer = dstBuffer; |
| 8351 | local_dstOffset = dstOffset; |
| 8352 | local_size = size; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8353 | local_data = data; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8354 | countingStream->rewind(); |
| 8355 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 8356 | uint64_t cgen_var_593; |
| 8357 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_593, 1); |
| 8358 | countingStream->write((uint64_t*)&cgen_var_593, 1 * 8); |
| 8359 | uint64_t cgen_var_594; |
| 8360 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_dstBuffer, &cgen_var_594, 1); |
| 8361 | countingStream->write((uint64_t*)&cgen_var_594, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8362 | countingStream->write((VkDeviceSize*)&local_dstOffset, sizeof(VkDeviceSize)); |
| 8363 | countingStream->write((VkDeviceSize*)&local_size, sizeof(VkDeviceSize)); |
| 8364 | countingStream->write((uint32_t*)&local_data, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8365 | } |
| 8366 | uint32_t packetSize_vkCmdFillBuffer = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 8367 | countingStream->rewind(); |
| 8368 | uint32_t opcode_vkCmdFillBuffer = OP_vkCmdFillBuffer; |
| 8369 | stream->write(&opcode_vkCmdFillBuffer, sizeof(uint32_t)); |
| 8370 | stream->write(&packetSize_vkCmdFillBuffer, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 8371 | uint64_t cgen_var_595; |
| 8372 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_595, 1); |
| 8373 | stream->write((uint64_t*)&cgen_var_595, 1 * 8); |
| 8374 | uint64_t cgen_var_596; |
| 8375 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_dstBuffer, &cgen_var_596, 1); |
| 8376 | stream->write((uint64_t*)&cgen_var_596, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8377 | stream->write((VkDeviceSize*)&local_dstOffset, sizeof(VkDeviceSize)); |
| 8378 | stream->write((VkDeviceSize*)&local_size, sizeof(VkDeviceSize)); |
| 8379 | stream->write((uint32_t*)&local_data, sizeof(uint32_t)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 8380 | pool->freeAll(); |
| 8381 | countingStream->clearPool(); |
| 8382 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 8383 | mImpl->log("finish vkCmdFillBuffer");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8384 | } |
| 8385 | |
| 8386 | void VkEncoder::vkCmdClearColorImage( |
| 8387 | VkCommandBuffer commandBuffer, |
| 8388 | VkImage image, |
| 8389 | VkImageLayout imageLayout, |
| 8390 | const VkClearColorValue* pColor, |
| 8391 | uint32_t rangeCount, |
| 8392 | const VkImageSubresourceRange* pRanges) |
| 8393 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 8394 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 8395 | mImpl->log("start vkCmdClearColorImage"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8396 | auto stream = mImpl->stream(); |
| 8397 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8398 | auto resources = mImpl->resources(); |
| 8399 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 8400 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8401 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8402 | VkImage local_image; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8403 | VkImageLayout local_imageLayout; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8404 | VkClearColorValue* local_pColor; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 8405 | uint32_t local_rangeCount; |
| 8406 | VkImageSubresourceRange* local_pRanges; |
| 8407 | local_commandBuffer = commandBuffer; |
| 8408 | local_image = image; |
| 8409 | local_imageLayout = imageLayout; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8410 | local_pColor = nullptr; |
| 8411 | if (pColor) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8412 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8413 | local_pColor = (VkClearColorValue*)pool->alloc(sizeof(const VkClearColorValue)); |
| 8414 | deepcopy_VkClearColorValue(pool, pColor, (VkClearColorValue*)(local_pColor)); |
| 8415 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8416 | local_rangeCount = rangeCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8417 | local_pRanges = nullptr; |
| 8418 | if (pRanges) |
| 8419 | { |
| 8420 | local_pRanges = (VkImageSubresourceRange*)pool->alloc(((rangeCount)) * sizeof(const VkImageSubresourceRange)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8421 | for (uint32_t i = 0; i < (uint32_t)((rangeCount)); ++i) |
| 8422 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8423 | deepcopy_VkImageSubresourceRange(pool, pRanges + i, (VkImageSubresourceRange*)(local_pRanges + i)); |
| 8424 | } |
| 8425 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 8426 | if (local_pColor) |
| 8427 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 8428 | transform_tohost_VkClearColorValue(mImpl->resources(), (VkClearColorValue*)(local_pColor)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 8429 | } |
| 8430 | if (local_pRanges) |
| 8431 | { |
| 8432 | for (uint32_t i = 0; i < (uint32_t)((rangeCount)); ++i) |
| 8433 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 8434 | transform_tohost_VkImageSubresourceRange(mImpl->resources(), (VkImageSubresourceRange*)(local_pRanges + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 8435 | } |
| 8436 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8437 | countingStream->rewind(); |
| 8438 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 8439 | uint64_t cgen_var_597; |
| 8440 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_597, 1); |
| 8441 | countingStream->write((uint64_t*)&cgen_var_597, 1 * 8); |
| 8442 | uint64_t cgen_var_598; |
| 8443 | countingStream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_598, 1); |
| 8444 | countingStream->write((uint64_t*)&cgen_var_598, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8445 | countingStream->write((VkImageLayout*)&local_imageLayout, sizeof(VkImageLayout)); |
| 8446 | marshal_VkClearColorValue(countingStream, (VkClearColorValue*)(local_pColor)); |
| 8447 | countingStream->write((uint32_t*)&local_rangeCount, sizeof(uint32_t)); |
| 8448 | for (uint32_t i = 0; i < (uint32_t)((rangeCount)); ++i) |
| 8449 | { |
| 8450 | marshal_VkImageSubresourceRange(countingStream, (VkImageSubresourceRange*)(local_pRanges + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8451 | } |
| 8452 | } |
| 8453 | uint32_t packetSize_vkCmdClearColorImage = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 8454 | countingStream->rewind(); |
| 8455 | uint32_t opcode_vkCmdClearColorImage = OP_vkCmdClearColorImage; |
| 8456 | stream->write(&opcode_vkCmdClearColorImage, sizeof(uint32_t)); |
| 8457 | stream->write(&packetSize_vkCmdClearColorImage, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 8458 | uint64_t cgen_var_599; |
| 8459 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_599, 1); |
| 8460 | stream->write((uint64_t*)&cgen_var_599, 1 * 8); |
| 8461 | uint64_t cgen_var_600; |
| 8462 | stream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_600, 1); |
| 8463 | stream->write((uint64_t*)&cgen_var_600, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8464 | stream->write((VkImageLayout*)&local_imageLayout, sizeof(VkImageLayout)); |
| 8465 | marshal_VkClearColorValue(stream, (VkClearColorValue*)(local_pColor)); |
| 8466 | stream->write((uint32_t*)&local_rangeCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8467 | for (uint32_t i = 0; i < (uint32_t)((rangeCount)); ++i) |
| 8468 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8469 | marshal_VkImageSubresourceRange(stream, (VkImageSubresourceRange*)(local_pRanges + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8470 | } |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 8471 | pool->freeAll(); |
| 8472 | countingStream->clearPool(); |
| 8473 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 8474 | mImpl->log("finish vkCmdClearColorImage");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8475 | } |
| 8476 | |
| 8477 | void VkEncoder::vkCmdClearDepthStencilImage( |
| 8478 | VkCommandBuffer commandBuffer, |
| 8479 | VkImage image, |
| 8480 | VkImageLayout imageLayout, |
| 8481 | const VkClearDepthStencilValue* pDepthStencil, |
| 8482 | uint32_t rangeCount, |
| 8483 | const VkImageSubresourceRange* pRanges) |
| 8484 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 8485 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 8486 | mImpl->log("start vkCmdClearDepthStencilImage"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8487 | auto stream = mImpl->stream(); |
| 8488 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8489 | auto resources = mImpl->resources(); |
| 8490 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 8491 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8492 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8493 | VkImage local_image; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8494 | VkImageLayout local_imageLayout; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8495 | VkClearDepthStencilValue* local_pDepthStencil; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 8496 | uint32_t local_rangeCount; |
| 8497 | VkImageSubresourceRange* local_pRanges; |
| 8498 | local_commandBuffer = commandBuffer; |
| 8499 | local_image = image; |
| 8500 | local_imageLayout = imageLayout; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8501 | local_pDepthStencil = nullptr; |
| 8502 | if (pDepthStencil) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8503 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8504 | local_pDepthStencil = (VkClearDepthStencilValue*)pool->alloc(sizeof(const VkClearDepthStencilValue)); |
| 8505 | deepcopy_VkClearDepthStencilValue(pool, pDepthStencil, (VkClearDepthStencilValue*)(local_pDepthStencil)); |
| 8506 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8507 | local_rangeCount = rangeCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8508 | local_pRanges = nullptr; |
| 8509 | if (pRanges) |
| 8510 | { |
| 8511 | local_pRanges = (VkImageSubresourceRange*)pool->alloc(((rangeCount)) * sizeof(const VkImageSubresourceRange)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8512 | for (uint32_t i = 0; i < (uint32_t)((rangeCount)); ++i) |
| 8513 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8514 | deepcopy_VkImageSubresourceRange(pool, pRanges + i, (VkImageSubresourceRange*)(local_pRanges + i)); |
| 8515 | } |
| 8516 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 8517 | if (local_pDepthStencil) |
| 8518 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 8519 | transform_tohost_VkClearDepthStencilValue(mImpl->resources(), (VkClearDepthStencilValue*)(local_pDepthStencil)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 8520 | } |
| 8521 | if (local_pRanges) |
| 8522 | { |
| 8523 | for (uint32_t i = 0; i < (uint32_t)((rangeCount)); ++i) |
| 8524 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 8525 | transform_tohost_VkImageSubresourceRange(mImpl->resources(), (VkImageSubresourceRange*)(local_pRanges + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 8526 | } |
| 8527 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8528 | countingStream->rewind(); |
| 8529 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 8530 | uint64_t cgen_var_601; |
| 8531 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_601, 1); |
| 8532 | countingStream->write((uint64_t*)&cgen_var_601, 1 * 8); |
| 8533 | uint64_t cgen_var_602; |
| 8534 | countingStream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_602, 1); |
| 8535 | countingStream->write((uint64_t*)&cgen_var_602, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8536 | countingStream->write((VkImageLayout*)&local_imageLayout, sizeof(VkImageLayout)); |
| 8537 | marshal_VkClearDepthStencilValue(countingStream, (VkClearDepthStencilValue*)(local_pDepthStencil)); |
| 8538 | countingStream->write((uint32_t*)&local_rangeCount, sizeof(uint32_t)); |
| 8539 | for (uint32_t i = 0; i < (uint32_t)((rangeCount)); ++i) |
| 8540 | { |
| 8541 | marshal_VkImageSubresourceRange(countingStream, (VkImageSubresourceRange*)(local_pRanges + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8542 | } |
| 8543 | } |
| 8544 | uint32_t packetSize_vkCmdClearDepthStencilImage = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 8545 | countingStream->rewind(); |
| 8546 | uint32_t opcode_vkCmdClearDepthStencilImage = OP_vkCmdClearDepthStencilImage; |
| 8547 | stream->write(&opcode_vkCmdClearDepthStencilImage, sizeof(uint32_t)); |
| 8548 | stream->write(&packetSize_vkCmdClearDepthStencilImage, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 8549 | uint64_t cgen_var_603; |
| 8550 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_603, 1); |
| 8551 | stream->write((uint64_t*)&cgen_var_603, 1 * 8); |
| 8552 | uint64_t cgen_var_604; |
| 8553 | stream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_604, 1); |
| 8554 | stream->write((uint64_t*)&cgen_var_604, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8555 | stream->write((VkImageLayout*)&local_imageLayout, sizeof(VkImageLayout)); |
| 8556 | marshal_VkClearDepthStencilValue(stream, (VkClearDepthStencilValue*)(local_pDepthStencil)); |
| 8557 | stream->write((uint32_t*)&local_rangeCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8558 | for (uint32_t i = 0; i < (uint32_t)((rangeCount)); ++i) |
| 8559 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8560 | marshal_VkImageSubresourceRange(stream, (VkImageSubresourceRange*)(local_pRanges + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8561 | } |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 8562 | pool->freeAll(); |
| 8563 | countingStream->clearPool(); |
| 8564 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 8565 | mImpl->log("finish vkCmdClearDepthStencilImage");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8566 | } |
| 8567 | |
| 8568 | void VkEncoder::vkCmdClearAttachments( |
| 8569 | VkCommandBuffer commandBuffer, |
| 8570 | uint32_t attachmentCount, |
| 8571 | const VkClearAttachment* pAttachments, |
| 8572 | uint32_t rectCount, |
| 8573 | const VkClearRect* pRects) |
| 8574 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 8575 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 8576 | mImpl->log("start vkCmdClearAttachments"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8577 | auto stream = mImpl->stream(); |
| 8578 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8579 | auto resources = mImpl->resources(); |
| 8580 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 8581 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8582 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8583 | uint32_t local_attachmentCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8584 | VkClearAttachment* local_pAttachments; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 8585 | uint32_t local_rectCount; |
| 8586 | VkClearRect* local_pRects; |
| 8587 | local_commandBuffer = commandBuffer; |
| 8588 | local_attachmentCount = attachmentCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8589 | local_pAttachments = nullptr; |
| 8590 | if (pAttachments) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8591 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8592 | local_pAttachments = (VkClearAttachment*)pool->alloc(((attachmentCount)) * sizeof(const VkClearAttachment)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8593 | for (uint32_t i = 0; i < (uint32_t)((attachmentCount)); ++i) |
| 8594 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8595 | deepcopy_VkClearAttachment(pool, pAttachments + i, (VkClearAttachment*)(local_pAttachments + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8596 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8597 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8598 | local_rectCount = rectCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8599 | local_pRects = nullptr; |
| 8600 | if (pRects) |
| 8601 | { |
| 8602 | local_pRects = (VkClearRect*)pool->alloc(((rectCount)) * sizeof(const VkClearRect)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8603 | for (uint32_t i = 0; i < (uint32_t)((rectCount)); ++i) |
| 8604 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8605 | deepcopy_VkClearRect(pool, pRects + i, (VkClearRect*)(local_pRects + i)); |
| 8606 | } |
| 8607 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 8608 | if (local_pAttachments) |
| 8609 | { |
| 8610 | for (uint32_t i = 0; i < (uint32_t)((attachmentCount)); ++i) |
| 8611 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 8612 | transform_tohost_VkClearAttachment(mImpl->resources(), (VkClearAttachment*)(local_pAttachments + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 8613 | } |
| 8614 | } |
| 8615 | if (local_pRects) |
| 8616 | { |
| 8617 | for (uint32_t i = 0; i < (uint32_t)((rectCount)); ++i) |
| 8618 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 8619 | transform_tohost_VkClearRect(mImpl->resources(), (VkClearRect*)(local_pRects + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 8620 | } |
| 8621 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8622 | countingStream->rewind(); |
| 8623 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 8624 | uint64_t cgen_var_605; |
| 8625 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_605, 1); |
| 8626 | countingStream->write((uint64_t*)&cgen_var_605, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8627 | countingStream->write((uint32_t*)&local_attachmentCount, sizeof(uint32_t)); |
| 8628 | for (uint32_t i = 0; i < (uint32_t)((attachmentCount)); ++i) |
| 8629 | { |
| 8630 | marshal_VkClearAttachment(countingStream, (VkClearAttachment*)(local_pAttachments + i)); |
| 8631 | } |
| 8632 | countingStream->write((uint32_t*)&local_rectCount, sizeof(uint32_t)); |
| 8633 | for (uint32_t i = 0; i < (uint32_t)((rectCount)); ++i) |
| 8634 | { |
| 8635 | marshal_VkClearRect(countingStream, (VkClearRect*)(local_pRects + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8636 | } |
| 8637 | } |
| 8638 | uint32_t packetSize_vkCmdClearAttachments = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 8639 | countingStream->rewind(); |
| 8640 | uint32_t opcode_vkCmdClearAttachments = OP_vkCmdClearAttachments; |
| 8641 | stream->write(&opcode_vkCmdClearAttachments, sizeof(uint32_t)); |
| 8642 | stream->write(&packetSize_vkCmdClearAttachments, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 8643 | uint64_t cgen_var_606; |
| 8644 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_606, 1); |
| 8645 | stream->write((uint64_t*)&cgen_var_606, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8646 | stream->write((uint32_t*)&local_attachmentCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8647 | for (uint32_t i = 0; i < (uint32_t)((attachmentCount)); ++i) |
| 8648 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8649 | marshal_VkClearAttachment(stream, (VkClearAttachment*)(local_pAttachments + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8650 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8651 | stream->write((uint32_t*)&local_rectCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8652 | for (uint32_t i = 0; i < (uint32_t)((rectCount)); ++i) |
| 8653 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8654 | marshal_VkClearRect(stream, (VkClearRect*)(local_pRects + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8655 | } |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 8656 | pool->freeAll(); |
| 8657 | countingStream->clearPool(); |
| 8658 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 8659 | mImpl->log("finish vkCmdClearAttachments");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8660 | } |
| 8661 | |
| 8662 | void VkEncoder::vkCmdResolveImage( |
| 8663 | VkCommandBuffer commandBuffer, |
| 8664 | VkImage srcImage, |
| 8665 | VkImageLayout srcImageLayout, |
| 8666 | VkImage dstImage, |
| 8667 | VkImageLayout dstImageLayout, |
| 8668 | uint32_t regionCount, |
| 8669 | const VkImageResolve* pRegions) |
| 8670 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 8671 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 8672 | mImpl->log("start vkCmdResolveImage"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8673 | auto stream = mImpl->stream(); |
| 8674 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8675 | auto resources = mImpl->resources(); |
| 8676 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 8677 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8678 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8679 | VkImage local_srcImage; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8680 | VkImageLayout local_srcImageLayout; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8681 | VkImage local_dstImage; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8682 | VkImageLayout local_dstImageLayout; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8683 | uint32_t local_regionCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8684 | VkImageResolve* local_pRegions; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 8685 | local_commandBuffer = commandBuffer; |
| 8686 | local_srcImage = srcImage; |
| 8687 | local_srcImageLayout = srcImageLayout; |
| 8688 | local_dstImage = dstImage; |
| 8689 | local_dstImageLayout = dstImageLayout; |
| 8690 | local_regionCount = regionCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8691 | local_pRegions = nullptr; |
| 8692 | if (pRegions) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8693 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8694 | local_pRegions = (VkImageResolve*)pool->alloc(((regionCount)) * sizeof(const VkImageResolve)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8695 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 8696 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8697 | deepcopy_VkImageResolve(pool, pRegions + i, (VkImageResolve*)(local_pRegions + i)); |
| 8698 | } |
| 8699 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 8700 | if (local_pRegions) |
| 8701 | { |
| 8702 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 8703 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 8704 | transform_tohost_VkImageResolve(mImpl->resources(), (VkImageResolve*)(local_pRegions + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 8705 | } |
| 8706 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8707 | countingStream->rewind(); |
| 8708 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 8709 | uint64_t cgen_var_607; |
| 8710 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_607, 1); |
| 8711 | countingStream->write((uint64_t*)&cgen_var_607, 1 * 8); |
| 8712 | uint64_t cgen_var_608; |
| 8713 | countingStream->handleMapping()->mapHandles_VkImage_u64(&local_srcImage, &cgen_var_608, 1); |
| 8714 | countingStream->write((uint64_t*)&cgen_var_608, 1 * 8); |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 8715 | countingStream->write((VkImageLayout*)&local_srcImageLayout, sizeof(VkImageLayout)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 8716 | uint64_t cgen_var_609; |
| 8717 | countingStream->handleMapping()->mapHandles_VkImage_u64(&local_dstImage, &cgen_var_609, 1); |
| 8718 | countingStream->write((uint64_t*)&cgen_var_609, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8719 | countingStream->write((VkImageLayout*)&local_dstImageLayout, sizeof(VkImageLayout)); |
| 8720 | countingStream->write((uint32_t*)&local_regionCount, sizeof(uint32_t)); |
| 8721 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 8722 | { |
| 8723 | marshal_VkImageResolve(countingStream, (VkImageResolve*)(local_pRegions + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8724 | } |
| 8725 | } |
| 8726 | uint32_t packetSize_vkCmdResolveImage = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 8727 | countingStream->rewind(); |
| 8728 | uint32_t opcode_vkCmdResolveImage = OP_vkCmdResolveImage; |
| 8729 | stream->write(&opcode_vkCmdResolveImage, sizeof(uint32_t)); |
| 8730 | stream->write(&packetSize_vkCmdResolveImage, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 8731 | uint64_t cgen_var_610; |
| 8732 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_610, 1); |
| 8733 | stream->write((uint64_t*)&cgen_var_610, 1 * 8); |
| 8734 | uint64_t cgen_var_611; |
| 8735 | stream->handleMapping()->mapHandles_VkImage_u64(&local_srcImage, &cgen_var_611, 1); |
| 8736 | stream->write((uint64_t*)&cgen_var_611, 1 * 8); |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 8737 | stream->write((VkImageLayout*)&local_srcImageLayout, sizeof(VkImageLayout)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 8738 | uint64_t cgen_var_612; |
| 8739 | stream->handleMapping()->mapHandles_VkImage_u64(&local_dstImage, &cgen_var_612, 1); |
| 8740 | stream->write((uint64_t*)&cgen_var_612, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8741 | stream->write((VkImageLayout*)&local_dstImageLayout, sizeof(VkImageLayout)); |
| 8742 | stream->write((uint32_t*)&local_regionCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8743 | for (uint32_t i = 0; i < (uint32_t)((regionCount)); ++i) |
| 8744 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8745 | marshal_VkImageResolve(stream, (VkImageResolve*)(local_pRegions + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8746 | } |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 8747 | pool->freeAll(); |
| 8748 | countingStream->clearPool(); |
| 8749 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 8750 | mImpl->log("finish vkCmdResolveImage");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8751 | } |
| 8752 | |
| 8753 | void VkEncoder::vkCmdSetEvent( |
| 8754 | VkCommandBuffer commandBuffer, |
| 8755 | VkEvent event, |
| 8756 | VkPipelineStageFlags stageMask) |
| 8757 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 8758 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 8759 | mImpl->log("start vkCmdSetEvent"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8760 | auto stream = mImpl->stream(); |
| 8761 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8762 | auto resources = mImpl->resources(); |
| 8763 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 8764 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8765 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8766 | VkEvent local_event; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8767 | VkPipelineStageFlags local_stageMask; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 8768 | local_commandBuffer = commandBuffer; |
| 8769 | local_event = event; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8770 | local_stageMask = stageMask; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8771 | countingStream->rewind(); |
| 8772 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 8773 | uint64_t cgen_var_613; |
| 8774 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_613, 1); |
| 8775 | countingStream->write((uint64_t*)&cgen_var_613, 1 * 8); |
| 8776 | uint64_t cgen_var_614; |
| 8777 | countingStream->handleMapping()->mapHandles_VkEvent_u64(&local_event, &cgen_var_614, 1); |
| 8778 | countingStream->write((uint64_t*)&cgen_var_614, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8779 | countingStream->write((VkPipelineStageFlags*)&local_stageMask, sizeof(VkPipelineStageFlags)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8780 | } |
| 8781 | uint32_t packetSize_vkCmdSetEvent = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 8782 | countingStream->rewind(); |
| 8783 | uint32_t opcode_vkCmdSetEvent = OP_vkCmdSetEvent; |
| 8784 | stream->write(&opcode_vkCmdSetEvent, sizeof(uint32_t)); |
| 8785 | stream->write(&packetSize_vkCmdSetEvent, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 8786 | uint64_t cgen_var_615; |
| 8787 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_615, 1); |
| 8788 | stream->write((uint64_t*)&cgen_var_615, 1 * 8); |
| 8789 | uint64_t cgen_var_616; |
| 8790 | stream->handleMapping()->mapHandles_VkEvent_u64(&local_event, &cgen_var_616, 1); |
| 8791 | stream->write((uint64_t*)&cgen_var_616, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8792 | stream->write((VkPipelineStageFlags*)&local_stageMask, sizeof(VkPipelineStageFlags)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 8793 | pool->freeAll(); |
| 8794 | countingStream->clearPool(); |
| 8795 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 8796 | mImpl->log("finish vkCmdSetEvent");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8797 | } |
| 8798 | |
| 8799 | void VkEncoder::vkCmdResetEvent( |
| 8800 | VkCommandBuffer commandBuffer, |
| 8801 | VkEvent event, |
| 8802 | VkPipelineStageFlags stageMask) |
| 8803 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 8804 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 8805 | mImpl->log("start vkCmdResetEvent"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8806 | auto stream = mImpl->stream(); |
| 8807 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8808 | auto resources = mImpl->resources(); |
| 8809 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 8810 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8811 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8812 | VkEvent local_event; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8813 | VkPipelineStageFlags local_stageMask; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 8814 | local_commandBuffer = commandBuffer; |
| 8815 | local_event = event; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8816 | local_stageMask = stageMask; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8817 | countingStream->rewind(); |
| 8818 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 8819 | uint64_t cgen_var_617; |
| 8820 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_617, 1); |
| 8821 | countingStream->write((uint64_t*)&cgen_var_617, 1 * 8); |
| 8822 | uint64_t cgen_var_618; |
| 8823 | countingStream->handleMapping()->mapHandles_VkEvent_u64(&local_event, &cgen_var_618, 1); |
| 8824 | countingStream->write((uint64_t*)&cgen_var_618, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8825 | countingStream->write((VkPipelineStageFlags*)&local_stageMask, sizeof(VkPipelineStageFlags)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8826 | } |
| 8827 | uint32_t packetSize_vkCmdResetEvent = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 8828 | countingStream->rewind(); |
| 8829 | uint32_t opcode_vkCmdResetEvent = OP_vkCmdResetEvent; |
| 8830 | stream->write(&opcode_vkCmdResetEvent, sizeof(uint32_t)); |
| 8831 | stream->write(&packetSize_vkCmdResetEvent, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 8832 | uint64_t cgen_var_619; |
| 8833 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_619, 1); |
| 8834 | stream->write((uint64_t*)&cgen_var_619, 1 * 8); |
| 8835 | uint64_t cgen_var_620; |
| 8836 | stream->handleMapping()->mapHandles_VkEvent_u64(&local_event, &cgen_var_620, 1); |
| 8837 | stream->write((uint64_t*)&cgen_var_620, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8838 | stream->write((VkPipelineStageFlags*)&local_stageMask, sizeof(VkPipelineStageFlags)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 8839 | pool->freeAll(); |
| 8840 | countingStream->clearPool(); |
| 8841 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 8842 | mImpl->log("finish vkCmdResetEvent");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8843 | } |
| 8844 | |
| 8845 | void VkEncoder::vkCmdWaitEvents( |
| 8846 | VkCommandBuffer commandBuffer, |
| 8847 | uint32_t eventCount, |
| 8848 | const VkEvent* pEvents, |
| 8849 | VkPipelineStageFlags srcStageMask, |
| 8850 | VkPipelineStageFlags dstStageMask, |
| 8851 | uint32_t memoryBarrierCount, |
| 8852 | const VkMemoryBarrier* pMemoryBarriers, |
| 8853 | uint32_t bufferMemoryBarrierCount, |
| 8854 | const VkBufferMemoryBarrier* pBufferMemoryBarriers, |
| 8855 | uint32_t imageMemoryBarrierCount, |
| 8856 | const VkImageMemoryBarrier* pImageMemoryBarriers) |
| 8857 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 8858 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 8859 | mImpl->log("start vkCmdWaitEvents"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8860 | auto stream = mImpl->stream(); |
| 8861 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8862 | auto resources = mImpl->resources(); |
| 8863 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 8864 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8865 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8866 | uint32_t local_eventCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8867 | VkEvent* local_pEvents; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 8868 | VkPipelineStageFlags local_srcStageMask; |
| 8869 | VkPipelineStageFlags local_dstStageMask; |
| 8870 | uint32_t local_memoryBarrierCount; |
| 8871 | VkMemoryBarrier* local_pMemoryBarriers; |
| 8872 | uint32_t local_bufferMemoryBarrierCount; |
| 8873 | VkBufferMemoryBarrier* local_pBufferMemoryBarriers; |
| 8874 | uint32_t local_imageMemoryBarrierCount; |
| 8875 | VkImageMemoryBarrier* local_pImageMemoryBarriers; |
| 8876 | local_commandBuffer = commandBuffer; |
| 8877 | local_eventCount = eventCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8878 | local_pEvents = nullptr; |
| 8879 | if (pEvents) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8880 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8881 | local_pEvents = (VkEvent*)pool->dupArray(pEvents, ((eventCount)) * sizeof(const VkEvent)); |
| 8882 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8883 | local_srcStageMask = srcStageMask; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8884 | local_dstStageMask = dstStageMask; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8885 | local_memoryBarrierCount = memoryBarrierCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8886 | local_pMemoryBarriers = nullptr; |
| 8887 | if (pMemoryBarriers) |
| 8888 | { |
| 8889 | local_pMemoryBarriers = (VkMemoryBarrier*)pool->alloc(((memoryBarrierCount)) * sizeof(const VkMemoryBarrier)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8890 | for (uint32_t i = 0; i < (uint32_t)((memoryBarrierCount)); ++i) |
| 8891 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8892 | deepcopy_VkMemoryBarrier(pool, pMemoryBarriers + i, (VkMemoryBarrier*)(local_pMemoryBarriers + 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 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8895 | local_bufferMemoryBarrierCount = bufferMemoryBarrierCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8896 | local_pBufferMemoryBarriers = nullptr; |
| 8897 | if (pBufferMemoryBarriers) |
| 8898 | { |
| 8899 | local_pBufferMemoryBarriers = (VkBufferMemoryBarrier*)pool->alloc(((bufferMemoryBarrierCount)) * sizeof(const VkBufferMemoryBarrier)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8900 | for (uint32_t i = 0; i < (uint32_t)((bufferMemoryBarrierCount)); ++i) |
| 8901 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8902 | deepcopy_VkBufferMemoryBarrier(pool, pBufferMemoryBarriers + i, (VkBufferMemoryBarrier*)(local_pBufferMemoryBarriers + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8903 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8904 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8905 | local_imageMemoryBarrierCount = imageMemoryBarrierCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8906 | local_pImageMemoryBarriers = nullptr; |
| 8907 | if (pImageMemoryBarriers) |
| 8908 | { |
| 8909 | local_pImageMemoryBarriers = (VkImageMemoryBarrier*)pool->alloc(((imageMemoryBarrierCount)) * sizeof(const VkImageMemoryBarrier)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8910 | for (uint32_t i = 0; i < (uint32_t)((imageMemoryBarrierCount)); ++i) |
| 8911 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8912 | deepcopy_VkImageMemoryBarrier(pool, pImageMemoryBarriers + i, (VkImageMemoryBarrier*)(local_pImageMemoryBarriers + i)); |
| 8913 | } |
| 8914 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 8915 | if (local_pMemoryBarriers) |
| 8916 | { |
| 8917 | for (uint32_t i = 0; i < (uint32_t)((memoryBarrierCount)); ++i) |
| 8918 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 8919 | transform_tohost_VkMemoryBarrier(mImpl->resources(), (VkMemoryBarrier*)(local_pMemoryBarriers + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 8920 | } |
| 8921 | } |
| 8922 | if (local_pBufferMemoryBarriers) |
| 8923 | { |
| 8924 | for (uint32_t i = 0; i < (uint32_t)((bufferMemoryBarrierCount)); ++i) |
| 8925 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 8926 | transform_tohost_VkBufferMemoryBarrier(mImpl->resources(), (VkBufferMemoryBarrier*)(local_pBufferMemoryBarriers + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 8927 | } |
| 8928 | } |
| 8929 | if (local_pImageMemoryBarriers) |
| 8930 | { |
| 8931 | for (uint32_t i = 0; i < (uint32_t)((imageMemoryBarrierCount)); ++i) |
| 8932 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 8933 | transform_tohost_VkImageMemoryBarrier(mImpl->resources(), (VkImageMemoryBarrier*)(local_pImageMemoryBarriers + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 8934 | } |
| 8935 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8936 | countingStream->rewind(); |
| 8937 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 8938 | uint64_t cgen_var_621; |
| 8939 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_621, 1); |
| 8940 | countingStream->write((uint64_t*)&cgen_var_621, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8941 | countingStream->write((uint32_t*)&local_eventCount, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 8942 | if (((eventCount))) |
| 8943 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 8944 | uint64_t* cgen_var_622; |
| 8945 | countingStream->alloc((void**)&cgen_var_622, ((eventCount)) * 8); |
| 8946 | countingStream->handleMapping()->mapHandles_VkEvent_u64(local_pEvents, cgen_var_622, ((eventCount))); |
| 8947 | countingStream->write((uint64_t*)cgen_var_622, ((eventCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 8948 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8949 | countingStream->write((VkPipelineStageFlags*)&local_srcStageMask, sizeof(VkPipelineStageFlags)); |
| 8950 | countingStream->write((VkPipelineStageFlags*)&local_dstStageMask, sizeof(VkPipelineStageFlags)); |
| 8951 | countingStream->write((uint32_t*)&local_memoryBarrierCount, sizeof(uint32_t)); |
| 8952 | for (uint32_t i = 0; i < (uint32_t)((memoryBarrierCount)); ++i) |
| 8953 | { |
| 8954 | marshal_VkMemoryBarrier(countingStream, (VkMemoryBarrier*)(local_pMemoryBarriers + i)); |
| 8955 | } |
| 8956 | countingStream->write((uint32_t*)&local_bufferMemoryBarrierCount, sizeof(uint32_t)); |
| 8957 | for (uint32_t i = 0; i < (uint32_t)((bufferMemoryBarrierCount)); ++i) |
| 8958 | { |
| 8959 | marshal_VkBufferMemoryBarrier(countingStream, (VkBufferMemoryBarrier*)(local_pBufferMemoryBarriers + i)); |
| 8960 | } |
| 8961 | countingStream->write((uint32_t*)&local_imageMemoryBarrierCount, sizeof(uint32_t)); |
| 8962 | for (uint32_t i = 0; i < (uint32_t)((imageMemoryBarrierCount)); ++i) |
| 8963 | { |
| 8964 | marshal_VkImageMemoryBarrier(countingStream, (VkImageMemoryBarrier*)(local_pImageMemoryBarriers + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8965 | } |
| 8966 | } |
| 8967 | uint32_t packetSize_vkCmdWaitEvents = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 8968 | countingStream->rewind(); |
| 8969 | uint32_t opcode_vkCmdWaitEvents = OP_vkCmdWaitEvents; |
| 8970 | stream->write(&opcode_vkCmdWaitEvents, sizeof(uint32_t)); |
| 8971 | stream->write(&packetSize_vkCmdWaitEvents, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 8972 | uint64_t cgen_var_623; |
| 8973 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_623, 1); |
| 8974 | stream->write((uint64_t*)&cgen_var_623, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8975 | stream->write((uint32_t*)&local_eventCount, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 8976 | if (((eventCount))) |
| 8977 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 8978 | uint64_t* cgen_var_624; |
| 8979 | stream->alloc((void**)&cgen_var_624, ((eventCount)) * 8); |
| 8980 | stream->handleMapping()->mapHandles_VkEvent_u64(local_pEvents, cgen_var_624, ((eventCount))); |
| 8981 | stream->write((uint64_t*)cgen_var_624, ((eventCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 8982 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8983 | stream->write((VkPipelineStageFlags*)&local_srcStageMask, sizeof(VkPipelineStageFlags)); |
| 8984 | stream->write((VkPipelineStageFlags*)&local_dstStageMask, sizeof(VkPipelineStageFlags)); |
| 8985 | stream->write((uint32_t*)&local_memoryBarrierCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8986 | for (uint32_t i = 0; i < (uint32_t)((memoryBarrierCount)); ++i) |
| 8987 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8988 | marshal_VkMemoryBarrier(stream, (VkMemoryBarrier*)(local_pMemoryBarriers + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8989 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8990 | stream->write((uint32_t*)&local_bufferMemoryBarrierCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8991 | for (uint32_t i = 0; i < (uint32_t)((bufferMemoryBarrierCount)); ++i) |
| 8992 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8993 | marshal_VkBufferMemoryBarrier(stream, (VkBufferMemoryBarrier*)(local_pBufferMemoryBarriers + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8994 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8995 | stream->write((uint32_t*)&local_imageMemoryBarrierCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8996 | for (uint32_t i = 0; i < (uint32_t)((imageMemoryBarrierCount)); ++i) |
| 8997 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 8998 | marshal_VkImageMemoryBarrier(stream, (VkImageMemoryBarrier*)(local_pImageMemoryBarriers + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 8999 | } |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 9000 | pool->freeAll(); |
| 9001 | countingStream->clearPool(); |
| 9002 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9003 | mImpl->log("finish vkCmdWaitEvents");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9004 | } |
| 9005 | |
| 9006 | void VkEncoder::vkCmdPipelineBarrier( |
| 9007 | VkCommandBuffer commandBuffer, |
| 9008 | VkPipelineStageFlags srcStageMask, |
| 9009 | VkPipelineStageFlags dstStageMask, |
| 9010 | VkDependencyFlags dependencyFlags, |
| 9011 | uint32_t memoryBarrierCount, |
| 9012 | const VkMemoryBarrier* pMemoryBarriers, |
| 9013 | uint32_t bufferMemoryBarrierCount, |
| 9014 | const VkBufferMemoryBarrier* pBufferMemoryBarriers, |
| 9015 | uint32_t imageMemoryBarrierCount, |
| 9016 | const VkImageMemoryBarrier* pImageMemoryBarriers) |
| 9017 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 9018 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9019 | mImpl->log("start vkCmdPipelineBarrier"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9020 | auto stream = mImpl->stream(); |
| 9021 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9022 | auto resources = mImpl->resources(); |
| 9023 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 9024 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9025 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9026 | VkPipelineStageFlags local_srcStageMask; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9027 | VkPipelineStageFlags local_dstStageMask; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9028 | VkDependencyFlags local_dependencyFlags; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9029 | uint32_t local_memoryBarrierCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9030 | VkMemoryBarrier* local_pMemoryBarriers; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 9031 | uint32_t local_bufferMemoryBarrierCount; |
| 9032 | VkBufferMemoryBarrier* local_pBufferMemoryBarriers; |
| 9033 | uint32_t local_imageMemoryBarrierCount; |
| 9034 | VkImageMemoryBarrier* local_pImageMemoryBarriers; |
| 9035 | local_commandBuffer = commandBuffer; |
| 9036 | local_srcStageMask = srcStageMask; |
| 9037 | local_dstStageMask = dstStageMask; |
| 9038 | local_dependencyFlags = dependencyFlags; |
| 9039 | local_memoryBarrierCount = memoryBarrierCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9040 | local_pMemoryBarriers = nullptr; |
| 9041 | if (pMemoryBarriers) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9042 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9043 | local_pMemoryBarriers = (VkMemoryBarrier*)pool->alloc(((memoryBarrierCount)) * sizeof(const VkMemoryBarrier)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9044 | for (uint32_t i = 0; i < (uint32_t)((memoryBarrierCount)); ++i) |
| 9045 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9046 | deepcopy_VkMemoryBarrier(pool, pMemoryBarriers + i, (VkMemoryBarrier*)(local_pMemoryBarriers + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9047 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9048 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9049 | local_bufferMemoryBarrierCount = bufferMemoryBarrierCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9050 | local_pBufferMemoryBarriers = nullptr; |
| 9051 | if (pBufferMemoryBarriers) |
| 9052 | { |
| 9053 | local_pBufferMemoryBarriers = (VkBufferMemoryBarrier*)pool->alloc(((bufferMemoryBarrierCount)) * sizeof(const VkBufferMemoryBarrier)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9054 | for (uint32_t i = 0; i < (uint32_t)((bufferMemoryBarrierCount)); ++i) |
| 9055 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9056 | deepcopy_VkBufferMemoryBarrier(pool, pBufferMemoryBarriers + i, (VkBufferMemoryBarrier*)(local_pBufferMemoryBarriers + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9057 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9058 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9059 | local_imageMemoryBarrierCount = imageMemoryBarrierCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9060 | local_pImageMemoryBarriers = nullptr; |
| 9061 | if (pImageMemoryBarriers) |
| 9062 | { |
| 9063 | local_pImageMemoryBarriers = (VkImageMemoryBarrier*)pool->alloc(((imageMemoryBarrierCount)) * sizeof(const VkImageMemoryBarrier)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9064 | for (uint32_t i = 0; i < (uint32_t)((imageMemoryBarrierCount)); ++i) |
| 9065 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9066 | deepcopy_VkImageMemoryBarrier(pool, pImageMemoryBarriers + i, (VkImageMemoryBarrier*)(local_pImageMemoryBarriers + i)); |
| 9067 | } |
| 9068 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 9069 | if (local_pMemoryBarriers) |
| 9070 | { |
| 9071 | for (uint32_t i = 0; i < (uint32_t)((memoryBarrierCount)); ++i) |
| 9072 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 9073 | transform_tohost_VkMemoryBarrier(mImpl->resources(), (VkMemoryBarrier*)(local_pMemoryBarriers + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 9074 | } |
| 9075 | } |
| 9076 | if (local_pBufferMemoryBarriers) |
| 9077 | { |
| 9078 | for (uint32_t i = 0; i < (uint32_t)((bufferMemoryBarrierCount)); ++i) |
| 9079 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 9080 | transform_tohost_VkBufferMemoryBarrier(mImpl->resources(), (VkBufferMemoryBarrier*)(local_pBufferMemoryBarriers + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 9081 | } |
| 9082 | } |
| 9083 | if (local_pImageMemoryBarriers) |
| 9084 | { |
| 9085 | for (uint32_t i = 0; i < (uint32_t)((imageMemoryBarrierCount)); ++i) |
| 9086 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 9087 | transform_tohost_VkImageMemoryBarrier(mImpl->resources(), (VkImageMemoryBarrier*)(local_pImageMemoryBarriers + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 9088 | } |
| 9089 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9090 | countingStream->rewind(); |
| 9091 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9092 | uint64_t cgen_var_625; |
| 9093 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_625, 1); |
| 9094 | countingStream->write((uint64_t*)&cgen_var_625, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9095 | countingStream->write((VkPipelineStageFlags*)&local_srcStageMask, sizeof(VkPipelineStageFlags)); |
| 9096 | countingStream->write((VkPipelineStageFlags*)&local_dstStageMask, sizeof(VkPipelineStageFlags)); |
| 9097 | countingStream->write((VkDependencyFlags*)&local_dependencyFlags, sizeof(VkDependencyFlags)); |
| 9098 | countingStream->write((uint32_t*)&local_memoryBarrierCount, sizeof(uint32_t)); |
| 9099 | for (uint32_t i = 0; i < (uint32_t)((memoryBarrierCount)); ++i) |
| 9100 | { |
| 9101 | marshal_VkMemoryBarrier(countingStream, (VkMemoryBarrier*)(local_pMemoryBarriers + i)); |
| 9102 | } |
| 9103 | countingStream->write((uint32_t*)&local_bufferMemoryBarrierCount, sizeof(uint32_t)); |
| 9104 | for (uint32_t i = 0; i < (uint32_t)((bufferMemoryBarrierCount)); ++i) |
| 9105 | { |
| 9106 | marshal_VkBufferMemoryBarrier(countingStream, (VkBufferMemoryBarrier*)(local_pBufferMemoryBarriers + i)); |
| 9107 | } |
| 9108 | countingStream->write((uint32_t*)&local_imageMemoryBarrierCount, sizeof(uint32_t)); |
| 9109 | for (uint32_t i = 0; i < (uint32_t)((imageMemoryBarrierCount)); ++i) |
| 9110 | { |
| 9111 | marshal_VkImageMemoryBarrier(countingStream, (VkImageMemoryBarrier*)(local_pImageMemoryBarriers + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9112 | } |
| 9113 | } |
| 9114 | uint32_t packetSize_vkCmdPipelineBarrier = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 9115 | countingStream->rewind(); |
| 9116 | uint32_t opcode_vkCmdPipelineBarrier = OP_vkCmdPipelineBarrier; |
| 9117 | stream->write(&opcode_vkCmdPipelineBarrier, sizeof(uint32_t)); |
| 9118 | stream->write(&packetSize_vkCmdPipelineBarrier, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9119 | uint64_t cgen_var_626; |
| 9120 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_626, 1); |
| 9121 | stream->write((uint64_t*)&cgen_var_626, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9122 | stream->write((VkPipelineStageFlags*)&local_srcStageMask, sizeof(VkPipelineStageFlags)); |
| 9123 | stream->write((VkPipelineStageFlags*)&local_dstStageMask, sizeof(VkPipelineStageFlags)); |
| 9124 | stream->write((VkDependencyFlags*)&local_dependencyFlags, sizeof(VkDependencyFlags)); |
| 9125 | stream->write((uint32_t*)&local_memoryBarrierCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9126 | for (uint32_t i = 0; i < (uint32_t)((memoryBarrierCount)); ++i) |
| 9127 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9128 | marshal_VkMemoryBarrier(stream, (VkMemoryBarrier*)(local_pMemoryBarriers + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9129 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9130 | stream->write((uint32_t*)&local_bufferMemoryBarrierCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9131 | for (uint32_t i = 0; i < (uint32_t)((bufferMemoryBarrierCount)); ++i) |
| 9132 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9133 | marshal_VkBufferMemoryBarrier(stream, (VkBufferMemoryBarrier*)(local_pBufferMemoryBarriers + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9134 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9135 | stream->write((uint32_t*)&local_imageMemoryBarrierCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9136 | for (uint32_t i = 0; i < (uint32_t)((imageMemoryBarrierCount)); ++i) |
| 9137 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9138 | marshal_VkImageMemoryBarrier(stream, (VkImageMemoryBarrier*)(local_pImageMemoryBarriers + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9139 | } |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 9140 | pool->freeAll(); |
| 9141 | countingStream->clearPool(); |
| 9142 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9143 | mImpl->log("finish vkCmdPipelineBarrier");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9144 | } |
| 9145 | |
| 9146 | void VkEncoder::vkCmdBeginQuery( |
| 9147 | VkCommandBuffer commandBuffer, |
| 9148 | VkQueryPool queryPool, |
| 9149 | uint32_t query, |
| 9150 | VkQueryControlFlags flags) |
| 9151 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 9152 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9153 | mImpl->log("start vkCmdBeginQuery"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9154 | auto stream = mImpl->stream(); |
| 9155 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9156 | auto resources = mImpl->resources(); |
| 9157 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 9158 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9159 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9160 | VkQueryPool local_queryPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9161 | uint32_t local_query; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9162 | VkQueryControlFlags local_flags; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 9163 | local_commandBuffer = commandBuffer; |
| 9164 | local_queryPool = queryPool; |
| 9165 | local_query = query; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9166 | local_flags = flags; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9167 | countingStream->rewind(); |
| 9168 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9169 | uint64_t cgen_var_627; |
| 9170 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_627, 1); |
| 9171 | countingStream->write((uint64_t*)&cgen_var_627, 1 * 8); |
| 9172 | uint64_t cgen_var_628; |
| 9173 | countingStream->handleMapping()->mapHandles_VkQueryPool_u64(&local_queryPool, &cgen_var_628, 1); |
| 9174 | countingStream->write((uint64_t*)&cgen_var_628, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9175 | countingStream->write((uint32_t*)&local_query, sizeof(uint32_t)); |
| 9176 | countingStream->write((VkQueryControlFlags*)&local_flags, sizeof(VkQueryControlFlags)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9177 | } |
| 9178 | uint32_t packetSize_vkCmdBeginQuery = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 9179 | countingStream->rewind(); |
| 9180 | uint32_t opcode_vkCmdBeginQuery = OP_vkCmdBeginQuery; |
| 9181 | stream->write(&opcode_vkCmdBeginQuery, sizeof(uint32_t)); |
| 9182 | stream->write(&packetSize_vkCmdBeginQuery, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9183 | uint64_t cgen_var_629; |
| 9184 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_629, 1); |
| 9185 | stream->write((uint64_t*)&cgen_var_629, 1 * 8); |
| 9186 | uint64_t cgen_var_630; |
| 9187 | stream->handleMapping()->mapHandles_VkQueryPool_u64(&local_queryPool, &cgen_var_630, 1); |
| 9188 | stream->write((uint64_t*)&cgen_var_630, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9189 | stream->write((uint32_t*)&local_query, sizeof(uint32_t)); |
| 9190 | stream->write((VkQueryControlFlags*)&local_flags, sizeof(VkQueryControlFlags)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 9191 | pool->freeAll(); |
| 9192 | countingStream->clearPool(); |
| 9193 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9194 | mImpl->log("finish vkCmdBeginQuery");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9195 | } |
| 9196 | |
| 9197 | void VkEncoder::vkCmdEndQuery( |
| 9198 | VkCommandBuffer commandBuffer, |
| 9199 | VkQueryPool queryPool, |
| 9200 | uint32_t query) |
| 9201 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 9202 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9203 | mImpl->log("start vkCmdEndQuery"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9204 | auto stream = mImpl->stream(); |
| 9205 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9206 | auto resources = mImpl->resources(); |
| 9207 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 9208 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9209 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9210 | VkQueryPool local_queryPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9211 | uint32_t local_query; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 9212 | local_commandBuffer = commandBuffer; |
| 9213 | local_queryPool = queryPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9214 | local_query = query; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9215 | countingStream->rewind(); |
| 9216 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9217 | uint64_t cgen_var_631; |
| 9218 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_631, 1); |
| 9219 | countingStream->write((uint64_t*)&cgen_var_631, 1 * 8); |
| 9220 | uint64_t cgen_var_632; |
| 9221 | countingStream->handleMapping()->mapHandles_VkQueryPool_u64(&local_queryPool, &cgen_var_632, 1); |
| 9222 | countingStream->write((uint64_t*)&cgen_var_632, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9223 | countingStream->write((uint32_t*)&local_query, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9224 | } |
| 9225 | uint32_t packetSize_vkCmdEndQuery = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 9226 | countingStream->rewind(); |
| 9227 | uint32_t opcode_vkCmdEndQuery = OP_vkCmdEndQuery; |
| 9228 | stream->write(&opcode_vkCmdEndQuery, sizeof(uint32_t)); |
| 9229 | stream->write(&packetSize_vkCmdEndQuery, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9230 | uint64_t cgen_var_633; |
| 9231 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_633, 1); |
| 9232 | stream->write((uint64_t*)&cgen_var_633, 1 * 8); |
| 9233 | uint64_t cgen_var_634; |
| 9234 | stream->handleMapping()->mapHandles_VkQueryPool_u64(&local_queryPool, &cgen_var_634, 1); |
| 9235 | stream->write((uint64_t*)&cgen_var_634, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9236 | stream->write((uint32_t*)&local_query, sizeof(uint32_t)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 9237 | pool->freeAll(); |
| 9238 | countingStream->clearPool(); |
| 9239 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9240 | mImpl->log("finish vkCmdEndQuery");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9241 | } |
| 9242 | |
| 9243 | void VkEncoder::vkCmdResetQueryPool( |
| 9244 | VkCommandBuffer commandBuffer, |
| 9245 | VkQueryPool queryPool, |
| 9246 | uint32_t firstQuery, |
| 9247 | uint32_t queryCount) |
| 9248 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 9249 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9250 | mImpl->log("start vkCmdResetQueryPool"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9251 | auto stream = mImpl->stream(); |
| 9252 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9253 | auto resources = mImpl->resources(); |
| 9254 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 9255 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9256 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9257 | VkQueryPool local_queryPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9258 | uint32_t local_firstQuery; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9259 | uint32_t local_queryCount; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 9260 | local_commandBuffer = commandBuffer; |
| 9261 | local_queryPool = queryPool; |
| 9262 | local_firstQuery = firstQuery; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9263 | local_queryCount = queryCount; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9264 | countingStream->rewind(); |
| 9265 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9266 | uint64_t cgen_var_635; |
| 9267 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_635, 1); |
| 9268 | countingStream->write((uint64_t*)&cgen_var_635, 1 * 8); |
| 9269 | uint64_t cgen_var_636; |
| 9270 | countingStream->handleMapping()->mapHandles_VkQueryPool_u64(&local_queryPool, &cgen_var_636, 1); |
| 9271 | countingStream->write((uint64_t*)&cgen_var_636, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9272 | countingStream->write((uint32_t*)&local_firstQuery, sizeof(uint32_t)); |
| 9273 | countingStream->write((uint32_t*)&local_queryCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9274 | } |
| 9275 | uint32_t packetSize_vkCmdResetQueryPool = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 9276 | countingStream->rewind(); |
| 9277 | uint32_t opcode_vkCmdResetQueryPool = OP_vkCmdResetQueryPool; |
| 9278 | stream->write(&opcode_vkCmdResetQueryPool, sizeof(uint32_t)); |
| 9279 | stream->write(&packetSize_vkCmdResetQueryPool, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9280 | uint64_t cgen_var_637; |
| 9281 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_637, 1); |
| 9282 | stream->write((uint64_t*)&cgen_var_637, 1 * 8); |
| 9283 | uint64_t cgen_var_638; |
| 9284 | stream->handleMapping()->mapHandles_VkQueryPool_u64(&local_queryPool, &cgen_var_638, 1); |
| 9285 | stream->write((uint64_t*)&cgen_var_638, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9286 | stream->write((uint32_t*)&local_firstQuery, sizeof(uint32_t)); |
| 9287 | stream->write((uint32_t*)&local_queryCount, sizeof(uint32_t)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 9288 | pool->freeAll(); |
| 9289 | countingStream->clearPool(); |
| 9290 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9291 | mImpl->log("finish vkCmdResetQueryPool");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9292 | } |
| 9293 | |
| 9294 | void VkEncoder::vkCmdWriteTimestamp( |
| 9295 | VkCommandBuffer commandBuffer, |
| 9296 | VkPipelineStageFlagBits pipelineStage, |
| 9297 | VkQueryPool queryPool, |
| 9298 | uint32_t query) |
| 9299 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 9300 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9301 | mImpl->log("start vkCmdWriteTimestamp"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9302 | auto stream = mImpl->stream(); |
| 9303 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9304 | auto resources = mImpl->resources(); |
| 9305 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 9306 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9307 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9308 | VkPipelineStageFlagBits local_pipelineStage; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9309 | VkQueryPool local_queryPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9310 | uint32_t local_query; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 9311 | local_commandBuffer = commandBuffer; |
| 9312 | local_pipelineStage = pipelineStage; |
| 9313 | local_queryPool = queryPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9314 | local_query = query; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9315 | countingStream->rewind(); |
| 9316 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9317 | uint64_t cgen_var_639; |
| 9318 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_639, 1); |
| 9319 | countingStream->write((uint64_t*)&cgen_var_639, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9320 | countingStream->write((VkPipelineStageFlagBits*)&local_pipelineStage, sizeof(VkPipelineStageFlagBits)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9321 | uint64_t cgen_var_640; |
| 9322 | countingStream->handleMapping()->mapHandles_VkQueryPool_u64(&local_queryPool, &cgen_var_640, 1); |
| 9323 | countingStream->write((uint64_t*)&cgen_var_640, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9324 | countingStream->write((uint32_t*)&local_query, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9325 | } |
| 9326 | uint32_t packetSize_vkCmdWriteTimestamp = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 9327 | countingStream->rewind(); |
| 9328 | uint32_t opcode_vkCmdWriteTimestamp = OP_vkCmdWriteTimestamp; |
| 9329 | stream->write(&opcode_vkCmdWriteTimestamp, sizeof(uint32_t)); |
| 9330 | stream->write(&packetSize_vkCmdWriteTimestamp, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9331 | uint64_t cgen_var_641; |
| 9332 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_641, 1); |
| 9333 | stream->write((uint64_t*)&cgen_var_641, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9334 | stream->write((VkPipelineStageFlagBits*)&local_pipelineStage, sizeof(VkPipelineStageFlagBits)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9335 | uint64_t cgen_var_642; |
| 9336 | stream->handleMapping()->mapHandles_VkQueryPool_u64(&local_queryPool, &cgen_var_642, 1); |
| 9337 | stream->write((uint64_t*)&cgen_var_642, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9338 | stream->write((uint32_t*)&local_query, sizeof(uint32_t)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 9339 | pool->freeAll(); |
| 9340 | countingStream->clearPool(); |
| 9341 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9342 | mImpl->log("finish vkCmdWriteTimestamp");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9343 | } |
| 9344 | |
| 9345 | void VkEncoder::vkCmdCopyQueryPoolResults( |
| 9346 | VkCommandBuffer commandBuffer, |
| 9347 | VkQueryPool queryPool, |
| 9348 | uint32_t firstQuery, |
| 9349 | uint32_t queryCount, |
| 9350 | VkBuffer dstBuffer, |
| 9351 | VkDeviceSize dstOffset, |
| 9352 | VkDeviceSize stride, |
| 9353 | VkQueryResultFlags flags) |
| 9354 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 9355 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9356 | mImpl->log("start vkCmdCopyQueryPoolResults"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9357 | auto stream = mImpl->stream(); |
| 9358 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9359 | auto resources = mImpl->resources(); |
| 9360 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 9361 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9362 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9363 | VkQueryPool local_queryPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9364 | uint32_t local_firstQuery; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9365 | uint32_t local_queryCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9366 | VkBuffer local_dstBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9367 | VkDeviceSize local_dstOffset; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9368 | VkDeviceSize local_stride; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9369 | VkQueryResultFlags local_flags; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 9370 | local_commandBuffer = commandBuffer; |
| 9371 | local_queryPool = queryPool; |
| 9372 | local_firstQuery = firstQuery; |
| 9373 | local_queryCount = queryCount; |
| 9374 | local_dstBuffer = dstBuffer; |
| 9375 | local_dstOffset = dstOffset; |
| 9376 | local_stride = stride; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9377 | local_flags = flags; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9378 | countingStream->rewind(); |
| 9379 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9380 | uint64_t cgen_var_643; |
| 9381 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_643, 1); |
| 9382 | countingStream->write((uint64_t*)&cgen_var_643, 1 * 8); |
| 9383 | uint64_t cgen_var_644; |
| 9384 | countingStream->handleMapping()->mapHandles_VkQueryPool_u64(&local_queryPool, &cgen_var_644, 1); |
| 9385 | countingStream->write((uint64_t*)&cgen_var_644, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9386 | countingStream->write((uint32_t*)&local_firstQuery, sizeof(uint32_t)); |
| 9387 | countingStream->write((uint32_t*)&local_queryCount, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9388 | uint64_t cgen_var_645; |
| 9389 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_dstBuffer, &cgen_var_645, 1); |
| 9390 | countingStream->write((uint64_t*)&cgen_var_645, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9391 | countingStream->write((VkDeviceSize*)&local_dstOffset, sizeof(VkDeviceSize)); |
| 9392 | countingStream->write((VkDeviceSize*)&local_stride, sizeof(VkDeviceSize)); |
| 9393 | countingStream->write((VkQueryResultFlags*)&local_flags, sizeof(VkQueryResultFlags)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9394 | } |
| 9395 | uint32_t packetSize_vkCmdCopyQueryPoolResults = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 9396 | countingStream->rewind(); |
| 9397 | uint32_t opcode_vkCmdCopyQueryPoolResults = OP_vkCmdCopyQueryPoolResults; |
| 9398 | stream->write(&opcode_vkCmdCopyQueryPoolResults, sizeof(uint32_t)); |
| 9399 | stream->write(&packetSize_vkCmdCopyQueryPoolResults, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9400 | uint64_t cgen_var_646; |
| 9401 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_646, 1); |
| 9402 | stream->write((uint64_t*)&cgen_var_646, 1 * 8); |
| 9403 | uint64_t cgen_var_647; |
| 9404 | stream->handleMapping()->mapHandles_VkQueryPool_u64(&local_queryPool, &cgen_var_647, 1); |
| 9405 | stream->write((uint64_t*)&cgen_var_647, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9406 | stream->write((uint32_t*)&local_firstQuery, sizeof(uint32_t)); |
| 9407 | stream->write((uint32_t*)&local_queryCount, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9408 | uint64_t cgen_var_648; |
| 9409 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_dstBuffer, &cgen_var_648, 1); |
| 9410 | stream->write((uint64_t*)&cgen_var_648, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9411 | stream->write((VkDeviceSize*)&local_dstOffset, sizeof(VkDeviceSize)); |
| 9412 | stream->write((VkDeviceSize*)&local_stride, sizeof(VkDeviceSize)); |
| 9413 | stream->write((VkQueryResultFlags*)&local_flags, sizeof(VkQueryResultFlags)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 9414 | pool->freeAll(); |
| 9415 | countingStream->clearPool(); |
| 9416 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9417 | mImpl->log("finish vkCmdCopyQueryPoolResults");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9418 | } |
| 9419 | |
| 9420 | void VkEncoder::vkCmdPushConstants( |
| 9421 | VkCommandBuffer commandBuffer, |
| 9422 | VkPipelineLayout layout, |
| 9423 | VkShaderStageFlags stageFlags, |
| 9424 | uint32_t offset, |
| 9425 | uint32_t size, |
| 9426 | const void* pValues) |
| 9427 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 9428 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9429 | mImpl->log("start vkCmdPushConstants"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9430 | auto stream = mImpl->stream(); |
| 9431 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9432 | auto resources = mImpl->resources(); |
| 9433 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 9434 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9435 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9436 | VkPipelineLayout local_layout; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9437 | VkShaderStageFlags local_stageFlags; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9438 | uint32_t local_offset; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9439 | uint32_t local_size; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9440 | void* local_pValues; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 9441 | local_commandBuffer = commandBuffer; |
| 9442 | local_layout = layout; |
| 9443 | local_stageFlags = stageFlags; |
| 9444 | local_offset = offset; |
| 9445 | local_size = size; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9446 | local_pValues = nullptr; |
| 9447 | if (pValues) |
| 9448 | { |
| 9449 | local_pValues = (void*)pool->dupArray(pValues, ((size)) * sizeof(const uint8_t)); |
| 9450 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9451 | countingStream->rewind(); |
| 9452 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9453 | uint64_t cgen_var_649; |
| 9454 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_649, 1); |
| 9455 | countingStream->write((uint64_t*)&cgen_var_649, 1 * 8); |
| 9456 | uint64_t cgen_var_650; |
| 9457 | countingStream->handleMapping()->mapHandles_VkPipelineLayout_u64(&local_layout, &cgen_var_650, 1); |
| 9458 | countingStream->write((uint64_t*)&cgen_var_650, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9459 | countingStream->write((VkShaderStageFlags*)&local_stageFlags, sizeof(VkShaderStageFlags)); |
| 9460 | countingStream->write((uint32_t*)&local_offset, sizeof(uint32_t)); |
| 9461 | countingStream->write((uint32_t*)&local_size, sizeof(uint32_t)); |
| 9462 | countingStream->write((void*)local_pValues, ((size)) * sizeof(uint8_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9463 | } |
| 9464 | uint32_t packetSize_vkCmdPushConstants = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 9465 | countingStream->rewind(); |
| 9466 | uint32_t opcode_vkCmdPushConstants = OP_vkCmdPushConstants; |
| 9467 | stream->write(&opcode_vkCmdPushConstants, sizeof(uint32_t)); |
| 9468 | stream->write(&packetSize_vkCmdPushConstants, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9469 | uint64_t cgen_var_651; |
| 9470 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_651, 1); |
| 9471 | stream->write((uint64_t*)&cgen_var_651, 1 * 8); |
| 9472 | uint64_t cgen_var_652; |
| 9473 | stream->handleMapping()->mapHandles_VkPipelineLayout_u64(&local_layout, &cgen_var_652, 1); |
| 9474 | stream->write((uint64_t*)&cgen_var_652, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9475 | stream->write((VkShaderStageFlags*)&local_stageFlags, sizeof(VkShaderStageFlags)); |
| 9476 | stream->write((uint32_t*)&local_offset, sizeof(uint32_t)); |
| 9477 | stream->write((uint32_t*)&local_size, sizeof(uint32_t)); |
| 9478 | stream->write((void*)local_pValues, ((size)) * sizeof(uint8_t)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 9479 | pool->freeAll(); |
| 9480 | countingStream->clearPool(); |
| 9481 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9482 | mImpl->log("finish vkCmdPushConstants");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9483 | } |
| 9484 | |
| 9485 | void VkEncoder::vkCmdBeginRenderPass( |
| 9486 | VkCommandBuffer commandBuffer, |
| 9487 | const VkRenderPassBeginInfo* pRenderPassBegin, |
| 9488 | VkSubpassContents contents) |
| 9489 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 9490 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9491 | mImpl->log("start vkCmdBeginRenderPass"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9492 | auto stream = mImpl->stream(); |
| 9493 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9494 | auto resources = mImpl->resources(); |
| 9495 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 9496 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9497 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9498 | VkRenderPassBeginInfo* local_pRenderPassBegin; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 9499 | VkSubpassContents local_contents; |
| 9500 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9501 | local_pRenderPassBegin = nullptr; |
| 9502 | if (pRenderPassBegin) |
| 9503 | { |
| 9504 | local_pRenderPassBegin = (VkRenderPassBeginInfo*)pool->alloc(sizeof(const VkRenderPassBeginInfo)); |
| 9505 | deepcopy_VkRenderPassBeginInfo(pool, pRenderPassBegin, (VkRenderPassBeginInfo*)(local_pRenderPassBegin)); |
| 9506 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9507 | local_contents = contents; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 9508 | if (local_pRenderPassBegin) |
| 9509 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 9510 | transform_tohost_VkRenderPassBeginInfo(mImpl->resources(), (VkRenderPassBeginInfo*)(local_pRenderPassBegin)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 9511 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9512 | countingStream->rewind(); |
| 9513 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9514 | uint64_t cgen_var_653; |
| 9515 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_653, 1); |
| 9516 | countingStream->write((uint64_t*)&cgen_var_653, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9517 | marshal_VkRenderPassBeginInfo(countingStream, (VkRenderPassBeginInfo*)(local_pRenderPassBegin)); |
| 9518 | countingStream->write((VkSubpassContents*)&local_contents, sizeof(VkSubpassContents)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9519 | } |
| 9520 | uint32_t packetSize_vkCmdBeginRenderPass = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 9521 | countingStream->rewind(); |
| 9522 | uint32_t opcode_vkCmdBeginRenderPass = OP_vkCmdBeginRenderPass; |
| 9523 | stream->write(&opcode_vkCmdBeginRenderPass, sizeof(uint32_t)); |
| 9524 | stream->write(&packetSize_vkCmdBeginRenderPass, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9525 | uint64_t cgen_var_654; |
| 9526 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_654, 1); |
| 9527 | stream->write((uint64_t*)&cgen_var_654, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9528 | marshal_VkRenderPassBeginInfo(stream, (VkRenderPassBeginInfo*)(local_pRenderPassBegin)); |
| 9529 | stream->write((VkSubpassContents*)&local_contents, sizeof(VkSubpassContents)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 9530 | pool->freeAll(); |
| 9531 | countingStream->clearPool(); |
| 9532 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9533 | mImpl->log("finish vkCmdBeginRenderPass");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9534 | } |
| 9535 | |
| 9536 | void VkEncoder::vkCmdNextSubpass( |
| 9537 | VkCommandBuffer commandBuffer, |
| 9538 | VkSubpassContents contents) |
| 9539 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 9540 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9541 | mImpl->log("start vkCmdNextSubpass"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9542 | auto stream = mImpl->stream(); |
| 9543 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9544 | auto resources = mImpl->resources(); |
| 9545 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 9546 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9547 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9548 | VkSubpassContents local_contents; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 9549 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9550 | local_contents = contents; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9551 | countingStream->rewind(); |
| 9552 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9553 | uint64_t cgen_var_655; |
| 9554 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_655, 1); |
| 9555 | countingStream->write((uint64_t*)&cgen_var_655, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9556 | countingStream->write((VkSubpassContents*)&local_contents, sizeof(VkSubpassContents)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9557 | } |
| 9558 | uint32_t packetSize_vkCmdNextSubpass = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 9559 | countingStream->rewind(); |
| 9560 | uint32_t opcode_vkCmdNextSubpass = OP_vkCmdNextSubpass; |
| 9561 | stream->write(&opcode_vkCmdNextSubpass, sizeof(uint32_t)); |
| 9562 | stream->write(&packetSize_vkCmdNextSubpass, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9563 | uint64_t cgen_var_656; |
| 9564 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_656, 1); |
| 9565 | stream->write((uint64_t*)&cgen_var_656, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9566 | stream->write((VkSubpassContents*)&local_contents, sizeof(VkSubpassContents)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 9567 | pool->freeAll(); |
| 9568 | countingStream->clearPool(); |
| 9569 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9570 | mImpl->log("finish vkCmdNextSubpass");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9571 | } |
| 9572 | |
| 9573 | void VkEncoder::vkCmdEndRenderPass( |
| 9574 | VkCommandBuffer commandBuffer) |
| 9575 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 9576 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9577 | mImpl->log("start vkCmdEndRenderPass"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9578 | auto stream = mImpl->stream(); |
| 9579 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9580 | auto resources = mImpl->resources(); |
| 9581 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 9582 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9583 | VkCommandBuffer local_commandBuffer; |
| 9584 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9585 | countingStream->rewind(); |
| 9586 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9587 | uint64_t cgen_var_657; |
| 9588 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_657, 1); |
| 9589 | countingStream->write((uint64_t*)&cgen_var_657, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9590 | } |
| 9591 | uint32_t packetSize_vkCmdEndRenderPass = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 9592 | countingStream->rewind(); |
| 9593 | uint32_t opcode_vkCmdEndRenderPass = OP_vkCmdEndRenderPass; |
| 9594 | stream->write(&opcode_vkCmdEndRenderPass, sizeof(uint32_t)); |
| 9595 | stream->write(&packetSize_vkCmdEndRenderPass, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9596 | uint64_t cgen_var_658; |
| 9597 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_658, 1); |
| 9598 | stream->write((uint64_t*)&cgen_var_658, 1 * 8); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 9599 | pool->freeAll(); |
| 9600 | countingStream->clearPool(); |
| 9601 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9602 | mImpl->log("finish vkCmdEndRenderPass");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9603 | } |
| 9604 | |
| 9605 | void VkEncoder::vkCmdExecuteCommands( |
| 9606 | VkCommandBuffer commandBuffer, |
| 9607 | uint32_t commandBufferCount, |
| 9608 | const VkCommandBuffer* pCommandBuffers) |
| 9609 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 9610 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9611 | mImpl->log("start vkCmdExecuteCommands"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9612 | auto stream = mImpl->stream(); |
| 9613 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9614 | auto resources = mImpl->resources(); |
| 9615 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 9616 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9617 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9618 | uint32_t local_commandBufferCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9619 | VkCommandBuffer* local_pCommandBuffers; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 9620 | local_commandBuffer = commandBuffer; |
| 9621 | local_commandBufferCount = commandBufferCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9622 | local_pCommandBuffers = nullptr; |
| 9623 | if (pCommandBuffers) |
| 9624 | { |
| 9625 | local_pCommandBuffers = (VkCommandBuffer*)pool->dupArray(pCommandBuffers, ((commandBufferCount)) * sizeof(const VkCommandBuffer)); |
| 9626 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9627 | countingStream->rewind(); |
| 9628 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9629 | uint64_t cgen_var_659; |
| 9630 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_659, 1); |
| 9631 | countingStream->write((uint64_t*)&cgen_var_659, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9632 | countingStream->write((uint32_t*)&local_commandBufferCount, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9633 | if (((commandBufferCount))) |
| 9634 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9635 | uint64_t* cgen_var_660; |
| 9636 | countingStream->alloc((void**)&cgen_var_660, ((commandBufferCount)) * 8); |
| 9637 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(local_pCommandBuffers, cgen_var_660, ((commandBufferCount))); |
| 9638 | countingStream->write((uint64_t*)cgen_var_660, ((commandBufferCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9639 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9640 | } |
| 9641 | uint32_t packetSize_vkCmdExecuteCommands = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 9642 | countingStream->rewind(); |
| 9643 | uint32_t opcode_vkCmdExecuteCommands = OP_vkCmdExecuteCommands; |
| 9644 | stream->write(&opcode_vkCmdExecuteCommands, sizeof(uint32_t)); |
| 9645 | stream->write(&packetSize_vkCmdExecuteCommands, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9646 | uint64_t cgen_var_661; |
| 9647 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_661, 1); |
| 9648 | stream->write((uint64_t*)&cgen_var_661, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9649 | stream->write((uint32_t*)&local_commandBufferCount, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9650 | if (((commandBufferCount))) |
| 9651 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9652 | uint64_t* cgen_var_662; |
| 9653 | stream->alloc((void**)&cgen_var_662, ((commandBufferCount)) * 8); |
| 9654 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(local_pCommandBuffers, cgen_var_662, ((commandBufferCount))); |
| 9655 | stream->write((uint64_t*)cgen_var_662, ((commandBufferCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9656 | } |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 9657 | pool->freeAll(); |
| 9658 | countingStream->clearPool(); |
| 9659 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9660 | mImpl->log("finish vkCmdExecuteCommands");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9661 | } |
| 9662 | |
| 9663 | #endif |
| 9664 | #ifdef VK_VERSION_1_1 |
| 9665 | VkResult VkEncoder::vkEnumerateInstanceVersion( |
| 9666 | uint32_t* pApiVersion) |
| 9667 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 9668 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | e739199 | 2019-03-15 09:42:13 -0700 | [diff] [blame] | 9669 | mImpl->log("start vkEnumerateInstanceVersion"); |
| 9670 | auto stream = mImpl->stream(); |
| 9671 | auto countingStream = mImpl->countingStream(); |
| 9672 | auto resources = mImpl->resources(); |
| 9673 | auto pool = mImpl->pool(); |
| 9674 | stream->setHandleMapping(resources->unwrapMapping()); |
| 9675 | countingStream->rewind(); |
| 9676 | { |
| 9677 | countingStream->write((uint32_t*)pApiVersion, sizeof(uint32_t)); |
| 9678 | } |
| 9679 | uint32_t packetSize_vkEnumerateInstanceVersion = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 9680 | countingStream->rewind(); |
| 9681 | uint32_t opcode_vkEnumerateInstanceVersion = OP_vkEnumerateInstanceVersion; |
| 9682 | stream->write(&opcode_vkEnumerateInstanceVersion, sizeof(uint32_t)); |
| 9683 | stream->write(&packetSize_vkEnumerateInstanceVersion, sizeof(uint32_t)); |
| 9684 | stream->write((uint32_t*)pApiVersion, sizeof(uint32_t)); |
| Lingfeng Yang | e739199 | 2019-03-15 09:42:13 -0700 | [diff] [blame] | 9685 | stream->read((uint32_t*)pApiVersion, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9686 | VkResult vkEnumerateInstanceVersion_VkResult_return = (VkResult)0; |
| Lingfeng Yang | e739199 | 2019-03-15 09:42:13 -0700 | [diff] [blame] | 9687 | stream->read(&vkEnumerateInstanceVersion_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 9688 | pool->freeAll(); |
| Lingfeng Yang | e739199 | 2019-03-15 09:42:13 -0700 | [diff] [blame] | 9689 | countingStream->clearPool(); |
| 9690 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9691 | mImpl->log("finish vkEnumerateInstanceVersion");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9692 | return vkEnumerateInstanceVersion_VkResult_return; |
| 9693 | } |
| 9694 | |
| 9695 | VkResult VkEncoder::vkBindBufferMemory2( |
| 9696 | VkDevice device, |
| 9697 | uint32_t bindInfoCount, |
| 9698 | const VkBindBufferMemoryInfo* pBindInfos) |
| 9699 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 9700 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9701 | mImpl->log("start vkBindBufferMemory2"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9702 | auto stream = mImpl->stream(); |
| 9703 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9704 | auto resources = mImpl->resources(); |
| 9705 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 9706 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9707 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9708 | uint32_t local_bindInfoCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9709 | VkBindBufferMemoryInfo* local_pBindInfos; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 9710 | local_device = device; |
| 9711 | local_bindInfoCount = bindInfoCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9712 | local_pBindInfos = nullptr; |
| 9713 | if (pBindInfos) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9714 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9715 | local_pBindInfos = (VkBindBufferMemoryInfo*)pool->alloc(((bindInfoCount)) * sizeof(const VkBindBufferMemoryInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9716 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 9717 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9718 | deepcopy_VkBindBufferMemoryInfo(pool, pBindInfos + i, (VkBindBufferMemoryInfo*)(local_pBindInfos + i)); |
| 9719 | } |
| 9720 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 9721 | if (local_pBindInfos) |
| 9722 | { |
| 9723 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 9724 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 9725 | transform_tohost_VkBindBufferMemoryInfo(mImpl->resources(), (VkBindBufferMemoryInfo*)(local_pBindInfos + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 9726 | } |
| 9727 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9728 | countingStream->rewind(); |
| 9729 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9730 | uint64_t cgen_var_663; |
| 9731 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_663, 1); |
| 9732 | countingStream->write((uint64_t*)&cgen_var_663, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9733 | countingStream->write((uint32_t*)&local_bindInfoCount, sizeof(uint32_t)); |
| 9734 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 9735 | { |
| 9736 | marshal_VkBindBufferMemoryInfo(countingStream, (VkBindBufferMemoryInfo*)(local_pBindInfos + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9737 | } |
| 9738 | } |
| 9739 | uint32_t packetSize_vkBindBufferMemory2 = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 9740 | countingStream->rewind(); |
| 9741 | uint32_t opcode_vkBindBufferMemory2 = OP_vkBindBufferMemory2; |
| 9742 | stream->write(&opcode_vkBindBufferMemory2, sizeof(uint32_t)); |
| 9743 | stream->write(&packetSize_vkBindBufferMemory2, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9744 | uint64_t cgen_var_664; |
| 9745 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_664, 1); |
| 9746 | stream->write((uint64_t*)&cgen_var_664, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9747 | stream->write((uint32_t*)&local_bindInfoCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9748 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 9749 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9750 | marshal_VkBindBufferMemoryInfo(stream, (VkBindBufferMemoryInfo*)(local_pBindInfos + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9751 | } |
| 9752 | VkResult vkBindBufferMemory2_VkResult_return = (VkResult)0; |
| 9753 | stream->read(&vkBindBufferMemory2_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 9754 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9755 | countingStream->clearPool(); |
| 9756 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9757 | mImpl->log("finish vkBindBufferMemory2");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9758 | return vkBindBufferMemory2_VkResult_return; |
| 9759 | } |
| 9760 | |
| 9761 | VkResult VkEncoder::vkBindImageMemory2( |
| 9762 | VkDevice device, |
| 9763 | uint32_t bindInfoCount, |
| 9764 | const VkBindImageMemoryInfo* pBindInfos) |
| 9765 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 9766 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9767 | mImpl->log("start vkBindImageMemory2"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9768 | auto stream = mImpl->stream(); |
| 9769 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9770 | auto resources = mImpl->resources(); |
| 9771 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 9772 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9773 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9774 | uint32_t local_bindInfoCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9775 | VkBindImageMemoryInfo* local_pBindInfos; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 9776 | local_device = device; |
| 9777 | local_bindInfoCount = bindInfoCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9778 | local_pBindInfos = nullptr; |
| 9779 | if (pBindInfos) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9780 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9781 | local_pBindInfos = (VkBindImageMemoryInfo*)pool->alloc(((bindInfoCount)) * sizeof(const VkBindImageMemoryInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9782 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 9783 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9784 | deepcopy_VkBindImageMemoryInfo(pool, pBindInfos + i, (VkBindImageMemoryInfo*)(local_pBindInfos + i)); |
| 9785 | } |
| 9786 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 9787 | if (local_pBindInfos) |
| 9788 | { |
| 9789 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 9790 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 9791 | transform_tohost_VkBindImageMemoryInfo(mImpl->resources(), (VkBindImageMemoryInfo*)(local_pBindInfos + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 9792 | } |
| 9793 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9794 | countingStream->rewind(); |
| 9795 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9796 | uint64_t cgen_var_665; |
| 9797 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_665, 1); |
| 9798 | countingStream->write((uint64_t*)&cgen_var_665, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9799 | countingStream->write((uint32_t*)&local_bindInfoCount, sizeof(uint32_t)); |
| 9800 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 9801 | { |
| 9802 | marshal_VkBindImageMemoryInfo(countingStream, (VkBindImageMemoryInfo*)(local_pBindInfos + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9803 | } |
| 9804 | } |
| 9805 | uint32_t packetSize_vkBindImageMemory2 = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 9806 | countingStream->rewind(); |
| 9807 | uint32_t opcode_vkBindImageMemory2 = OP_vkBindImageMemory2; |
| 9808 | stream->write(&opcode_vkBindImageMemory2, sizeof(uint32_t)); |
| 9809 | stream->write(&packetSize_vkBindImageMemory2, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9810 | uint64_t cgen_var_666; |
| 9811 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_666, 1); |
| 9812 | stream->write((uint64_t*)&cgen_var_666, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9813 | stream->write((uint32_t*)&local_bindInfoCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9814 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 9815 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9816 | marshal_VkBindImageMemoryInfo(stream, (VkBindImageMemoryInfo*)(local_pBindInfos + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9817 | } |
| 9818 | VkResult vkBindImageMemory2_VkResult_return = (VkResult)0; |
| 9819 | stream->read(&vkBindImageMemory2_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 9820 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 9821 | countingStream->clearPool(); |
| 9822 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9823 | mImpl->log("finish vkBindImageMemory2");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9824 | return vkBindImageMemory2_VkResult_return; |
| 9825 | } |
| 9826 | |
| 9827 | void VkEncoder::vkGetDeviceGroupPeerMemoryFeatures( |
| 9828 | VkDevice device, |
| 9829 | uint32_t heapIndex, |
| 9830 | uint32_t localDeviceIndex, |
| 9831 | uint32_t remoteDeviceIndex, |
| 9832 | VkPeerMemoryFeatureFlags* pPeerMemoryFeatures) |
| 9833 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 9834 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9835 | mImpl->log("start vkGetDeviceGroupPeerMemoryFeatures"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9836 | auto stream = mImpl->stream(); |
| 9837 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9838 | auto resources = mImpl->resources(); |
| 9839 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 9840 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9841 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9842 | uint32_t local_heapIndex; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9843 | uint32_t local_localDeviceIndex; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9844 | uint32_t local_remoteDeviceIndex; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 9845 | local_device = device; |
| 9846 | local_heapIndex = heapIndex; |
| 9847 | local_localDeviceIndex = localDeviceIndex; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9848 | local_remoteDeviceIndex = remoteDeviceIndex; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9849 | countingStream->rewind(); |
| 9850 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9851 | uint64_t cgen_var_667; |
| 9852 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_667, 1); |
| 9853 | countingStream->write((uint64_t*)&cgen_var_667, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9854 | countingStream->write((uint32_t*)&local_heapIndex, sizeof(uint32_t)); |
| 9855 | countingStream->write((uint32_t*)&local_localDeviceIndex, sizeof(uint32_t)); |
| 9856 | countingStream->write((uint32_t*)&local_remoteDeviceIndex, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9857 | countingStream->write((VkPeerMemoryFeatureFlags*)pPeerMemoryFeatures, sizeof(VkPeerMemoryFeatureFlags)); |
| 9858 | } |
| 9859 | uint32_t packetSize_vkGetDeviceGroupPeerMemoryFeatures = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 9860 | countingStream->rewind(); |
| 9861 | uint32_t opcode_vkGetDeviceGroupPeerMemoryFeatures = OP_vkGetDeviceGroupPeerMemoryFeatures; |
| 9862 | stream->write(&opcode_vkGetDeviceGroupPeerMemoryFeatures, sizeof(uint32_t)); |
| 9863 | stream->write(&packetSize_vkGetDeviceGroupPeerMemoryFeatures, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9864 | uint64_t cgen_var_668; |
| 9865 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_668, 1); |
| 9866 | stream->write((uint64_t*)&cgen_var_668, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9867 | stream->write((uint32_t*)&local_heapIndex, sizeof(uint32_t)); |
| 9868 | stream->write((uint32_t*)&local_localDeviceIndex, sizeof(uint32_t)); |
| 9869 | stream->write((uint32_t*)&local_remoteDeviceIndex, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9870 | stream->write((VkPeerMemoryFeatureFlags*)pPeerMemoryFeatures, sizeof(VkPeerMemoryFeatureFlags)); |
| 9871 | stream->read((VkPeerMemoryFeatureFlags*)pPeerMemoryFeatures, sizeof(VkPeerMemoryFeatureFlags)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 9872 | pool->freeAll(); |
| 9873 | countingStream->clearPool(); |
| 9874 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9875 | mImpl->log("finish vkGetDeviceGroupPeerMemoryFeatures");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9876 | } |
| 9877 | |
| 9878 | void VkEncoder::vkCmdSetDeviceMask( |
| 9879 | VkCommandBuffer commandBuffer, |
| 9880 | uint32_t deviceMask) |
| 9881 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 9882 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9883 | mImpl->log("start vkCmdSetDeviceMask"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9884 | auto stream = mImpl->stream(); |
| 9885 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9886 | auto resources = mImpl->resources(); |
| 9887 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 9888 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9889 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9890 | uint32_t local_deviceMask; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 9891 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9892 | local_deviceMask = deviceMask; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9893 | countingStream->rewind(); |
| 9894 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9895 | uint64_t cgen_var_669; |
| 9896 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_669, 1); |
| 9897 | countingStream->write((uint64_t*)&cgen_var_669, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9898 | countingStream->write((uint32_t*)&local_deviceMask, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9899 | } |
| 9900 | uint32_t packetSize_vkCmdSetDeviceMask = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 9901 | countingStream->rewind(); |
| 9902 | uint32_t opcode_vkCmdSetDeviceMask = OP_vkCmdSetDeviceMask; |
| 9903 | stream->write(&opcode_vkCmdSetDeviceMask, sizeof(uint32_t)); |
| 9904 | stream->write(&packetSize_vkCmdSetDeviceMask, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9905 | uint64_t cgen_var_670; |
| 9906 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_670, 1); |
| 9907 | stream->write((uint64_t*)&cgen_var_670, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9908 | stream->write((uint32_t*)&local_deviceMask, sizeof(uint32_t)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 9909 | pool->freeAll(); |
| 9910 | countingStream->clearPool(); |
| 9911 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9912 | mImpl->log("finish vkCmdSetDeviceMask");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9913 | } |
| 9914 | |
| 9915 | void VkEncoder::vkCmdDispatchBase( |
| 9916 | VkCommandBuffer commandBuffer, |
| 9917 | uint32_t baseGroupX, |
| 9918 | uint32_t baseGroupY, |
| 9919 | uint32_t baseGroupZ, |
| 9920 | uint32_t groupCountX, |
| 9921 | uint32_t groupCountY, |
| 9922 | uint32_t groupCountZ) |
| 9923 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 9924 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9925 | mImpl->log("start vkCmdDispatchBase"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9926 | auto stream = mImpl->stream(); |
| 9927 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9928 | auto resources = mImpl->resources(); |
| 9929 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 9930 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9931 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9932 | uint32_t local_baseGroupX; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9933 | uint32_t local_baseGroupY; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9934 | uint32_t local_baseGroupZ; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9935 | uint32_t local_groupCountX; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9936 | uint32_t local_groupCountY; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9937 | uint32_t local_groupCountZ; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 9938 | local_commandBuffer = commandBuffer; |
| 9939 | local_baseGroupX = baseGroupX; |
| 9940 | local_baseGroupY = baseGroupY; |
| 9941 | local_baseGroupZ = baseGroupZ; |
| 9942 | local_groupCountX = groupCountX; |
| 9943 | local_groupCountY = groupCountY; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9944 | local_groupCountZ = groupCountZ; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9945 | countingStream->rewind(); |
| 9946 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9947 | uint64_t cgen_var_671; |
| 9948 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_671, 1); |
| 9949 | countingStream->write((uint64_t*)&cgen_var_671, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9950 | countingStream->write((uint32_t*)&local_baseGroupX, sizeof(uint32_t)); |
| 9951 | countingStream->write((uint32_t*)&local_baseGroupY, sizeof(uint32_t)); |
| 9952 | countingStream->write((uint32_t*)&local_baseGroupZ, sizeof(uint32_t)); |
| 9953 | countingStream->write((uint32_t*)&local_groupCountX, sizeof(uint32_t)); |
| 9954 | countingStream->write((uint32_t*)&local_groupCountY, sizeof(uint32_t)); |
| 9955 | countingStream->write((uint32_t*)&local_groupCountZ, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9956 | } |
| 9957 | uint32_t packetSize_vkCmdDispatchBase = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 9958 | countingStream->rewind(); |
| 9959 | uint32_t opcode_vkCmdDispatchBase = OP_vkCmdDispatchBase; |
| 9960 | stream->write(&opcode_vkCmdDispatchBase, sizeof(uint32_t)); |
| 9961 | stream->write(&packetSize_vkCmdDispatchBase, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9962 | uint64_t cgen_var_672; |
| 9963 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_672, 1); |
| 9964 | stream->write((uint64_t*)&cgen_var_672, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9965 | stream->write((uint32_t*)&local_baseGroupX, sizeof(uint32_t)); |
| 9966 | stream->write((uint32_t*)&local_baseGroupY, sizeof(uint32_t)); |
| 9967 | stream->write((uint32_t*)&local_baseGroupZ, sizeof(uint32_t)); |
| 9968 | stream->write((uint32_t*)&local_groupCountX, sizeof(uint32_t)); |
| 9969 | stream->write((uint32_t*)&local_groupCountY, sizeof(uint32_t)); |
| 9970 | stream->write((uint32_t*)&local_groupCountZ, sizeof(uint32_t)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 9971 | pool->freeAll(); |
| 9972 | countingStream->clearPool(); |
| 9973 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9974 | mImpl->log("finish vkCmdDispatchBase");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9975 | } |
| 9976 | |
| 9977 | VkResult VkEncoder::vkEnumeratePhysicalDeviceGroups( |
| 9978 | VkInstance instance, |
| 9979 | uint32_t* pPhysicalDeviceGroupCount, |
| 9980 | VkPhysicalDeviceGroupProperties* pPhysicalDeviceGroupProperties) |
| 9981 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 9982 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 9983 | mImpl->log("start vkEnumeratePhysicalDeviceGroups"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9984 | auto stream = mImpl->stream(); |
| 9985 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9986 | auto resources = mImpl->resources(); |
| 9987 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 9988 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 9989 | VkInstance local_instance; |
| 9990 | local_instance = instance; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9991 | countingStream->rewind(); |
| 9992 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9993 | uint64_t cgen_var_673; |
| 9994 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_673, 1); |
| 9995 | countingStream->write((uint64_t*)&cgen_var_673, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 9996 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 9997 | uint64_t cgen_var_674 = (uint64_t)(uintptr_t)pPhysicalDeviceGroupCount; |
| 9998 | countingStream->putBe64(cgen_var_674); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 9999 | if (pPhysicalDeviceGroupCount) |
| 10000 | { |
| 10001 | countingStream->write((uint32_t*)pPhysicalDeviceGroupCount, sizeof(uint32_t)); |
| 10002 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10003 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10004 | uint64_t cgen_var_675 = (uint64_t)(uintptr_t)pPhysicalDeviceGroupProperties; |
| 10005 | countingStream->putBe64(cgen_var_675); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10006 | if (pPhysicalDeviceGroupProperties) |
| 10007 | { |
| 10008 | for (uint32_t i = 0; i < (uint32_t)(*(pPhysicalDeviceGroupCount)); ++i) |
| 10009 | { |
| 10010 | marshal_VkPhysicalDeviceGroupProperties(countingStream, (VkPhysicalDeviceGroupProperties*)(pPhysicalDeviceGroupProperties + i)); |
| 10011 | } |
| 10012 | } |
| 10013 | } |
| 10014 | uint32_t packetSize_vkEnumeratePhysicalDeviceGroups = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 10015 | countingStream->rewind(); |
| 10016 | uint32_t opcode_vkEnumeratePhysicalDeviceGroups = OP_vkEnumeratePhysicalDeviceGroups; |
| 10017 | stream->write(&opcode_vkEnumeratePhysicalDeviceGroups, sizeof(uint32_t)); |
| 10018 | stream->write(&packetSize_vkEnumeratePhysicalDeviceGroups, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10019 | uint64_t cgen_var_676; |
| 10020 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_676, 1); |
| 10021 | stream->write((uint64_t*)&cgen_var_676, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10022 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10023 | uint64_t cgen_var_677 = (uint64_t)(uintptr_t)pPhysicalDeviceGroupCount; |
| 10024 | stream->putBe64(cgen_var_677); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10025 | if (pPhysicalDeviceGroupCount) |
| 10026 | { |
| 10027 | stream->write((uint32_t*)pPhysicalDeviceGroupCount, sizeof(uint32_t)); |
| 10028 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10029 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10030 | uint64_t cgen_var_678 = (uint64_t)(uintptr_t)pPhysicalDeviceGroupProperties; |
| 10031 | stream->putBe64(cgen_var_678); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10032 | if (pPhysicalDeviceGroupProperties) |
| 10033 | { |
| 10034 | for (uint32_t i = 0; i < (uint32_t)(*(pPhysicalDeviceGroupCount)); ++i) |
| 10035 | { |
| 10036 | marshal_VkPhysicalDeviceGroupProperties(stream, (VkPhysicalDeviceGroupProperties*)(pPhysicalDeviceGroupProperties + i)); |
| 10037 | } |
| 10038 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10039 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10040 | uint32_t* check_pPhysicalDeviceGroupCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10041 | check_pPhysicalDeviceGroupCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10042 | if (pPhysicalDeviceGroupCount) |
| 10043 | { |
| 10044 | if (!(check_pPhysicalDeviceGroupCount)) |
| 10045 | { |
| 10046 | fprintf(stderr, "fatal: pPhysicalDeviceGroupCount inconsistent between guest and host\n"); |
| 10047 | } |
| 10048 | stream->read((uint32_t*)pPhysicalDeviceGroupCount, sizeof(uint32_t)); |
| 10049 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10050 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10051 | VkPhysicalDeviceGroupProperties* check_pPhysicalDeviceGroupProperties; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10052 | check_pPhysicalDeviceGroupProperties = (VkPhysicalDeviceGroupProperties*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10053 | if (pPhysicalDeviceGroupProperties) |
| 10054 | { |
| 10055 | if (!(check_pPhysicalDeviceGroupProperties)) |
| 10056 | { |
| 10057 | fprintf(stderr, "fatal: pPhysicalDeviceGroupProperties inconsistent between guest and host\n"); |
| 10058 | } |
| 10059 | for (uint32_t i = 0; i < (uint32_t)(*(pPhysicalDeviceGroupCount)); ++i) |
| 10060 | { |
| 10061 | unmarshal_VkPhysicalDeviceGroupProperties(stream, (VkPhysicalDeviceGroupProperties*)(pPhysicalDeviceGroupProperties + i)); |
| 10062 | } |
| 10063 | } |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 10064 | if (pPhysicalDeviceGroupProperties) |
| 10065 | { |
| 10066 | for (uint32_t i = 0; i < (uint32_t)(*(pPhysicalDeviceGroupCount)); ++i) |
| 10067 | { |
| 10068 | transform_fromhost_VkPhysicalDeviceGroupProperties(mImpl->resources(), (VkPhysicalDeviceGroupProperties*)(pPhysicalDeviceGroupProperties + i)); |
| 10069 | } |
| 10070 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10071 | VkResult vkEnumeratePhysicalDeviceGroups_VkResult_return = (VkResult)0; |
| 10072 | stream->read(&vkEnumeratePhysicalDeviceGroups_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 10073 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10074 | countingStream->clearPool(); |
| 10075 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10076 | mImpl->log("finish vkEnumeratePhysicalDeviceGroups");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10077 | return vkEnumeratePhysicalDeviceGroups_VkResult_return; |
| 10078 | } |
| 10079 | |
| 10080 | void VkEncoder::vkGetImageMemoryRequirements2( |
| 10081 | VkDevice device, |
| 10082 | const VkImageMemoryRequirementsInfo2* pInfo, |
| 10083 | VkMemoryRequirements2* pMemoryRequirements) |
| 10084 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 10085 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10086 | mImpl->log("start vkGetImageMemoryRequirements2"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10087 | auto stream = mImpl->stream(); |
| 10088 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10089 | auto resources = mImpl->resources(); |
| 10090 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 10091 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10092 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10093 | VkImageMemoryRequirementsInfo2* local_pInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 10094 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10095 | local_pInfo = nullptr; |
| 10096 | if (pInfo) |
| 10097 | { |
| 10098 | local_pInfo = (VkImageMemoryRequirementsInfo2*)pool->alloc(sizeof(const VkImageMemoryRequirementsInfo2)); |
| 10099 | deepcopy_VkImageMemoryRequirementsInfo2(pool, pInfo, (VkImageMemoryRequirementsInfo2*)(local_pInfo)); |
| 10100 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 10101 | if (local_pInfo) |
| 10102 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 10103 | transform_tohost_VkImageMemoryRequirementsInfo2(mImpl->resources(), (VkImageMemoryRequirementsInfo2*)(local_pInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 10104 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10105 | countingStream->rewind(); |
| 10106 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10107 | uint64_t cgen_var_681; |
| 10108 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_681, 1); |
| 10109 | countingStream->write((uint64_t*)&cgen_var_681, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10110 | marshal_VkImageMemoryRequirementsInfo2(countingStream, (VkImageMemoryRequirementsInfo2*)(local_pInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10111 | marshal_VkMemoryRequirements2(countingStream, (VkMemoryRequirements2*)(pMemoryRequirements)); |
| 10112 | } |
| 10113 | uint32_t packetSize_vkGetImageMemoryRequirements2 = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 10114 | countingStream->rewind(); |
| 10115 | uint32_t opcode_vkGetImageMemoryRequirements2 = OP_vkGetImageMemoryRequirements2; |
| 10116 | stream->write(&opcode_vkGetImageMemoryRequirements2, sizeof(uint32_t)); |
| 10117 | stream->write(&packetSize_vkGetImageMemoryRequirements2, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10118 | uint64_t cgen_var_682; |
| 10119 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_682, 1); |
| 10120 | stream->write((uint64_t*)&cgen_var_682, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10121 | marshal_VkImageMemoryRequirementsInfo2(stream, (VkImageMemoryRequirementsInfo2*)(local_pInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10122 | marshal_VkMemoryRequirements2(stream, (VkMemoryRequirements2*)(pMemoryRequirements)); |
| 10123 | unmarshal_VkMemoryRequirements2(stream, (VkMemoryRequirements2*)(pMemoryRequirements)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 10124 | if (pMemoryRequirements) |
| 10125 | { |
| 10126 | transform_fromhost_VkMemoryRequirements2(mImpl->resources(), (VkMemoryRequirements2*)(pMemoryRequirements)); |
| 10127 | } |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 10128 | pool->freeAll(); |
| 10129 | countingStream->clearPool(); |
| 10130 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10131 | mImpl->log("finish vkGetImageMemoryRequirements2");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10132 | } |
| 10133 | |
| 10134 | void VkEncoder::vkGetBufferMemoryRequirements2( |
| 10135 | VkDevice device, |
| 10136 | const VkBufferMemoryRequirementsInfo2* pInfo, |
| 10137 | VkMemoryRequirements2* pMemoryRequirements) |
| 10138 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 10139 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10140 | mImpl->log("start vkGetBufferMemoryRequirements2"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10141 | auto stream = mImpl->stream(); |
| 10142 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10143 | auto resources = mImpl->resources(); |
| 10144 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 10145 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10146 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10147 | VkBufferMemoryRequirementsInfo2* local_pInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 10148 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10149 | local_pInfo = nullptr; |
| 10150 | if (pInfo) |
| 10151 | { |
| 10152 | local_pInfo = (VkBufferMemoryRequirementsInfo2*)pool->alloc(sizeof(const VkBufferMemoryRequirementsInfo2)); |
| 10153 | deepcopy_VkBufferMemoryRequirementsInfo2(pool, pInfo, (VkBufferMemoryRequirementsInfo2*)(local_pInfo)); |
| 10154 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 10155 | if (local_pInfo) |
| 10156 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 10157 | transform_tohost_VkBufferMemoryRequirementsInfo2(mImpl->resources(), (VkBufferMemoryRequirementsInfo2*)(local_pInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 10158 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10159 | countingStream->rewind(); |
| 10160 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10161 | uint64_t cgen_var_683; |
| 10162 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_683, 1); |
| 10163 | countingStream->write((uint64_t*)&cgen_var_683, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10164 | marshal_VkBufferMemoryRequirementsInfo2(countingStream, (VkBufferMemoryRequirementsInfo2*)(local_pInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10165 | marshal_VkMemoryRequirements2(countingStream, (VkMemoryRequirements2*)(pMemoryRequirements)); |
| 10166 | } |
| 10167 | uint32_t packetSize_vkGetBufferMemoryRequirements2 = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 10168 | countingStream->rewind(); |
| 10169 | uint32_t opcode_vkGetBufferMemoryRequirements2 = OP_vkGetBufferMemoryRequirements2; |
| 10170 | stream->write(&opcode_vkGetBufferMemoryRequirements2, sizeof(uint32_t)); |
| 10171 | stream->write(&packetSize_vkGetBufferMemoryRequirements2, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10172 | uint64_t cgen_var_684; |
| 10173 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_684, 1); |
| 10174 | stream->write((uint64_t*)&cgen_var_684, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10175 | marshal_VkBufferMemoryRequirementsInfo2(stream, (VkBufferMemoryRequirementsInfo2*)(local_pInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10176 | marshal_VkMemoryRequirements2(stream, (VkMemoryRequirements2*)(pMemoryRequirements)); |
| 10177 | unmarshal_VkMemoryRequirements2(stream, (VkMemoryRequirements2*)(pMemoryRequirements)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 10178 | if (pMemoryRequirements) |
| 10179 | { |
| 10180 | transform_fromhost_VkMemoryRequirements2(mImpl->resources(), (VkMemoryRequirements2*)(pMemoryRequirements)); |
| 10181 | } |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 10182 | pool->freeAll(); |
| 10183 | countingStream->clearPool(); |
| 10184 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10185 | mImpl->log("finish vkGetBufferMemoryRequirements2");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10186 | } |
| 10187 | |
| 10188 | void VkEncoder::vkGetImageSparseMemoryRequirements2( |
| 10189 | VkDevice device, |
| 10190 | const VkImageSparseMemoryRequirementsInfo2* pInfo, |
| 10191 | uint32_t* pSparseMemoryRequirementCount, |
| 10192 | VkSparseImageMemoryRequirements2* pSparseMemoryRequirements) |
| 10193 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 10194 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10195 | mImpl->log("start vkGetImageSparseMemoryRequirements2"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10196 | auto stream = mImpl->stream(); |
| 10197 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10198 | auto resources = mImpl->resources(); |
| 10199 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 10200 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10201 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10202 | VkImageSparseMemoryRequirementsInfo2* local_pInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 10203 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10204 | local_pInfo = nullptr; |
| 10205 | if (pInfo) |
| 10206 | { |
| 10207 | local_pInfo = (VkImageSparseMemoryRequirementsInfo2*)pool->alloc(sizeof(const VkImageSparseMemoryRequirementsInfo2)); |
| 10208 | deepcopy_VkImageSparseMemoryRequirementsInfo2(pool, pInfo, (VkImageSparseMemoryRequirementsInfo2*)(local_pInfo)); |
| 10209 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 10210 | if (local_pInfo) |
| 10211 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 10212 | transform_tohost_VkImageSparseMemoryRequirementsInfo2(mImpl->resources(), (VkImageSparseMemoryRequirementsInfo2*)(local_pInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 10213 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10214 | countingStream->rewind(); |
| 10215 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10216 | uint64_t cgen_var_685; |
| 10217 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_685, 1); |
| 10218 | countingStream->write((uint64_t*)&cgen_var_685, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10219 | marshal_VkImageSparseMemoryRequirementsInfo2(countingStream, (VkImageSparseMemoryRequirementsInfo2*)(local_pInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10220 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10221 | uint64_t cgen_var_686 = (uint64_t)(uintptr_t)pSparseMemoryRequirementCount; |
| 10222 | countingStream->putBe64(cgen_var_686); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10223 | if (pSparseMemoryRequirementCount) |
| 10224 | { |
| 10225 | countingStream->write((uint32_t*)pSparseMemoryRequirementCount, sizeof(uint32_t)); |
| 10226 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10227 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10228 | uint64_t cgen_var_687 = (uint64_t)(uintptr_t)pSparseMemoryRequirements; |
| 10229 | countingStream->putBe64(cgen_var_687); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10230 | if (pSparseMemoryRequirements) |
| 10231 | { |
| 10232 | for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i) |
| 10233 | { |
| 10234 | marshal_VkSparseImageMemoryRequirements2(countingStream, (VkSparseImageMemoryRequirements2*)(pSparseMemoryRequirements + i)); |
| 10235 | } |
| 10236 | } |
| 10237 | } |
| 10238 | uint32_t packetSize_vkGetImageSparseMemoryRequirements2 = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 10239 | countingStream->rewind(); |
| 10240 | uint32_t opcode_vkGetImageSparseMemoryRequirements2 = OP_vkGetImageSparseMemoryRequirements2; |
| 10241 | stream->write(&opcode_vkGetImageSparseMemoryRequirements2, sizeof(uint32_t)); |
| 10242 | stream->write(&packetSize_vkGetImageSparseMemoryRequirements2, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10243 | uint64_t cgen_var_688; |
| 10244 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_688, 1); |
| 10245 | stream->write((uint64_t*)&cgen_var_688, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10246 | marshal_VkImageSparseMemoryRequirementsInfo2(stream, (VkImageSparseMemoryRequirementsInfo2*)(local_pInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10247 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10248 | uint64_t cgen_var_689 = (uint64_t)(uintptr_t)pSparseMemoryRequirementCount; |
| 10249 | stream->putBe64(cgen_var_689); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10250 | if (pSparseMemoryRequirementCount) |
| 10251 | { |
| 10252 | stream->write((uint32_t*)pSparseMemoryRequirementCount, sizeof(uint32_t)); |
| 10253 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10254 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10255 | uint64_t cgen_var_690 = (uint64_t)(uintptr_t)pSparseMemoryRequirements; |
| 10256 | stream->putBe64(cgen_var_690); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10257 | if (pSparseMemoryRequirements) |
| 10258 | { |
| 10259 | for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i) |
| 10260 | { |
| 10261 | marshal_VkSparseImageMemoryRequirements2(stream, (VkSparseImageMemoryRequirements2*)(pSparseMemoryRequirements + i)); |
| 10262 | } |
| 10263 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10264 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10265 | uint32_t* check_pSparseMemoryRequirementCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10266 | check_pSparseMemoryRequirementCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10267 | if (pSparseMemoryRequirementCount) |
| 10268 | { |
| 10269 | if (!(check_pSparseMemoryRequirementCount)) |
| 10270 | { |
| 10271 | fprintf(stderr, "fatal: pSparseMemoryRequirementCount inconsistent between guest and host\n"); |
| 10272 | } |
| 10273 | stream->read((uint32_t*)pSparseMemoryRequirementCount, sizeof(uint32_t)); |
| 10274 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10275 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10276 | VkSparseImageMemoryRequirements2* check_pSparseMemoryRequirements; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10277 | check_pSparseMemoryRequirements = (VkSparseImageMemoryRequirements2*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10278 | if (pSparseMemoryRequirements) |
| 10279 | { |
| 10280 | if (!(check_pSparseMemoryRequirements)) |
| 10281 | { |
| 10282 | fprintf(stderr, "fatal: pSparseMemoryRequirements inconsistent between guest and host\n"); |
| 10283 | } |
| 10284 | for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i) |
| 10285 | { |
| 10286 | unmarshal_VkSparseImageMemoryRequirements2(stream, (VkSparseImageMemoryRequirements2*)(pSparseMemoryRequirements + i)); |
| 10287 | } |
| 10288 | } |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 10289 | if (pSparseMemoryRequirements) |
| 10290 | { |
| 10291 | for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i) |
| 10292 | { |
| 10293 | transform_fromhost_VkSparseImageMemoryRequirements2(mImpl->resources(), (VkSparseImageMemoryRequirements2*)(pSparseMemoryRequirements + i)); |
| 10294 | } |
| 10295 | } |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 10296 | pool->freeAll(); |
| 10297 | countingStream->clearPool(); |
| 10298 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10299 | mImpl->log("finish vkGetImageSparseMemoryRequirements2");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10300 | } |
| 10301 | |
| 10302 | void VkEncoder::vkGetPhysicalDeviceFeatures2( |
| 10303 | VkPhysicalDevice physicalDevice, |
| 10304 | VkPhysicalDeviceFeatures2* pFeatures) |
| 10305 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 10306 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10307 | mImpl->log("start vkGetPhysicalDeviceFeatures2"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10308 | auto stream = mImpl->stream(); |
| 10309 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10310 | auto resources = mImpl->resources(); |
| 10311 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 10312 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10313 | VkPhysicalDevice local_physicalDevice; |
| 10314 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10315 | countingStream->rewind(); |
| 10316 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10317 | uint64_t cgen_var_693; |
| 10318 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_693, 1); |
| 10319 | countingStream->write((uint64_t*)&cgen_var_693, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10320 | marshal_VkPhysicalDeviceFeatures2(countingStream, (VkPhysicalDeviceFeatures2*)(pFeatures)); |
| 10321 | } |
| 10322 | uint32_t packetSize_vkGetPhysicalDeviceFeatures2 = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 10323 | countingStream->rewind(); |
| 10324 | uint32_t opcode_vkGetPhysicalDeviceFeatures2 = OP_vkGetPhysicalDeviceFeatures2; |
| 10325 | stream->write(&opcode_vkGetPhysicalDeviceFeatures2, sizeof(uint32_t)); |
| 10326 | stream->write(&packetSize_vkGetPhysicalDeviceFeatures2, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10327 | uint64_t cgen_var_694; |
| 10328 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_694, 1); |
| 10329 | stream->write((uint64_t*)&cgen_var_694, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10330 | marshal_VkPhysicalDeviceFeatures2(stream, (VkPhysicalDeviceFeatures2*)(pFeatures)); |
| 10331 | unmarshal_VkPhysicalDeviceFeatures2(stream, (VkPhysicalDeviceFeatures2*)(pFeatures)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 10332 | if (pFeatures) |
| 10333 | { |
| 10334 | transform_fromhost_VkPhysicalDeviceFeatures2(mImpl->resources(), (VkPhysicalDeviceFeatures2*)(pFeatures)); |
| 10335 | } |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 10336 | pool->freeAll(); |
| 10337 | countingStream->clearPool(); |
| 10338 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10339 | mImpl->log("finish vkGetPhysicalDeviceFeatures2");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10340 | } |
| 10341 | |
| 10342 | void VkEncoder::vkGetPhysicalDeviceProperties2( |
| 10343 | VkPhysicalDevice physicalDevice, |
| 10344 | VkPhysicalDeviceProperties2* pProperties) |
| 10345 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 10346 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 154a33c | 2019-01-29 19:06:23 -0800 | [diff] [blame] | 10347 | mImpl->log("start vkGetPhysicalDeviceProperties2"); |
| 10348 | auto stream = mImpl->stream(); |
| 10349 | auto countingStream = mImpl->countingStream(); |
| 10350 | auto resources = mImpl->resources(); |
| 10351 | auto pool = mImpl->pool(); |
| 10352 | stream->setHandleMapping(resources->unwrapMapping()); |
| 10353 | VkPhysicalDevice local_physicalDevice; |
| 10354 | local_physicalDevice = physicalDevice; |
| 10355 | countingStream->rewind(); |
| 10356 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10357 | uint64_t cgen_var_695; |
| 10358 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_695, 1); |
| 10359 | countingStream->write((uint64_t*)&cgen_var_695, 1 * 8); |
| Lingfeng Yang | 154a33c | 2019-01-29 19:06:23 -0800 | [diff] [blame] | 10360 | marshal_VkPhysicalDeviceProperties2(countingStream, (VkPhysicalDeviceProperties2*)(pProperties)); |
| 10361 | } |
| 10362 | uint32_t packetSize_vkGetPhysicalDeviceProperties2 = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 10363 | countingStream->rewind(); |
| 10364 | uint32_t opcode_vkGetPhysicalDeviceProperties2 = OP_vkGetPhysicalDeviceProperties2; |
| 10365 | stream->write(&opcode_vkGetPhysicalDeviceProperties2, sizeof(uint32_t)); |
| 10366 | stream->write(&packetSize_vkGetPhysicalDeviceProperties2, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10367 | uint64_t cgen_var_696; |
| 10368 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_696, 1); |
| 10369 | stream->write((uint64_t*)&cgen_var_696, 1 * 8); |
| Lingfeng Yang | 154a33c | 2019-01-29 19:06:23 -0800 | [diff] [blame] | 10370 | marshal_VkPhysicalDeviceProperties2(stream, (VkPhysicalDeviceProperties2*)(pProperties)); |
| 10371 | unmarshal_VkPhysicalDeviceProperties2(stream, (VkPhysicalDeviceProperties2*)(pProperties)); |
| 10372 | if (pProperties) |
| 10373 | { |
| 10374 | transform_fromhost_VkPhysicalDeviceProperties2(mImpl->resources(), (VkPhysicalDeviceProperties2*)(pProperties)); |
| 10375 | } |
| Yilong Li | f336908 | 2020-06-25 03:39:24 -0700 | [diff] [blame] | 10376 | mImpl->resources()->on_vkGetPhysicalDeviceProperties2(this, physicalDevice, pProperties); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 10377 | pool->freeAll(); |
| 10378 | countingStream->clearPool(); |
| 10379 | stream->clearPool(); |
| Lingfeng Yang | 154a33c | 2019-01-29 19:06:23 -0800 | [diff] [blame] | 10380 | mImpl->log("finish vkGetPhysicalDeviceProperties2");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10381 | } |
| 10382 | |
| 10383 | void VkEncoder::vkGetPhysicalDeviceFormatProperties2( |
| 10384 | VkPhysicalDevice physicalDevice, |
| 10385 | VkFormat format, |
| 10386 | VkFormatProperties2* pFormatProperties) |
| 10387 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 10388 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10389 | mImpl->log("start vkGetPhysicalDeviceFormatProperties2"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10390 | auto stream = mImpl->stream(); |
| 10391 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10392 | auto resources = mImpl->resources(); |
| 10393 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 10394 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10395 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10396 | VkFormat local_format; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 10397 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10398 | local_format = format; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10399 | countingStream->rewind(); |
| 10400 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10401 | uint64_t cgen_var_697; |
| 10402 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_697, 1); |
| 10403 | countingStream->write((uint64_t*)&cgen_var_697, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10404 | countingStream->write((VkFormat*)&local_format, sizeof(VkFormat)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10405 | marshal_VkFormatProperties2(countingStream, (VkFormatProperties2*)(pFormatProperties)); |
| 10406 | } |
| 10407 | uint32_t packetSize_vkGetPhysicalDeviceFormatProperties2 = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 10408 | countingStream->rewind(); |
| 10409 | uint32_t opcode_vkGetPhysicalDeviceFormatProperties2 = OP_vkGetPhysicalDeviceFormatProperties2; |
| 10410 | stream->write(&opcode_vkGetPhysicalDeviceFormatProperties2, sizeof(uint32_t)); |
| 10411 | stream->write(&packetSize_vkGetPhysicalDeviceFormatProperties2, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10412 | uint64_t cgen_var_698; |
| 10413 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_698, 1); |
| 10414 | stream->write((uint64_t*)&cgen_var_698, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10415 | stream->write((VkFormat*)&local_format, sizeof(VkFormat)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10416 | marshal_VkFormatProperties2(stream, (VkFormatProperties2*)(pFormatProperties)); |
| 10417 | unmarshal_VkFormatProperties2(stream, (VkFormatProperties2*)(pFormatProperties)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 10418 | if (pFormatProperties) |
| 10419 | { |
| 10420 | transform_fromhost_VkFormatProperties2(mImpl->resources(), (VkFormatProperties2*)(pFormatProperties)); |
| 10421 | } |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 10422 | pool->freeAll(); |
| 10423 | countingStream->clearPool(); |
| 10424 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10425 | mImpl->log("finish vkGetPhysicalDeviceFormatProperties2");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10426 | } |
| 10427 | |
| 10428 | VkResult VkEncoder::vkGetPhysicalDeviceImageFormatProperties2( |
| 10429 | VkPhysicalDevice physicalDevice, |
| 10430 | const VkPhysicalDeviceImageFormatInfo2* pImageFormatInfo, |
| 10431 | VkImageFormatProperties2* pImageFormatProperties) |
| 10432 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 10433 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10434 | mImpl->log("start vkGetPhysicalDeviceImageFormatProperties2"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10435 | auto stream = mImpl->stream(); |
| 10436 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10437 | auto resources = mImpl->resources(); |
| 10438 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 10439 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10440 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10441 | VkPhysicalDeviceImageFormatInfo2* local_pImageFormatInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 10442 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10443 | local_pImageFormatInfo = nullptr; |
| 10444 | if (pImageFormatInfo) |
| 10445 | { |
| 10446 | local_pImageFormatInfo = (VkPhysicalDeviceImageFormatInfo2*)pool->alloc(sizeof(const VkPhysicalDeviceImageFormatInfo2)); |
| 10447 | deepcopy_VkPhysicalDeviceImageFormatInfo2(pool, pImageFormatInfo, (VkPhysicalDeviceImageFormatInfo2*)(local_pImageFormatInfo)); |
| 10448 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 10449 | if (local_pImageFormatInfo) |
| 10450 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 10451 | transform_tohost_VkPhysicalDeviceImageFormatInfo2(mImpl->resources(), (VkPhysicalDeviceImageFormatInfo2*)(local_pImageFormatInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 10452 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10453 | countingStream->rewind(); |
| 10454 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10455 | uint64_t cgen_var_699; |
| 10456 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_699, 1); |
| 10457 | countingStream->write((uint64_t*)&cgen_var_699, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10458 | marshal_VkPhysicalDeviceImageFormatInfo2(countingStream, (VkPhysicalDeviceImageFormatInfo2*)(local_pImageFormatInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10459 | marshal_VkImageFormatProperties2(countingStream, (VkImageFormatProperties2*)(pImageFormatProperties)); |
| 10460 | } |
| 10461 | uint32_t packetSize_vkGetPhysicalDeviceImageFormatProperties2 = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 10462 | countingStream->rewind(); |
| 10463 | uint32_t opcode_vkGetPhysicalDeviceImageFormatProperties2 = OP_vkGetPhysicalDeviceImageFormatProperties2; |
| 10464 | stream->write(&opcode_vkGetPhysicalDeviceImageFormatProperties2, sizeof(uint32_t)); |
| 10465 | stream->write(&packetSize_vkGetPhysicalDeviceImageFormatProperties2, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10466 | uint64_t cgen_var_700; |
| 10467 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_700, 1); |
| 10468 | stream->write((uint64_t*)&cgen_var_700, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10469 | marshal_VkPhysicalDeviceImageFormatInfo2(stream, (VkPhysicalDeviceImageFormatInfo2*)(local_pImageFormatInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10470 | marshal_VkImageFormatProperties2(stream, (VkImageFormatProperties2*)(pImageFormatProperties)); |
| 10471 | unmarshal_VkImageFormatProperties2(stream, (VkImageFormatProperties2*)(pImageFormatProperties)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 10472 | if (pImageFormatProperties) |
| 10473 | { |
| 10474 | transform_fromhost_VkImageFormatProperties2(mImpl->resources(), (VkImageFormatProperties2*)(pImageFormatProperties)); |
| 10475 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10476 | VkResult vkGetPhysicalDeviceImageFormatProperties2_VkResult_return = (VkResult)0; |
| 10477 | stream->read(&vkGetPhysicalDeviceImageFormatProperties2_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 10478 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10479 | countingStream->clearPool(); |
| 10480 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10481 | mImpl->log("finish vkGetPhysicalDeviceImageFormatProperties2");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10482 | return vkGetPhysicalDeviceImageFormatProperties2_VkResult_return; |
| 10483 | } |
| 10484 | |
| 10485 | void VkEncoder::vkGetPhysicalDeviceQueueFamilyProperties2( |
| 10486 | VkPhysicalDevice physicalDevice, |
| 10487 | uint32_t* pQueueFamilyPropertyCount, |
| 10488 | VkQueueFamilyProperties2* pQueueFamilyProperties) |
| 10489 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 10490 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10491 | mImpl->log("start vkGetPhysicalDeviceQueueFamilyProperties2"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10492 | auto stream = mImpl->stream(); |
| 10493 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10494 | auto resources = mImpl->resources(); |
| 10495 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 10496 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10497 | VkPhysicalDevice local_physicalDevice; |
| 10498 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10499 | countingStream->rewind(); |
| 10500 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10501 | uint64_t cgen_var_701; |
| 10502 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_701, 1); |
| 10503 | countingStream->write((uint64_t*)&cgen_var_701, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10504 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10505 | uint64_t cgen_var_702 = (uint64_t)(uintptr_t)pQueueFamilyPropertyCount; |
| 10506 | countingStream->putBe64(cgen_var_702); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10507 | if (pQueueFamilyPropertyCount) |
| 10508 | { |
| 10509 | countingStream->write((uint32_t*)pQueueFamilyPropertyCount, sizeof(uint32_t)); |
| 10510 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10511 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10512 | uint64_t cgen_var_703 = (uint64_t)(uintptr_t)pQueueFamilyProperties; |
| 10513 | countingStream->putBe64(cgen_var_703); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10514 | if (pQueueFamilyProperties) |
| 10515 | { |
| 10516 | for (uint32_t i = 0; i < (uint32_t)(*(pQueueFamilyPropertyCount)); ++i) |
| 10517 | { |
| 10518 | marshal_VkQueueFamilyProperties2(countingStream, (VkQueueFamilyProperties2*)(pQueueFamilyProperties + i)); |
| 10519 | } |
| 10520 | } |
| 10521 | } |
| 10522 | uint32_t packetSize_vkGetPhysicalDeviceQueueFamilyProperties2 = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 10523 | countingStream->rewind(); |
| 10524 | uint32_t opcode_vkGetPhysicalDeviceQueueFamilyProperties2 = OP_vkGetPhysicalDeviceQueueFamilyProperties2; |
| 10525 | stream->write(&opcode_vkGetPhysicalDeviceQueueFamilyProperties2, sizeof(uint32_t)); |
| 10526 | stream->write(&packetSize_vkGetPhysicalDeviceQueueFamilyProperties2, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10527 | uint64_t cgen_var_704; |
| 10528 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_704, 1); |
| 10529 | stream->write((uint64_t*)&cgen_var_704, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10530 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10531 | uint64_t cgen_var_705 = (uint64_t)(uintptr_t)pQueueFamilyPropertyCount; |
| 10532 | stream->putBe64(cgen_var_705); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10533 | if (pQueueFamilyPropertyCount) |
| 10534 | { |
| 10535 | stream->write((uint32_t*)pQueueFamilyPropertyCount, sizeof(uint32_t)); |
| 10536 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10537 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10538 | uint64_t cgen_var_706 = (uint64_t)(uintptr_t)pQueueFamilyProperties; |
| 10539 | stream->putBe64(cgen_var_706); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10540 | if (pQueueFamilyProperties) |
| 10541 | { |
| 10542 | for (uint32_t i = 0; i < (uint32_t)(*(pQueueFamilyPropertyCount)); ++i) |
| 10543 | { |
| 10544 | marshal_VkQueueFamilyProperties2(stream, (VkQueueFamilyProperties2*)(pQueueFamilyProperties + i)); |
| 10545 | } |
| 10546 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10547 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10548 | uint32_t* check_pQueueFamilyPropertyCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10549 | check_pQueueFamilyPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10550 | if (pQueueFamilyPropertyCount) |
| 10551 | { |
| 10552 | if (!(check_pQueueFamilyPropertyCount)) |
| 10553 | { |
| 10554 | fprintf(stderr, "fatal: pQueueFamilyPropertyCount inconsistent between guest and host\n"); |
| 10555 | } |
| 10556 | stream->read((uint32_t*)pQueueFamilyPropertyCount, sizeof(uint32_t)); |
| 10557 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10558 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10559 | VkQueueFamilyProperties2* check_pQueueFamilyProperties; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10560 | check_pQueueFamilyProperties = (VkQueueFamilyProperties2*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10561 | if (pQueueFamilyProperties) |
| 10562 | { |
| 10563 | if (!(check_pQueueFamilyProperties)) |
| 10564 | { |
| 10565 | fprintf(stderr, "fatal: pQueueFamilyProperties inconsistent between guest and host\n"); |
| 10566 | } |
| 10567 | for (uint32_t i = 0; i < (uint32_t)(*(pQueueFamilyPropertyCount)); ++i) |
| 10568 | { |
| 10569 | unmarshal_VkQueueFamilyProperties2(stream, (VkQueueFamilyProperties2*)(pQueueFamilyProperties + i)); |
| 10570 | } |
| 10571 | } |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 10572 | if (pQueueFamilyProperties) |
| 10573 | { |
| 10574 | for (uint32_t i = 0; i < (uint32_t)(*(pQueueFamilyPropertyCount)); ++i) |
| 10575 | { |
| 10576 | transform_fromhost_VkQueueFamilyProperties2(mImpl->resources(), (VkQueueFamilyProperties2*)(pQueueFamilyProperties + i)); |
| 10577 | } |
| 10578 | } |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 10579 | pool->freeAll(); |
| 10580 | countingStream->clearPool(); |
| 10581 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10582 | mImpl->log("finish vkGetPhysicalDeviceQueueFamilyProperties2");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10583 | } |
| 10584 | |
| 10585 | void VkEncoder::vkGetPhysicalDeviceMemoryProperties2( |
| 10586 | VkPhysicalDevice physicalDevice, |
| 10587 | VkPhysicalDeviceMemoryProperties2* pMemoryProperties) |
| 10588 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 10589 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10590 | mImpl->log("start vkGetPhysicalDeviceMemoryProperties2"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10591 | auto stream = mImpl->stream(); |
| 10592 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10593 | auto resources = mImpl->resources(); |
| 10594 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 10595 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10596 | VkPhysicalDevice local_physicalDevice; |
| 10597 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10598 | countingStream->rewind(); |
| 10599 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10600 | uint64_t cgen_var_709; |
| 10601 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_709, 1); |
| 10602 | countingStream->write((uint64_t*)&cgen_var_709, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10603 | marshal_VkPhysicalDeviceMemoryProperties2(countingStream, (VkPhysicalDeviceMemoryProperties2*)(pMemoryProperties)); |
| 10604 | } |
| 10605 | uint32_t packetSize_vkGetPhysicalDeviceMemoryProperties2 = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 10606 | countingStream->rewind(); |
| 10607 | uint32_t opcode_vkGetPhysicalDeviceMemoryProperties2 = OP_vkGetPhysicalDeviceMemoryProperties2; |
| 10608 | stream->write(&opcode_vkGetPhysicalDeviceMemoryProperties2, sizeof(uint32_t)); |
| 10609 | stream->write(&packetSize_vkGetPhysicalDeviceMemoryProperties2, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10610 | uint64_t cgen_var_710; |
| 10611 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_710, 1); |
| 10612 | stream->write((uint64_t*)&cgen_var_710, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10613 | marshal_VkPhysicalDeviceMemoryProperties2(stream, (VkPhysicalDeviceMemoryProperties2*)(pMemoryProperties)); |
| 10614 | unmarshal_VkPhysicalDeviceMemoryProperties2(stream, (VkPhysicalDeviceMemoryProperties2*)(pMemoryProperties)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 10615 | if (pMemoryProperties) |
| 10616 | { |
| 10617 | transform_fromhost_VkPhysicalDeviceMemoryProperties2(mImpl->resources(), (VkPhysicalDeviceMemoryProperties2*)(pMemoryProperties)); |
| 10618 | } |
| Lingfeng Yang | 154a33c | 2019-01-29 19:06:23 -0800 | [diff] [blame] | 10619 | mImpl->resources()->on_vkGetPhysicalDeviceMemoryProperties2(this, physicalDevice, pMemoryProperties); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 10620 | pool->freeAll(); |
| 10621 | countingStream->clearPool(); |
| 10622 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10623 | mImpl->log("finish vkGetPhysicalDeviceMemoryProperties2");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10624 | } |
| 10625 | |
| 10626 | void VkEncoder::vkGetPhysicalDeviceSparseImageFormatProperties2( |
| 10627 | VkPhysicalDevice physicalDevice, |
| 10628 | const VkPhysicalDeviceSparseImageFormatInfo2* pFormatInfo, |
| 10629 | uint32_t* pPropertyCount, |
| 10630 | VkSparseImageFormatProperties2* pProperties) |
| 10631 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 10632 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10633 | mImpl->log("start vkGetPhysicalDeviceSparseImageFormatProperties2"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10634 | auto stream = mImpl->stream(); |
| 10635 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10636 | auto resources = mImpl->resources(); |
| 10637 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 10638 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10639 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10640 | VkPhysicalDeviceSparseImageFormatInfo2* local_pFormatInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 10641 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10642 | local_pFormatInfo = nullptr; |
| 10643 | if (pFormatInfo) |
| 10644 | { |
| 10645 | local_pFormatInfo = (VkPhysicalDeviceSparseImageFormatInfo2*)pool->alloc(sizeof(const VkPhysicalDeviceSparseImageFormatInfo2)); |
| 10646 | deepcopy_VkPhysicalDeviceSparseImageFormatInfo2(pool, pFormatInfo, (VkPhysicalDeviceSparseImageFormatInfo2*)(local_pFormatInfo)); |
| 10647 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 10648 | if (local_pFormatInfo) |
| 10649 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 10650 | transform_tohost_VkPhysicalDeviceSparseImageFormatInfo2(mImpl->resources(), (VkPhysicalDeviceSparseImageFormatInfo2*)(local_pFormatInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 10651 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10652 | countingStream->rewind(); |
| 10653 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10654 | uint64_t cgen_var_711; |
| 10655 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_711, 1); |
| 10656 | countingStream->write((uint64_t*)&cgen_var_711, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10657 | marshal_VkPhysicalDeviceSparseImageFormatInfo2(countingStream, (VkPhysicalDeviceSparseImageFormatInfo2*)(local_pFormatInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10658 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10659 | uint64_t cgen_var_712 = (uint64_t)(uintptr_t)pPropertyCount; |
| 10660 | countingStream->putBe64(cgen_var_712); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10661 | if (pPropertyCount) |
| 10662 | { |
| 10663 | countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 10664 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10665 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10666 | uint64_t cgen_var_713 = (uint64_t)(uintptr_t)pProperties; |
| 10667 | countingStream->putBe64(cgen_var_713); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10668 | if (pProperties) |
| 10669 | { |
| 10670 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 10671 | { |
| 10672 | marshal_VkSparseImageFormatProperties2(countingStream, (VkSparseImageFormatProperties2*)(pProperties + i)); |
| 10673 | } |
| 10674 | } |
| 10675 | } |
| 10676 | uint32_t packetSize_vkGetPhysicalDeviceSparseImageFormatProperties2 = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 10677 | countingStream->rewind(); |
| 10678 | uint32_t opcode_vkGetPhysicalDeviceSparseImageFormatProperties2 = OP_vkGetPhysicalDeviceSparseImageFormatProperties2; |
| 10679 | stream->write(&opcode_vkGetPhysicalDeviceSparseImageFormatProperties2, sizeof(uint32_t)); |
| 10680 | stream->write(&packetSize_vkGetPhysicalDeviceSparseImageFormatProperties2, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10681 | uint64_t cgen_var_714; |
| 10682 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_714, 1); |
| 10683 | stream->write((uint64_t*)&cgen_var_714, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10684 | marshal_VkPhysicalDeviceSparseImageFormatInfo2(stream, (VkPhysicalDeviceSparseImageFormatInfo2*)(local_pFormatInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10685 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10686 | uint64_t cgen_var_715 = (uint64_t)(uintptr_t)pPropertyCount; |
| 10687 | stream->putBe64(cgen_var_715); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10688 | if (pPropertyCount) |
| 10689 | { |
| 10690 | stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 10691 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10692 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10693 | uint64_t cgen_var_716 = (uint64_t)(uintptr_t)pProperties; |
| 10694 | stream->putBe64(cgen_var_716); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10695 | if (pProperties) |
| 10696 | { |
| 10697 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 10698 | { |
| 10699 | marshal_VkSparseImageFormatProperties2(stream, (VkSparseImageFormatProperties2*)(pProperties + i)); |
| 10700 | } |
| 10701 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10702 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10703 | uint32_t* check_pPropertyCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10704 | check_pPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10705 | if (pPropertyCount) |
| 10706 | { |
| 10707 | if (!(check_pPropertyCount)) |
| 10708 | { |
| 10709 | fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n"); |
| 10710 | } |
| 10711 | stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 10712 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10713 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10714 | VkSparseImageFormatProperties2* check_pProperties; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10715 | check_pProperties = (VkSparseImageFormatProperties2*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10716 | if (pProperties) |
| 10717 | { |
| 10718 | if (!(check_pProperties)) |
| 10719 | { |
| 10720 | fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n"); |
| 10721 | } |
| 10722 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 10723 | { |
| 10724 | unmarshal_VkSparseImageFormatProperties2(stream, (VkSparseImageFormatProperties2*)(pProperties + i)); |
| 10725 | } |
| 10726 | } |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 10727 | if (pProperties) |
| 10728 | { |
| 10729 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 10730 | { |
| 10731 | transform_fromhost_VkSparseImageFormatProperties2(mImpl->resources(), (VkSparseImageFormatProperties2*)(pProperties + i)); |
| 10732 | } |
| 10733 | } |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 10734 | pool->freeAll(); |
| 10735 | countingStream->clearPool(); |
| 10736 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10737 | mImpl->log("finish vkGetPhysicalDeviceSparseImageFormatProperties2");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10738 | } |
| 10739 | |
| 10740 | void VkEncoder::vkTrimCommandPool( |
| 10741 | VkDevice device, |
| 10742 | VkCommandPool commandPool, |
| 10743 | VkCommandPoolTrimFlags flags) |
| 10744 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 10745 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10746 | mImpl->log("start vkTrimCommandPool"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10747 | auto stream = mImpl->stream(); |
| 10748 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10749 | auto resources = mImpl->resources(); |
| 10750 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 10751 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10752 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10753 | VkCommandPool local_commandPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10754 | VkCommandPoolTrimFlags local_flags; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 10755 | local_device = device; |
| 10756 | local_commandPool = commandPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10757 | local_flags = flags; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10758 | countingStream->rewind(); |
| 10759 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10760 | uint64_t cgen_var_719; |
| 10761 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_719, 1); |
| 10762 | countingStream->write((uint64_t*)&cgen_var_719, 1 * 8); |
| 10763 | uint64_t cgen_var_720; |
| 10764 | countingStream->handleMapping()->mapHandles_VkCommandPool_u64(&local_commandPool, &cgen_var_720, 1); |
| 10765 | countingStream->write((uint64_t*)&cgen_var_720, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10766 | countingStream->write((VkCommandPoolTrimFlags*)&local_flags, sizeof(VkCommandPoolTrimFlags)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10767 | } |
| 10768 | uint32_t packetSize_vkTrimCommandPool = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 10769 | countingStream->rewind(); |
| 10770 | uint32_t opcode_vkTrimCommandPool = OP_vkTrimCommandPool; |
| 10771 | stream->write(&opcode_vkTrimCommandPool, sizeof(uint32_t)); |
| 10772 | stream->write(&packetSize_vkTrimCommandPool, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10773 | uint64_t cgen_var_721; |
| 10774 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_721, 1); |
| 10775 | stream->write((uint64_t*)&cgen_var_721, 1 * 8); |
| 10776 | uint64_t cgen_var_722; |
| 10777 | stream->handleMapping()->mapHandles_VkCommandPool_u64(&local_commandPool, &cgen_var_722, 1); |
| 10778 | stream->write((uint64_t*)&cgen_var_722, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10779 | stream->write((VkCommandPoolTrimFlags*)&local_flags, sizeof(VkCommandPoolTrimFlags)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 10780 | pool->freeAll(); |
| 10781 | countingStream->clearPool(); |
| 10782 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10783 | mImpl->log("finish vkTrimCommandPool");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10784 | } |
| 10785 | |
| 10786 | void VkEncoder::vkGetDeviceQueue2( |
| 10787 | VkDevice device, |
| 10788 | const VkDeviceQueueInfo2* pQueueInfo, |
| 10789 | VkQueue* pQueue) |
| 10790 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 10791 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10792 | mImpl->log("start vkGetDeviceQueue2"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10793 | auto stream = mImpl->stream(); |
| 10794 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10795 | auto resources = mImpl->resources(); |
| 10796 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 10797 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10798 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10799 | VkDeviceQueueInfo2* local_pQueueInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 10800 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10801 | local_pQueueInfo = nullptr; |
| 10802 | if (pQueueInfo) |
| 10803 | { |
| 10804 | local_pQueueInfo = (VkDeviceQueueInfo2*)pool->alloc(sizeof(const VkDeviceQueueInfo2)); |
| 10805 | deepcopy_VkDeviceQueueInfo2(pool, pQueueInfo, (VkDeviceQueueInfo2*)(local_pQueueInfo)); |
| 10806 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 10807 | if (local_pQueueInfo) |
| 10808 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 10809 | transform_tohost_VkDeviceQueueInfo2(mImpl->resources(), (VkDeviceQueueInfo2*)(local_pQueueInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 10810 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10811 | countingStream->rewind(); |
| 10812 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10813 | uint64_t cgen_var_723; |
| 10814 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_723, 1); |
| 10815 | countingStream->write((uint64_t*)&cgen_var_723, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10816 | marshal_VkDeviceQueueInfo2(countingStream, (VkDeviceQueueInfo2*)(local_pQueueInfo)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10817 | uint64_t cgen_var_724; |
| 10818 | countingStream->handleMapping()->mapHandles_VkQueue_u64(pQueue, &cgen_var_724, 1); |
| 10819 | countingStream->write((uint64_t*)&cgen_var_724, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10820 | } |
| 10821 | uint32_t packetSize_vkGetDeviceQueue2 = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 10822 | countingStream->rewind(); |
| 10823 | uint32_t opcode_vkGetDeviceQueue2 = OP_vkGetDeviceQueue2; |
| 10824 | stream->write(&opcode_vkGetDeviceQueue2, sizeof(uint32_t)); |
| 10825 | stream->write(&packetSize_vkGetDeviceQueue2, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10826 | uint64_t cgen_var_725; |
| 10827 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_725, 1); |
| 10828 | stream->write((uint64_t*)&cgen_var_725, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10829 | marshal_VkDeviceQueueInfo2(stream, (VkDeviceQueueInfo2*)(local_pQueueInfo)); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 10830 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10831 | uint64_t cgen_var_726; |
| 10832 | stream->handleMapping()->mapHandles_VkQueue_u64(pQueue, &cgen_var_726, 1); |
| 10833 | stream->write((uint64_t*)&cgen_var_726, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 10834 | stream->setHandleMapping(resources->unwrapMapping()); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10835 | uint64_t cgen_var_727; |
| 10836 | stream->read((uint64_t*)&cgen_var_727, 8); |
| 10837 | stream->handleMapping()->mapHandles_u64_VkQueue(&cgen_var_727, (VkQueue*)pQueue, 1); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 10838 | pool->freeAll(); |
| 10839 | countingStream->clearPool(); |
| 10840 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10841 | mImpl->log("finish vkGetDeviceQueue2");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10842 | } |
| 10843 | |
| 10844 | VkResult VkEncoder::vkCreateSamplerYcbcrConversion( |
| 10845 | VkDevice device, |
| 10846 | const VkSamplerYcbcrConversionCreateInfo* pCreateInfo, |
| 10847 | const VkAllocationCallbacks* pAllocator, |
| 10848 | VkSamplerYcbcrConversion* pYcbcrConversion) |
| 10849 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 10850 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10851 | mImpl->log("start vkCreateSamplerYcbcrConversion"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10852 | auto stream = mImpl->stream(); |
| 10853 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10854 | auto resources = mImpl->resources(); |
| 10855 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 10856 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10857 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10858 | VkSamplerYcbcrConversionCreateInfo* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 10859 | VkAllocationCallbacks* local_pAllocator; |
| 10860 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10861 | local_pCreateInfo = nullptr; |
| 10862 | if (pCreateInfo) |
| 10863 | { |
| 10864 | local_pCreateInfo = (VkSamplerYcbcrConversionCreateInfo*)pool->alloc(sizeof(const VkSamplerYcbcrConversionCreateInfo)); |
| 10865 | deepcopy_VkSamplerYcbcrConversionCreateInfo(pool, pCreateInfo, (VkSamplerYcbcrConversionCreateInfo*)(local_pCreateInfo)); |
| 10866 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10867 | local_pAllocator = nullptr; |
| 10868 | if (pAllocator) |
| 10869 | { |
| 10870 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 10871 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 10872 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 10873 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 10874 | if (local_pCreateInfo) |
| 10875 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 10876 | transform_tohost_VkSamplerYcbcrConversionCreateInfo(mImpl->resources(), (VkSamplerYcbcrConversionCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 10877 | } |
| 10878 | if (local_pAllocator) |
| 10879 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 10880 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 10881 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10882 | countingStream->rewind(); |
| 10883 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10884 | uint64_t cgen_var_728; |
| 10885 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_728, 1); |
| 10886 | countingStream->write((uint64_t*)&cgen_var_728, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10887 | marshal_VkSamplerYcbcrConversionCreateInfo(countingStream, (VkSamplerYcbcrConversionCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10888 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10889 | uint64_t cgen_var_729 = (uint64_t)(uintptr_t)local_pAllocator; |
| 10890 | countingStream->putBe64(cgen_var_729); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10891 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10892 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10893 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10894 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10895 | uint64_t cgen_var_730; |
| 10896 | countingStream->handleMapping()->mapHandles_VkSamplerYcbcrConversion_u64(pYcbcrConversion, &cgen_var_730, 1); |
| 10897 | countingStream->write((uint64_t*)&cgen_var_730, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10898 | } |
| 10899 | uint32_t packetSize_vkCreateSamplerYcbcrConversion = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 10900 | countingStream->rewind(); |
| 10901 | uint32_t opcode_vkCreateSamplerYcbcrConversion = OP_vkCreateSamplerYcbcrConversion; |
| 10902 | stream->write(&opcode_vkCreateSamplerYcbcrConversion, sizeof(uint32_t)); |
| 10903 | stream->write(&packetSize_vkCreateSamplerYcbcrConversion, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10904 | uint64_t cgen_var_731; |
| 10905 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_731, 1); |
| 10906 | stream->write((uint64_t*)&cgen_var_731, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10907 | marshal_VkSamplerYcbcrConversionCreateInfo(stream, (VkSamplerYcbcrConversionCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10908 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10909 | uint64_t cgen_var_732 = (uint64_t)(uintptr_t)local_pAllocator; |
| 10910 | stream->putBe64(cgen_var_732); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10911 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10912 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10913 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10914 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 10915 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10916 | uint64_t cgen_var_733; |
| 10917 | stream->handleMapping()->mapHandles_VkSamplerYcbcrConversion_u64(pYcbcrConversion, &cgen_var_733, 1); |
| 10918 | stream->write((uint64_t*)&cgen_var_733, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 10919 | stream->setHandleMapping(resources->unwrapMapping()); |
| 10920 | stream->setHandleMapping(resources->createMapping()); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10921 | uint64_t cgen_var_734; |
| 10922 | stream->read((uint64_t*)&cgen_var_734, 8); |
| 10923 | stream->handleMapping()->mapHandles_u64_VkSamplerYcbcrConversion(&cgen_var_734, (VkSamplerYcbcrConversion*)pYcbcrConversion, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 10924 | stream->unsetHandleMapping(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10925 | VkResult vkCreateSamplerYcbcrConversion_VkResult_return = (VkResult)0; |
| 10926 | stream->read(&vkCreateSamplerYcbcrConversion_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 10927 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 10928 | countingStream->clearPool(); |
| 10929 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10930 | mImpl->log("finish vkCreateSamplerYcbcrConversion");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10931 | return vkCreateSamplerYcbcrConversion_VkResult_return; |
| 10932 | } |
| 10933 | |
| 10934 | void VkEncoder::vkDestroySamplerYcbcrConversion( |
| 10935 | VkDevice device, |
| 10936 | VkSamplerYcbcrConversion ycbcrConversion, |
| 10937 | const VkAllocationCallbacks* pAllocator) |
| 10938 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 10939 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 10940 | mImpl->log("start vkDestroySamplerYcbcrConversion"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10941 | auto stream = mImpl->stream(); |
| 10942 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10943 | auto resources = mImpl->resources(); |
| 10944 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 10945 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10946 | VkDevice local_device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 10947 | VkSamplerYcbcrConversion local_ycbcrConversion; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10948 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 10949 | local_device = device; |
| 10950 | local_ycbcrConversion = ycbcrConversion; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10951 | local_pAllocator = nullptr; |
| 10952 | if (pAllocator) |
| 10953 | { |
| 10954 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 10955 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 10956 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 10957 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 10958 | if (local_pAllocator) |
| 10959 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 10960 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 10961 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10962 | countingStream->rewind(); |
| 10963 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10964 | uint64_t cgen_var_735; |
| 10965 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_735, 1); |
| 10966 | countingStream->write((uint64_t*)&cgen_var_735, 1 * 8); |
| 10967 | uint64_t cgen_var_736; |
| 10968 | countingStream->handleMapping()->mapHandles_VkSamplerYcbcrConversion_u64(&local_ycbcrConversion, &cgen_var_736, 1); |
| 10969 | countingStream->write((uint64_t*)&cgen_var_736, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10970 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10971 | uint64_t cgen_var_737 = (uint64_t)(uintptr_t)local_pAllocator; |
| 10972 | countingStream->putBe64(cgen_var_737); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10973 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10974 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10975 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10976 | } |
| 10977 | } |
| 10978 | uint32_t packetSize_vkDestroySamplerYcbcrConversion = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 10979 | countingStream->rewind(); |
| 10980 | uint32_t opcode_vkDestroySamplerYcbcrConversion = OP_vkDestroySamplerYcbcrConversion; |
| 10981 | stream->write(&opcode_vkDestroySamplerYcbcrConversion, sizeof(uint32_t)); |
| 10982 | stream->write(&packetSize_vkDestroySamplerYcbcrConversion, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10983 | uint64_t cgen_var_738; |
| 10984 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_738, 1); |
| 10985 | stream->write((uint64_t*)&cgen_var_738, 1 * 8); |
| 10986 | uint64_t cgen_var_739; |
| 10987 | stream->handleMapping()->mapHandles_VkSamplerYcbcrConversion_u64(&local_ycbcrConversion, &cgen_var_739, 1); |
| 10988 | stream->write((uint64_t*)&cgen_var_739, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 10989 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 10990 | uint64_t cgen_var_740 = (uint64_t)(uintptr_t)local_pAllocator; |
| 10991 | stream->putBe64(cgen_var_740); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10992 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10993 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10994 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 10995 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 10996 | resources->destroyMapping()->mapHandles_VkSamplerYcbcrConversion((VkSamplerYcbcrConversion*)&ycbcrConversion); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 10997 | pool->freeAll(); |
| 10998 | countingStream->clearPool(); |
| 10999 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11000 | mImpl->log("finish vkDestroySamplerYcbcrConversion");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11001 | } |
| 11002 | |
| 11003 | VkResult VkEncoder::vkCreateDescriptorUpdateTemplate( |
| 11004 | VkDevice device, |
| 11005 | const VkDescriptorUpdateTemplateCreateInfo* pCreateInfo, |
| 11006 | const VkAllocationCallbacks* pAllocator, |
| 11007 | VkDescriptorUpdateTemplate* pDescriptorUpdateTemplate) |
| 11008 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 11009 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11010 | mImpl->log("start vkCreateDescriptorUpdateTemplate"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11011 | auto stream = mImpl->stream(); |
| 11012 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11013 | auto resources = mImpl->resources(); |
| 11014 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11015 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11016 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11017 | VkDescriptorUpdateTemplateCreateInfo* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 11018 | VkAllocationCallbacks* local_pAllocator; |
| 11019 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11020 | local_pCreateInfo = nullptr; |
| 11021 | if (pCreateInfo) |
| 11022 | { |
| 11023 | local_pCreateInfo = (VkDescriptorUpdateTemplateCreateInfo*)pool->alloc(sizeof(const VkDescriptorUpdateTemplateCreateInfo)); |
| 11024 | deepcopy_VkDescriptorUpdateTemplateCreateInfo(pool, pCreateInfo, (VkDescriptorUpdateTemplateCreateInfo*)(local_pCreateInfo)); |
| 11025 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11026 | local_pAllocator = nullptr; |
| 11027 | if (pAllocator) |
| 11028 | { |
| 11029 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 11030 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 11031 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 11032 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 11033 | if (local_pCreateInfo) |
| 11034 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 11035 | transform_tohost_VkDescriptorUpdateTemplateCreateInfo(mImpl->resources(), (VkDescriptorUpdateTemplateCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 11036 | } |
| 11037 | if (local_pAllocator) |
| 11038 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 11039 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 11040 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11041 | countingStream->rewind(); |
| 11042 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11043 | uint64_t cgen_var_741; |
| 11044 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_741, 1); |
| 11045 | countingStream->write((uint64_t*)&cgen_var_741, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11046 | marshal_VkDescriptorUpdateTemplateCreateInfo(countingStream, (VkDescriptorUpdateTemplateCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11047 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11048 | uint64_t cgen_var_742 = (uint64_t)(uintptr_t)local_pAllocator; |
| 11049 | countingStream->putBe64(cgen_var_742); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11050 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11051 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11052 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11053 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11054 | uint64_t cgen_var_743; |
| 11055 | countingStream->handleMapping()->mapHandles_VkDescriptorUpdateTemplate_u64(pDescriptorUpdateTemplate, &cgen_var_743, 1); |
| 11056 | countingStream->write((uint64_t*)&cgen_var_743, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11057 | } |
| 11058 | uint32_t packetSize_vkCreateDescriptorUpdateTemplate = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 11059 | countingStream->rewind(); |
| 11060 | uint32_t opcode_vkCreateDescriptorUpdateTemplate = OP_vkCreateDescriptorUpdateTemplate; |
| 11061 | stream->write(&opcode_vkCreateDescriptorUpdateTemplate, sizeof(uint32_t)); |
| 11062 | stream->write(&packetSize_vkCreateDescriptorUpdateTemplate, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11063 | uint64_t cgen_var_744; |
| 11064 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_744, 1); |
| 11065 | stream->write((uint64_t*)&cgen_var_744, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11066 | marshal_VkDescriptorUpdateTemplateCreateInfo(stream, (VkDescriptorUpdateTemplateCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11067 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11068 | uint64_t cgen_var_745 = (uint64_t)(uintptr_t)local_pAllocator; |
| 11069 | stream->putBe64(cgen_var_745); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11070 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11071 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11072 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11073 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11074 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11075 | uint64_t cgen_var_746; |
| 11076 | stream->handleMapping()->mapHandles_VkDescriptorUpdateTemplate_u64(pDescriptorUpdateTemplate, &cgen_var_746, 1); |
| 11077 | stream->write((uint64_t*)&cgen_var_746, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11078 | stream->setHandleMapping(resources->unwrapMapping()); |
| 11079 | stream->setHandleMapping(resources->createMapping()); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11080 | uint64_t cgen_var_747; |
| 11081 | stream->read((uint64_t*)&cgen_var_747, 8); |
| 11082 | stream->handleMapping()->mapHandles_u64_VkDescriptorUpdateTemplate(&cgen_var_747, (VkDescriptorUpdateTemplate*)pDescriptorUpdateTemplate, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11083 | stream->unsetHandleMapping(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11084 | VkResult vkCreateDescriptorUpdateTemplate_VkResult_return = (VkResult)0; |
| 11085 | stream->read(&vkCreateDescriptorUpdateTemplate_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 11086 | mImpl->resources()->on_vkCreateDescriptorUpdateTemplate(this, vkCreateDescriptorUpdateTemplate_VkResult_return, device, pCreateInfo, pAllocator, pDescriptorUpdateTemplate); |
| 11087 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11088 | countingStream->clearPool(); |
| 11089 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11090 | mImpl->log("finish vkCreateDescriptorUpdateTemplate");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11091 | return vkCreateDescriptorUpdateTemplate_VkResult_return; |
| 11092 | } |
| 11093 | |
| 11094 | void VkEncoder::vkDestroyDescriptorUpdateTemplate( |
| 11095 | VkDevice device, |
| 11096 | VkDescriptorUpdateTemplate descriptorUpdateTemplate, |
| 11097 | const VkAllocationCallbacks* pAllocator) |
| 11098 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 11099 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11100 | mImpl->log("start vkDestroyDescriptorUpdateTemplate"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11101 | auto stream = mImpl->stream(); |
| 11102 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11103 | auto resources = mImpl->resources(); |
| 11104 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11105 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11106 | VkDevice local_device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 11107 | VkDescriptorUpdateTemplate local_descriptorUpdateTemplate; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11108 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 11109 | local_device = device; |
| 11110 | local_descriptorUpdateTemplate = descriptorUpdateTemplate; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11111 | local_pAllocator = nullptr; |
| 11112 | if (pAllocator) |
| 11113 | { |
| 11114 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 11115 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 11116 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 11117 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 11118 | if (local_pAllocator) |
| 11119 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 11120 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 11121 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11122 | countingStream->rewind(); |
| 11123 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11124 | uint64_t cgen_var_748; |
| 11125 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_748, 1); |
| 11126 | countingStream->write((uint64_t*)&cgen_var_748, 1 * 8); |
| 11127 | uint64_t cgen_var_749; |
| 11128 | countingStream->handleMapping()->mapHandles_VkDescriptorUpdateTemplate_u64(&local_descriptorUpdateTemplate, &cgen_var_749, 1); |
| 11129 | countingStream->write((uint64_t*)&cgen_var_749, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11130 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11131 | uint64_t cgen_var_750 = (uint64_t)(uintptr_t)local_pAllocator; |
| 11132 | countingStream->putBe64(cgen_var_750); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11133 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11134 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11135 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11136 | } |
| 11137 | } |
| 11138 | uint32_t packetSize_vkDestroyDescriptorUpdateTemplate = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 11139 | countingStream->rewind(); |
| 11140 | uint32_t opcode_vkDestroyDescriptorUpdateTemplate = OP_vkDestroyDescriptorUpdateTemplate; |
| 11141 | stream->write(&opcode_vkDestroyDescriptorUpdateTemplate, sizeof(uint32_t)); |
| 11142 | stream->write(&packetSize_vkDestroyDescriptorUpdateTemplate, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11143 | uint64_t cgen_var_751; |
| 11144 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_751, 1); |
| 11145 | stream->write((uint64_t*)&cgen_var_751, 1 * 8); |
| 11146 | uint64_t cgen_var_752; |
| 11147 | stream->handleMapping()->mapHandles_VkDescriptorUpdateTemplate_u64(&local_descriptorUpdateTemplate, &cgen_var_752, 1); |
| 11148 | stream->write((uint64_t*)&cgen_var_752, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11149 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11150 | uint64_t cgen_var_753 = (uint64_t)(uintptr_t)local_pAllocator; |
| 11151 | stream->putBe64(cgen_var_753); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11152 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11153 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11154 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11155 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11156 | resources->destroyMapping()->mapHandles_VkDescriptorUpdateTemplate((VkDescriptorUpdateTemplate*)&descriptorUpdateTemplate); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 11157 | pool->freeAll(); |
| 11158 | countingStream->clearPool(); |
| 11159 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11160 | mImpl->log("finish vkDestroyDescriptorUpdateTemplate");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11161 | } |
| 11162 | |
| 11163 | void VkEncoder::vkUpdateDescriptorSetWithTemplate( |
| 11164 | VkDevice device, |
| 11165 | VkDescriptorSet descriptorSet, |
| 11166 | VkDescriptorUpdateTemplate descriptorUpdateTemplate, |
| 11167 | const void* pData) |
| 11168 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 11169 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11170 | mImpl->log("start vkUpdateDescriptorSetWithTemplate"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11171 | auto stream = mImpl->stream(); |
| 11172 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11173 | auto resources = mImpl->resources(); |
| 11174 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11175 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11176 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11177 | VkDescriptorSet local_descriptorSet; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11178 | VkDescriptorUpdateTemplate local_descriptorUpdateTemplate; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11179 | void* local_pData; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 11180 | local_device = device; |
| 11181 | local_descriptorSet = descriptorSet; |
| 11182 | local_descriptorUpdateTemplate = descriptorUpdateTemplate; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11183 | local_pData = nullptr; |
| 11184 | if (pData) |
| 11185 | { |
| 11186 | local_pData = (void*)pool->dupArray(pData, sizeof(const uint8_t)); |
| 11187 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11188 | countingStream->rewind(); |
| 11189 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11190 | uint64_t cgen_var_754; |
| 11191 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_754, 1); |
| 11192 | countingStream->write((uint64_t*)&cgen_var_754, 1 * 8); |
| 11193 | uint64_t cgen_var_755; |
| 11194 | countingStream->handleMapping()->mapHandles_VkDescriptorSet_u64(&local_descriptorSet, &cgen_var_755, 1); |
| 11195 | countingStream->write((uint64_t*)&cgen_var_755, 1 * 8); |
| 11196 | uint64_t cgen_var_756; |
| 11197 | countingStream->handleMapping()->mapHandles_VkDescriptorUpdateTemplate_u64(&local_descriptorUpdateTemplate, &cgen_var_756, 1); |
| 11198 | countingStream->write((uint64_t*)&cgen_var_756, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11199 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11200 | uint64_t cgen_var_757 = (uint64_t)(uintptr_t)local_pData; |
| 11201 | countingStream->putBe64(cgen_var_757); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11202 | if (local_pData) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11203 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11204 | countingStream->write((void*)local_pData, sizeof(uint8_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11205 | } |
| 11206 | } |
| 11207 | uint32_t packetSize_vkUpdateDescriptorSetWithTemplate = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 11208 | countingStream->rewind(); |
| 11209 | uint32_t opcode_vkUpdateDescriptorSetWithTemplate = OP_vkUpdateDescriptorSetWithTemplate; |
| 11210 | stream->write(&opcode_vkUpdateDescriptorSetWithTemplate, sizeof(uint32_t)); |
| 11211 | stream->write(&packetSize_vkUpdateDescriptorSetWithTemplate, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11212 | uint64_t cgen_var_758; |
| 11213 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_758, 1); |
| 11214 | stream->write((uint64_t*)&cgen_var_758, 1 * 8); |
| 11215 | uint64_t cgen_var_759; |
| 11216 | stream->handleMapping()->mapHandles_VkDescriptorSet_u64(&local_descriptorSet, &cgen_var_759, 1); |
| 11217 | stream->write((uint64_t*)&cgen_var_759, 1 * 8); |
| 11218 | uint64_t cgen_var_760; |
| 11219 | stream->handleMapping()->mapHandles_VkDescriptorUpdateTemplate_u64(&local_descriptorUpdateTemplate, &cgen_var_760, 1); |
| 11220 | stream->write((uint64_t*)&cgen_var_760, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11221 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11222 | uint64_t cgen_var_761 = (uint64_t)(uintptr_t)local_pData; |
| 11223 | stream->putBe64(cgen_var_761); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11224 | if (local_pData) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11225 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11226 | stream->write((void*)local_pData, sizeof(uint8_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11227 | } |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 11228 | pool->freeAll(); |
| 11229 | countingStream->clearPool(); |
| 11230 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11231 | mImpl->log("finish vkUpdateDescriptorSetWithTemplate");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11232 | } |
| 11233 | |
| 11234 | void VkEncoder::vkGetPhysicalDeviceExternalBufferProperties( |
| 11235 | VkPhysicalDevice physicalDevice, |
| 11236 | const VkPhysicalDeviceExternalBufferInfo* pExternalBufferInfo, |
| 11237 | VkExternalBufferProperties* pExternalBufferProperties) |
| 11238 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 11239 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11240 | mImpl->log("start vkGetPhysicalDeviceExternalBufferProperties"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11241 | auto stream = mImpl->stream(); |
| 11242 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11243 | auto resources = mImpl->resources(); |
| 11244 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11245 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11246 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11247 | VkPhysicalDeviceExternalBufferInfo* local_pExternalBufferInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 11248 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11249 | local_pExternalBufferInfo = nullptr; |
| 11250 | if (pExternalBufferInfo) |
| 11251 | { |
| 11252 | local_pExternalBufferInfo = (VkPhysicalDeviceExternalBufferInfo*)pool->alloc(sizeof(const VkPhysicalDeviceExternalBufferInfo)); |
| 11253 | deepcopy_VkPhysicalDeviceExternalBufferInfo(pool, pExternalBufferInfo, (VkPhysicalDeviceExternalBufferInfo*)(local_pExternalBufferInfo)); |
| 11254 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 11255 | if (local_pExternalBufferInfo) |
| 11256 | { |
| Lingfeng Yang | 2b1b8cf | 2019-02-08 09:53:36 -0800 | [diff] [blame] | 11257 | mImpl->resources()->transformImpl_VkPhysicalDeviceExternalBufferInfo_tohost(local_pExternalBufferInfo, 1); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 11258 | transform_tohost_VkPhysicalDeviceExternalBufferInfo(mImpl->resources(), (VkPhysicalDeviceExternalBufferInfo*)(local_pExternalBufferInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 11259 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11260 | countingStream->rewind(); |
| 11261 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11262 | uint64_t cgen_var_762; |
| 11263 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_762, 1); |
| 11264 | countingStream->write((uint64_t*)&cgen_var_762, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11265 | marshal_VkPhysicalDeviceExternalBufferInfo(countingStream, (VkPhysicalDeviceExternalBufferInfo*)(local_pExternalBufferInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11266 | marshal_VkExternalBufferProperties(countingStream, (VkExternalBufferProperties*)(pExternalBufferProperties)); |
| 11267 | } |
| 11268 | uint32_t packetSize_vkGetPhysicalDeviceExternalBufferProperties = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 11269 | countingStream->rewind(); |
| 11270 | uint32_t opcode_vkGetPhysicalDeviceExternalBufferProperties = OP_vkGetPhysicalDeviceExternalBufferProperties; |
| 11271 | stream->write(&opcode_vkGetPhysicalDeviceExternalBufferProperties, sizeof(uint32_t)); |
| 11272 | stream->write(&packetSize_vkGetPhysicalDeviceExternalBufferProperties, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11273 | uint64_t cgen_var_763; |
| 11274 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_763, 1); |
| 11275 | stream->write((uint64_t*)&cgen_var_763, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11276 | marshal_VkPhysicalDeviceExternalBufferInfo(stream, (VkPhysicalDeviceExternalBufferInfo*)(local_pExternalBufferInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11277 | marshal_VkExternalBufferProperties(stream, (VkExternalBufferProperties*)(pExternalBufferProperties)); |
| 11278 | unmarshal_VkExternalBufferProperties(stream, (VkExternalBufferProperties*)(pExternalBufferProperties)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 11279 | if (pExternalBufferProperties) |
| 11280 | { |
| Lingfeng Yang | 2b1b8cf | 2019-02-08 09:53:36 -0800 | [diff] [blame] | 11281 | mImpl->resources()->transformImpl_VkExternalBufferProperties_fromhost(pExternalBufferProperties, 1); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 11282 | transform_fromhost_VkExternalBufferProperties(mImpl->resources(), (VkExternalBufferProperties*)(pExternalBufferProperties)); |
| 11283 | } |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 11284 | pool->freeAll(); |
| 11285 | countingStream->clearPool(); |
| 11286 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11287 | mImpl->log("finish vkGetPhysicalDeviceExternalBufferProperties");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11288 | } |
| 11289 | |
| 11290 | void VkEncoder::vkGetPhysicalDeviceExternalFenceProperties( |
| 11291 | VkPhysicalDevice physicalDevice, |
| 11292 | const VkPhysicalDeviceExternalFenceInfo* pExternalFenceInfo, |
| 11293 | VkExternalFenceProperties* pExternalFenceProperties) |
| 11294 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 11295 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11296 | mImpl->log("start vkGetPhysicalDeviceExternalFenceProperties"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11297 | auto stream = mImpl->stream(); |
| 11298 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11299 | auto resources = mImpl->resources(); |
| 11300 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11301 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11302 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11303 | VkPhysicalDeviceExternalFenceInfo* local_pExternalFenceInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 11304 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11305 | local_pExternalFenceInfo = nullptr; |
| 11306 | if (pExternalFenceInfo) |
| 11307 | { |
| 11308 | local_pExternalFenceInfo = (VkPhysicalDeviceExternalFenceInfo*)pool->alloc(sizeof(const VkPhysicalDeviceExternalFenceInfo)); |
| 11309 | deepcopy_VkPhysicalDeviceExternalFenceInfo(pool, pExternalFenceInfo, (VkPhysicalDeviceExternalFenceInfo*)(local_pExternalFenceInfo)); |
| 11310 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 11311 | if (local_pExternalFenceInfo) |
| 11312 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 11313 | transform_tohost_VkPhysicalDeviceExternalFenceInfo(mImpl->resources(), (VkPhysicalDeviceExternalFenceInfo*)(local_pExternalFenceInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 11314 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11315 | countingStream->rewind(); |
| 11316 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11317 | uint64_t cgen_var_764; |
| 11318 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_764, 1); |
| 11319 | countingStream->write((uint64_t*)&cgen_var_764, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11320 | marshal_VkPhysicalDeviceExternalFenceInfo(countingStream, (VkPhysicalDeviceExternalFenceInfo*)(local_pExternalFenceInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11321 | marshal_VkExternalFenceProperties(countingStream, (VkExternalFenceProperties*)(pExternalFenceProperties)); |
| 11322 | } |
| 11323 | uint32_t packetSize_vkGetPhysicalDeviceExternalFenceProperties = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 11324 | countingStream->rewind(); |
| 11325 | uint32_t opcode_vkGetPhysicalDeviceExternalFenceProperties = OP_vkGetPhysicalDeviceExternalFenceProperties; |
| 11326 | stream->write(&opcode_vkGetPhysicalDeviceExternalFenceProperties, sizeof(uint32_t)); |
| 11327 | stream->write(&packetSize_vkGetPhysicalDeviceExternalFenceProperties, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11328 | uint64_t cgen_var_765; |
| 11329 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_765, 1); |
| 11330 | stream->write((uint64_t*)&cgen_var_765, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11331 | marshal_VkPhysicalDeviceExternalFenceInfo(stream, (VkPhysicalDeviceExternalFenceInfo*)(local_pExternalFenceInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11332 | marshal_VkExternalFenceProperties(stream, (VkExternalFenceProperties*)(pExternalFenceProperties)); |
| 11333 | unmarshal_VkExternalFenceProperties(stream, (VkExternalFenceProperties*)(pExternalFenceProperties)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 11334 | if (pExternalFenceProperties) |
| 11335 | { |
| 11336 | transform_fromhost_VkExternalFenceProperties(mImpl->resources(), (VkExternalFenceProperties*)(pExternalFenceProperties)); |
| 11337 | } |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 11338 | pool->freeAll(); |
| 11339 | countingStream->clearPool(); |
| 11340 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11341 | mImpl->log("finish vkGetPhysicalDeviceExternalFenceProperties");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11342 | } |
| 11343 | |
| 11344 | void VkEncoder::vkGetPhysicalDeviceExternalSemaphoreProperties( |
| 11345 | VkPhysicalDevice physicalDevice, |
| 11346 | const VkPhysicalDeviceExternalSemaphoreInfo* pExternalSemaphoreInfo, |
| 11347 | VkExternalSemaphoreProperties* pExternalSemaphoreProperties) |
| 11348 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 11349 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11350 | mImpl->log("start vkGetPhysicalDeviceExternalSemaphoreProperties"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11351 | auto stream = mImpl->stream(); |
| 11352 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11353 | auto resources = mImpl->resources(); |
| 11354 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11355 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11356 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11357 | VkPhysicalDeviceExternalSemaphoreInfo* local_pExternalSemaphoreInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 11358 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11359 | local_pExternalSemaphoreInfo = nullptr; |
| 11360 | if (pExternalSemaphoreInfo) |
| 11361 | { |
| 11362 | local_pExternalSemaphoreInfo = (VkPhysicalDeviceExternalSemaphoreInfo*)pool->alloc(sizeof(const VkPhysicalDeviceExternalSemaphoreInfo)); |
| 11363 | deepcopy_VkPhysicalDeviceExternalSemaphoreInfo(pool, pExternalSemaphoreInfo, (VkPhysicalDeviceExternalSemaphoreInfo*)(local_pExternalSemaphoreInfo)); |
| 11364 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 11365 | if (local_pExternalSemaphoreInfo) |
| 11366 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 11367 | transform_tohost_VkPhysicalDeviceExternalSemaphoreInfo(mImpl->resources(), (VkPhysicalDeviceExternalSemaphoreInfo*)(local_pExternalSemaphoreInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 11368 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11369 | countingStream->rewind(); |
| 11370 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11371 | uint64_t cgen_var_766; |
| 11372 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_766, 1); |
| 11373 | countingStream->write((uint64_t*)&cgen_var_766, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11374 | marshal_VkPhysicalDeviceExternalSemaphoreInfo(countingStream, (VkPhysicalDeviceExternalSemaphoreInfo*)(local_pExternalSemaphoreInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11375 | marshal_VkExternalSemaphoreProperties(countingStream, (VkExternalSemaphoreProperties*)(pExternalSemaphoreProperties)); |
| 11376 | } |
| 11377 | uint32_t packetSize_vkGetPhysicalDeviceExternalSemaphoreProperties = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 11378 | countingStream->rewind(); |
| 11379 | uint32_t opcode_vkGetPhysicalDeviceExternalSemaphoreProperties = OP_vkGetPhysicalDeviceExternalSemaphoreProperties; |
| 11380 | stream->write(&opcode_vkGetPhysicalDeviceExternalSemaphoreProperties, sizeof(uint32_t)); |
| 11381 | stream->write(&packetSize_vkGetPhysicalDeviceExternalSemaphoreProperties, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11382 | uint64_t cgen_var_767; |
| 11383 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_767, 1); |
| 11384 | stream->write((uint64_t*)&cgen_var_767, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11385 | marshal_VkPhysicalDeviceExternalSemaphoreInfo(stream, (VkPhysicalDeviceExternalSemaphoreInfo*)(local_pExternalSemaphoreInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11386 | marshal_VkExternalSemaphoreProperties(stream, (VkExternalSemaphoreProperties*)(pExternalSemaphoreProperties)); |
| 11387 | unmarshal_VkExternalSemaphoreProperties(stream, (VkExternalSemaphoreProperties*)(pExternalSemaphoreProperties)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 11388 | if (pExternalSemaphoreProperties) |
| 11389 | { |
| 11390 | transform_fromhost_VkExternalSemaphoreProperties(mImpl->resources(), (VkExternalSemaphoreProperties*)(pExternalSemaphoreProperties)); |
| 11391 | } |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 11392 | pool->freeAll(); |
| 11393 | countingStream->clearPool(); |
| 11394 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11395 | mImpl->log("finish vkGetPhysicalDeviceExternalSemaphoreProperties");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11396 | } |
| 11397 | |
| 11398 | void VkEncoder::vkGetDescriptorSetLayoutSupport( |
| 11399 | VkDevice device, |
| 11400 | const VkDescriptorSetLayoutCreateInfo* pCreateInfo, |
| 11401 | VkDescriptorSetLayoutSupport* pSupport) |
| 11402 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 11403 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11404 | mImpl->log("start vkGetDescriptorSetLayoutSupport"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11405 | auto stream = mImpl->stream(); |
| 11406 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11407 | auto resources = mImpl->resources(); |
| 11408 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11409 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11410 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11411 | VkDescriptorSetLayoutCreateInfo* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 11412 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11413 | local_pCreateInfo = nullptr; |
| 11414 | if (pCreateInfo) |
| 11415 | { |
| 11416 | local_pCreateInfo = (VkDescriptorSetLayoutCreateInfo*)pool->alloc(sizeof(const VkDescriptorSetLayoutCreateInfo)); |
| 11417 | deepcopy_VkDescriptorSetLayoutCreateInfo(pool, pCreateInfo, (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo)); |
| 11418 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 11419 | if (local_pCreateInfo) |
| 11420 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 11421 | transform_tohost_VkDescriptorSetLayoutCreateInfo(mImpl->resources(), (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 11422 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11423 | countingStream->rewind(); |
| 11424 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11425 | uint64_t cgen_var_768; |
| 11426 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_768, 1); |
| 11427 | countingStream->write((uint64_t*)&cgen_var_768, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11428 | marshal_VkDescriptorSetLayoutCreateInfo(countingStream, (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11429 | marshal_VkDescriptorSetLayoutSupport(countingStream, (VkDescriptorSetLayoutSupport*)(pSupport)); |
| 11430 | } |
| 11431 | uint32_t packetSize_vkGetDescriptorSetLayoutSupport = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 11432 | countingStream->rewind(); |
| 11433 | uint32_t opcode_vkGetDescriptorSetLayoutSupport = OP_vkGetDescriptorSetLayoutSupport; |
| 11434 | stream->write(&opcode_vkGetDescriptorSetLayoutSupport, sizeof(uint32_t)); |
| 11435 | stream->write(&packetSize_vkGetDescriptorSetLayoutSupport, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11436 | uint64_t cgen_var_769; |
| 11437 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_769, 1); |
| 11438 | stream->write((uint64_t*)&cgen_var_769, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11439 | marshal_VkDescriptorSetLayoutCreateInfo(stream, (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11440 | marshal_VkDescriptorSetLayoutSupport(stream, (VkDescriptorSetLayoutSupport*)(pSupport)); |
| 11441 | unmarshal_VkDescriptorSetLayoutSupport(stream, (VkDescriptorSetLayoutSupport*)(pSupport)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 11442 | if (pSupport) |
| 11443 | { |
| 11444 | transform_fromhost_VkDescriptorSetLayoutSupport(mImpl->resources(), (VkDescriptorSetLayoutSupport*)(pSupport)); |
| 11445 | } |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 11446 | pool->freeAll(); |
| 11447 | countingStream->clearPool(); |
| 11448 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11449 | mImpl->log("finish vkGetDescriptorSetLayoutSupport");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11450 | } |
| 11451 | |
| 11452 | #endif |
| 11453 | #ifdef VK_KHR_surface |
| 11454 | void VkEncoder::vkDestroySurfaceKHR( |
| 11455 | VkInstance instance, |
| 11456 | VkSurfaceKHR surface, |
| 11457 | const VkAllocationCallbacks* pAllocator) |
| 11458 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 11459 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11460 | mImpl->log("start vkDestroySurfaceKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11461 | auto stream = mImpl->stream(); |
| 11462 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11463 | auto resources = mImpl->resources(); |
| 11464 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11465 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11466 | VkInstance local_instance; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 11467 | VkSurfaceKHR local_surface; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11468 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 11469 | local_instance = instance; |
| 11470 | local_surface = surface; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11471 | local_pAllocator = nullptr; |
| 11472 | if (pAllocator) |
| 11473 | { |
| 11474 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 11475 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 11476 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 11477 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 11478 | if (local_pAllocator) |
| 11479 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 11480 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 11481 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11482 | countingStream->rewind(); |
| 11483 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11484 | uint64_t cgen_var_770; |
| 11485 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_770, 1); |
| 11486 | countingStream->write((uint64_t*)&cgen_var_770, 1 * 8); |
| 11487 | uint64_t cgen_var_771; |
| 11488 | countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(&local_surface, &cgen_var_771, 1); |
| 11489 | countingStream->write((uint64_t*)&cgen_var_771, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11490 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11491 | uint64_t cgen_var_772 = (uint64_t)(uintptr_t)local_pAllocator; |
| 11492 | countingStream->putBe64(cgen_var_772); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11493 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11494 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11495 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11496 | } |
| 11497 | } |
| 11498 | uint32_t packetSize_vkDestroySurfaceKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 11499 | countingStream->rewind(); |
| 11500 | uint32_t opcode_vkDestroySurfaceKHR = OP_vkDestroySurfaceKHR; |
| 11501 | stream->write(&opcode_vkDestroySurfaceKHR, sizeof(uint32_t)); |
| 11502 | stream->write(&packetSize_vkDestroySurfaceKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11503 | uint64_t cgen_var_773; |
| 11504 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_773, 1); |
| 11505 | stream->write((uint64_t*)&cgen_var_773, 1 * 8); |
| 11506 | uint64_t cgen_var_774; |
| 11507 | stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(&local_surface, &cgen_var_774, 1); |
| 11508 | stream->write((uint64_t*)&cgen_var_774, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11509 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11510 | uint64_t cgen_var_775 = (uint64_t)(uintptr_t)local_pAllocator; |
| 11511 | stream->putBe64(cgen_var_775); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11512 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11513 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11514 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11515 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11516 | resources->destroyMapping()->mapHandles_VkSurfaceKHR((VkSurfaceKHR*)&surface); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 11517 | pool->freeAll(); |
| 11518 | countingStream->clearPool(); |
| 11519 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11520 | mImpl->log("finish vkDestroySurfaceKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11521 | } |
| 11522 | |
| 11523 | VkResult VkEncoder::vkGetPhysicalDeviceSurfaceSupportKHR( |
| 11524 | VkPhysicalDevice physicalDevice, |
| 11525 | uint32_t queueFamilyIndex, |
| 11526 | VkSurfaceKHR surface, |
| 11527 | VkBool32* pSupported) |
| 11528 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 11529 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11530 | mImpl->log("start vkGetPhysicalDeviceSurfaceSupportKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11531 | auto stream = mImpl->stream(); |
| 11532 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11533 | auto resources = mImpl->resources(); |
| 11534 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11535 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11536 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11537 | uint32_t local_queueFamilyIndex; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11538 | VkSurfaceKHR local_surface; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 11539 | local_physicalDevice = physicalDevice; |
| 11540 | local_queueFamilyIndex = queueFamilyIndex; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11541 | local_surface = surface; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11542 | countingStream->rewind(); |
| 11543 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11544 | uint64_t cgen_var_776; |
| 11545 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_776, 1); |
| 11546 | countingStream->write((uint64_t*)&cgen_var_776, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11547 | countingStream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11548 | uint64_t cgen_var_777; |
| 11549 | countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(&local_surface, &cgen_var_777, 1); |
| 11550 | countingStream->write((uint64_t*)&cgen_var_777, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11551 | countingStream->write((VkBool32*)pSupported, sizeof(VkBool32)); |
| 11552 | } |
| 11553 | uint32_t packetSize_vkGetPhysicalDeviceSurfaceSupportKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 11554 | countingStream->rewind(); |
| 11555 | uint32_t opcode_vkGetPhysicalDeviceSurfaceSupportKHR = OP_vkGetPhysicalDeviceSurfaceSupportKHR; |
| 11556 | stream->write(&opcode_vkGetPhysicalDeviceSurfaceSupportKHR, sizeof(uint32_t)); |
| 11557 | stream->write(&packetSize_vkGetPhysicalDeviceSurfaceSupportKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11558 | uint64_t cgen_var_778; |
| 11559 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_778, 1); |
| 11560 | stream->write((uint64_t*)&cgen_var_778, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11561 | stream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11562 | uint64_t cgen_var_779; |
| 11563 | stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(&local_surface, &cgen_var_779, 1); |
| 11564 | stream->write((uint64_t*)&cgen_var_779, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11565 | stream->write((VkBool32*)pSupported, sizeof(VkBool32)); |
| 11566 | stream->read((VkBool32*)pSupported, sizeof(VkBool32)); |
| 11567 | VkResult vkGetPhysicalDeviceSurfaceSupportKHR_VkResult_return = (VkResult)0; |
| 11568 | stream->read(&vkGetPhysicalDeviceSurfaceSupportKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 11569 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11570 | countingStream->clearPool(); |
| 11571 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11572 | mImpl->log("finish vkGetPhysicalDeviceSurfaceSupportKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11573 | return vkGetPhysicalDeviceSurfaceSupportKHR_VkResult_return; |
| 11574 | } |
| 11575 | |
| 11576 | VkResult VkEncoder::vkGetPhysicalDeviceSurfaceCapabilitiesKHR( |
| 11577 | VkPhysicalDevice physicalDevice, |
| 11578 | VkSurfaceKHR surface, |
| 11579 | VkSurfaceCapabilitiesKHR* pSurfaceCapabilities) |
| 11580 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 11581 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11582 | mImpl->log("start vkGetPhysicalDeviceSurfaceCapabilitiesKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11583 | auto stream = mImpl->stream(); |
| 11584 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11585 | auto resources = mImpl->resources(); |
| 11586 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11587 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11588 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11589 | VkSurfaceKHR local_surface; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 11590 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11591 | local_surface = surface; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11592 | countingStream->rewind(); |
| 11593 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11594 | uint64_t cgen_var_780; |
| 11595 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_780, 1); |
| 11596 | countingStream->write((uint64_t*)&cgen_var_780, 1 * 8); |
| 11597 | uint64_t cgen_var_781; |
| 11598 | countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(&local_surface, &cgen_var_781, 1); |
| 11599 | countingStream->write((uint64_t*)&cgen_var_781, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11600 | marshal_VkSurfaceCapabilitiesKHR(countingStream, (VkSurfaceCapabilitiesKHR*)(pSurfaceCapabilities)); |
| 11601 | } |
| 11602 | uint32_t packetSize_vkGetPhysicalDeviceSurfaceCapabilitiesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 11603 | countingStream->rewind(); |
| 11604 | uint32_t opcode_vkGetPhysicalDeviceSurfaceCapabilitiesKHR = OP_vkGetPhysicalDeviceSurfaceCapabilitiesKHR; |
| 11605 | stream->write(&opcode_vkGetPhysicalDeviceSurfaceCapabilitiesKHR, sizeof(uint32_t)); |
| 11606 | stream->write(&packetSize_vkGetPhysicalDeviceSurfaceCapabilitiesKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11607 | uint64_t cgen_var_782; |
| 11608 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_782, 1); |
| 11609 | stream->write((uint64_t*)&cgen_var_782, 1 * 8); |
| 11610 | uint64_t cgen_var_783; |
| 11611 | stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(&local_surface, &cgen_var_783, 1); |
| 11612 | stream->write((uint64_t*)&cgen_var_783, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11613 | marshal_VkSurfaceCapabilitiesKHR(stream, (VkSurfaceCapabilitiesKHR*)(pSurfaceCapabilities)); |
| 11614 | unmarshal_VkSurfaceCapabilitiesKHR(stream, (VkSurfaceCapabilitiesKHR*)(pSurfaceCapabilities)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 11615 | if (pSurfaceCapabilities) |
| 11616 | { |
| 11617 | transform_fromhost_VkSurfaceCapabilitiesKHR(mImpl->resources(), (VkSurfaceCapabilitiesKHR*)(pSurfaceCapabilities)); |
| 11618 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11619 | VkResult vkGetPhysicalDeviceSurfaceCapabilitiesKHR_VkResult_return = (VkResult)0; |
| 11620 | stream->read(&vkGetPhysicalDeviceSurfaceCapabilitiesKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 11621 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11622 | countingStream->clearPool(); |
| 11623 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11624 | mImpl->log("finish vkGetPhysicalDeviceSurfaceCapabilitiesKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11625 | return vkGetPhysicalDeviceSurfaceCapabilitiesKHR_VkResult_return; |
| 11626 | } |
| 11627 | |
| 11628 | VkResult VkEncoder::vkGetPhysicalDeviceSurfaceFormatsKHR( |
| 11629 | VkPhysicalDevice physicalDevice, |
| 11630 | VkSurfaceKHR surface, |
| 11631 | uint32_t* pSurfaceFormatCount, |
| 11632 | VkSurfaceFormatKHR* pSurfaceFormats) |
| 11633 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 11634 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11635 | mImpl->log("start vkGetPhysicalDeviceSurfaceFormatsKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11636 | auto stream = mImpl->stream(); |
| 11637 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11638 | auto resources = mImpl->resources(); |
| 11639 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11640 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11641 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11642 | VkSurfaceKHR local_surface; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 11643 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11644 | local_surface = surface; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11645 | countingStream->rewind(); |
| 11646 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11647 | uint64_t cgen_var_784; |
| 11648 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_784, 1); |
| 11649 | countingStream->write((uint64_t*)&cgen_var_784, 1 * 8); |
| 11650 | uint64_t cgen_var_785; |
| 11651 | countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(&local_surface, &cgen_var_785, 1); |
| 11652 | countingStream->write((uint64_t*)&cgen_var_785, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11653 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11654 | uint64_t cgen_var_786 = (uint64_t)(uintptr_t)pSurfaceFormatCount; |
| 11655 | countingStream->putBe64(cgen_var_786); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11656 | if (pSurfaceFormatCount) |
| 11657 | { |
| 11658 | countingStream->write((uint32_t*)pSurfaceFormatCount, sizeof(uint32_t)); |
| 11659 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11660 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11661 | uint64_t cgen_var_787 = (uint64_t)(uintptr_t)pSurfaceFormats; |
| 11662 | countingStream->putBe64(cgen_var_787); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11663 | if (pSurfaceFormats) |
| 11664 | { |
| 11665 | for (uint32_t i = 0; i < (uint32_t)(*(pSurfaceFormatCount)); ++i) |
| 11666 | { |
| 11667 | marshal_VkSurfaceFormatKHR(countingStream, (VkSurfaceFormatKHR*)(pSurfaceFormats + i)); |
| 11668 | } |
| 11669 | } |
| 11670 | } |
| 11671 | uint32_t packetSize_vkGetPhysicalDeviceSurfaceFormatsKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 11672 | countingStream->rewind(); |
| 11673 | uint32_t opcode_vkGetPhysicalDeviceSurfaceFormatsKHR = OP_vkGetPhysicalDeviceSurfaceFormatsKHR; |
| 11674 | stream->write(&opcode_vkGetPhysicalDeviceSurfaceFormatsKHR, sizeof(uint32_t)); |
| 11675 | stream->write(&packetSize_vkGetPhysicalDeviceSurfaceFormatsKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11676 | uint64_t cgen_var_788; |
| 11677 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_788, 1); |
| 11678 | stream->write((uint64_t*)&cgen_var_788, 1 * 8); |
| 11679 | uint64_t cgen_var_789; |
| 11680 | stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(&local_surface, &cgen_var_789, 1); |
| 11681 | stream->write((uint64_t*)&cgen_var_789, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11682 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11683 | uint64_t cgen_var_790 = (uint64_t)(uintptr_t)pSurfaceFormatCount; |
| 11684 | stream->putBe64(cgen_var_790); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11685 | if (pSurfaceFormatCount) |
| 11686 | { |
| 11687 | stream->write((uint32_t*)pSurfaceFormatCount, sizeof(uint32_t)); |
| 11688 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11689 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11690 | uint64_t cgen_var_791 = (uint64_t)(uintptr_t)pSurfaceFormats; |
| 11691 | stream->putBe64(cgen_var_791); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11692 | if (pSurfaceFormats) |
| 11693 | { |
| 11694 | for (uint32_t i = 0; i < (uint32_t)(*(pSurfaceFormatCount)); ++i) |
| 11695 | { |
| 11696 | marshal_VkSurfaceFormatKHR(stream, (VkSurfaceFormatKHR*)(pSurfaceFormats + i)); |
| 11697 | } |
| 11698 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11699 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11700 | uint32_t* check_pSurfaceFormatCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11701 | check_pSurfaceFormatCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11702 | if (pSurfaceFormatCount) |
| 11703 | { |
| 11704 | if (!(check_pSurfaceFormatCount)) |
| 11705 | { |
| 11706 | fprintf(stderr, "fatal: pSurfaceFormatCount inconsistent between guest and host\n"); |
| 11707 | } |
| 11708 | stream->read((uint32_t*)pSurfaceFormatCount, sizeof(uint32_t)); |
| 11709 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11710 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11711 | VkSurfaceFormatKHR* check_pSurfaceFormats; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11712 | check_pSurfaceFormats = (VkSurfaceFormatKHR*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11713 | if (pSurfaceFormats) |
| 11714 | { |
| 11715 | if (!(check_pSurfaceFormats)) |
| 11716 | { |
| 11717 | fprintf(stderr, "fatal: pSurfaceFormats inconsistent between guest and host\n"); |
| 11718 | } |
| 11719 | for (uint32_t i = 0; i < (uint32_t)(*(pSurfaceFormatCount)); ++i) |
| 11720 | { |
| 11721 | unmarshal_VkSurfaceFormatKHR(stream, (VkSurfaceFormatKHR*)(pSurfaceFormats + i)); |
| 11722 | } |
| 11723 | } |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 11724 | if (pSurfaceFormats) |
| 11725 | { |
| 11726 | for (uint32_t i = 0; i < (uint32_t)(*(pSurfaceFormatCount)); ++i) |
| 11727 | { |
| 11728 | transform_fromhost_VkSurfaceFormatKHR(mImpl->resources(), (VkSurfaceFormatKHR*)(pSurfaceFormats + i)); |
| 11729 | } |
| 11730 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11731 | VkResult vkGetPhysicalDeviceSurfaceFormatsKHR_VkResult_return = (VkResult)0; |
| 11732 | stream->read(&vkGetPhysicalDeviceSurfaceFormatsKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 11733 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11734 | countingStream->clearPool(); |
| 11735 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11736 | mImpl->log("finish vkGetPhysicalDeviceSurfaceFormatsKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11737 | return vkGetPhysicalDeviceSurfaceFormatsKHR_VkResult_return; |
| 11738 | } |
| 11739 | |
| 11740 | VkResult VkEncoder::vkGetPhysicalDeviceSurfacePresentModesKHR( |
| 11741 | VkPhysicalDevice physicalDevice, |
| 11742 | VkSurfaceKHR surface, |
| 11743 | uint32_t* pPresentModeCount, |
| 11744 | VkPresentModeKHR* pPresentModes) |
| 11745 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 11746 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11747 | mImpl->log("start vkGetPhysicalDeviceSurfacePresentModesKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11748 | auto stream = mImpl->stream(); |
| 11749 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11750 | auto resources = mImpl->resources(); |
| 11751 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11752 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11753 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11754 | VkSurfaceKHR local_surface; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 11755 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11756 | local_surface = surface; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11757 | countingStream->rewind(); |
| 11758 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11759 | uint64_t cgen_var_794; |
| 11760 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_794, 1); |
| 11761 | countingStream->write((uint64_t*)&cgen_var_794, 1 * 8); |
| 11762 | uint64_t cgen_var_795; |
| 11763 | countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(&local_surface, &cgen_var_795, 1); |
| 11764 | countingStream->write((uint64_t*)&cgen_var_795, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11765 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11766 | uint64_t cgen_var_796 = (uint64_t)(uintptr_t)pPresentModeCount; |
| 11767 | countingStream->putBe64(cgen_var_796); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11768 | if (pPresentModeCount) |
| 11769 | { |
| 11770 | countingStream->write((uint32_t*)pPresentModeCount, sizeof(uint32_t)); |
| 11771 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11772 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11773 | uint64_t cgen_var_797 = (uint64_t)(uintptr_t)pPresentModes; |
| 11774 | countingStream->putBe64(cgen_var_797); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11775 | if (pPresentModes) |
| 11776 | { |
| 11777 | countingStream->write((VkPresentModeKHR*)pPresentModes, (*(pPresentModeCount)) * sizeof(VkPresentModeKHR)); |
| 11778 | } |
| 11779 | } |
| 11780 | uint32_t packetSize_vkGetPhysicalDeviceSurfacePresentModesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 11781 | countingStream->rewind(); |
| 11782 | uint32_t opcode_vkGetPhysicalDeviceSurfacePresentModesKHR = OP_vkGetPhysicalDeviceSurfacePresentModesKHR; |
| 11783 | stream->write(&opcode_vkGetPhysicalDeviceSurfacePresentModesKHR, sizeof(uint32_t)); |
| 11784 | stream->write(&packetSize_vkGetPhysicalDeviceSurfacePresentModesKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11785 | uint64_t cgen_var_798; |
| 11786 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_798, 1); |
| 11787 | stream->write((uint64_t*)&cgen_var_798, 1 * 8); |
| 11788 | uint64_t cgen_var_799; |
| 11789 | stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(&local_surface, &cgen_var_799, 1); |
| 11790 | stream->write((uint64_t*)&cgen_var_799, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11791 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11792 | uint64_t cgen_var_800 = (uint64_t)(uintptr_t)pPresentModeCount; |
| 11793 | stream->putBe64(cgen_var_800); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11794 | if (pPresentModeCount) |
| 11795 | { |
| 11796 | stream->write((uint32_t*)pPresentModeCount, sizeof(uint32_t)); |
| 11797 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11798 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11799 | uint64_t cgen_var_801 = (uint64_t)(uintptr_t)pPresentModes; |
| 11800 | stream->putBe64(cgen_var_801); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11801 | if (pPresentModes) |
| 11802 | { |
| 11803 | stream->write((VkPresentModeKHR*)pPresentModes, (*(pPresentModeCount)) * sizeof(VkPresentModeKHR)); |
| 11804 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11805 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11806 | uint32_t* check_pPresentModeCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11807 | check_pPresentModeCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11808 | if (pPresentModeCount) |
| 11809 | { |
| 11810 | if (!(check_pPresentModeCount)) |
| 11811 | { |
| 11812 | fprintf(stderr, "fatal: pPresentModeCount inconsistent between guest and host\n"); |
| 11813 | } |
| 11814 | stream->read((uint32_t*)pPresentModeCount, sizeof(uint32_t)); |
| 11815 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11816 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11817 | VkPresentModeKHR* check_pPresentModes; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11818 | check_pPresentModes = (VkPresentModeKHR*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11819 | if (pPresentModes) |
| 11820 | { |
| 11821 | if (!(check_pPresentModes)) |
| 11822 | { |
| 11823 | fprintf(stderr, "fatal: pPresentModes inconsistent between guest and host\n"); |
| 11824 | } |
| 11825 | stream->read((VkPresentModeKHR*)pPresentModes, (*(pPresentModeCount)) * sizeof(VkPresentModeKHR)); |
| 11826 | } |
| 11827 | VkResult vkGetPhysicalDeviceSurfacePresentModesKHR_VkResult_return = (VkResult)0; |
| 11828 | stream->read(&vkGetPhysicalDeviceSurfacePresentModesKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 11829 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11830 | countingStream->clearPool(); |
| 11831 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11832 | mImpl->log("finish vkGetPhysicalDeviceSurfacePresentModesKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11833 | return vkGetPhysicalDeviceSurfacePresentModesKHR_VkResult_return; |
| 11834 | } |
| 11835 | |
| 11836 | #endif |
| 11837 | #ifdef VK_KHR_swapchain |
| 11838 | VkResult VkEncoder::vkCreateSwapchainKHR( |
| 11839 | VkDevice device, |
| 11840 | const VkSwapchainCreateInfoKHR* pCreateInfo, |
| 11841 | const VkAllocationCallbacks* pAllocator, |
| 11842 | VkSwapchainKHR* pSwapchain) |
| 11843 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 11844 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11845 | mImpl->log("start vkCreateSwapchainKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11846 | auto stream = mImpl->stream(); |
| 11847 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11848 | auto resources = mImpl->resources(); |
| 11849 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11850 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11851 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11852 | VkSwapchainCreateInfoKHR* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 11853 | VkAllocationCallbacks* local_pAllocator; |
| 11854 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11855 | local_pCreateInfo = nullptr; |
| 11856 | if (pCreateInfo) |
| 11857 | { |
| 11858 | local_pCreateInfo = (VkSwapchainCreateInfoKHR*)pool->alloc(sizeof(const VkSwapchainCreateInfoKHR)); |
| 11859 | deepcopy_VkSwapchainCreateInfoKHR(pool, pCreateInfo, (VkSwapchainCreateInfoKHR*)(local_pCreateInfo)); |
| 11860 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11861 | local_pAllocator = nullptr; |
| 11862 | if (pAllocator) |
| 11863 | { |
| 11864 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 11865 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 11866 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 11867 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 11868 | if (local_pCreateInfo) |
| 11869 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 11870 | transform_tohost_VkSwapchainCreateInfoKHR(mImpl->resources(), (VkSwapchainCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 11871 | } |
| 11872 | if (local_pAllocator) |
| 11873 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 11874 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 11875 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11876 | countingStream->rewind(); |
| 11877 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11878 | uint64_t cgen_var_804; |
| 11879 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_804, 1); |
| 11880 | countingStream->write((uint64_t*)&cgen_var_804, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11881 | marshal_VkSwapchainCreateInfoKHR(countingStream, (VkSwapchainCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11882 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11883 | uint64_t cgen_var_805 = (uint64_t)(uintptr_t)local_pAllocator; |
| 11884 | countingStream->putBe64(cgen_var_805); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11885 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11886 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11887 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11888 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11889 | uint64_t cgen_var_806; |
| 11890 | countingStream->handleMapping()->mapHandles_VkSwapchainKHR_u64(pSwapchain, &cgen_var_806, 1); |
| 11891 | countingStream->write((uint64_t*)&cgen_var_806, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11892 | } |
| 11893 | uint32_t packetSize_vkCreateSwapchainKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 11894 | countingStream->rewind(); |
| 11895 | uint32_t opcode_vkCreateSwapchainKHR = OP_vkCreateSwapchainKHR; |
| 11896 | stream->write(&opcode_vkCreateSwapchainKHR, sizeof(uint32_t)); |
| 11897 | stream->write(&packetSize_vkCreateSwapchainKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11898 | uint64_t cgen_var_807; |
| 11899 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_807, 1); |
| 11900 | stream->write((uint64_t*)&cgen_var_807, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11901 | marshal_VkSwapchainCreateInfoKHR(stream, (VkSwapchainCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11902 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11903 | uint64_t cgen_var_808 = (uint64_t)(uintptr_t)local_pAllocator; |
| 11904 | stream->putBe64(cgen_var_808); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11905 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11906 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11907 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11908 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11909 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11910 | uint64_t cgen_var_809; |
| 11911 | stream->handleMapping()->mapHandles_VkSwapchainKHR_u64(pSwapchain, &cgen_var_809, 1); |
| 11912 | stream->write((uint64_t*)&cgen_var_809, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11913 | stream->setHandleMapping(resources->unwrapMapping()); |
| 11914 | stream->setHandleMapping(resources->createMapping()); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11915 | uint64_t cgen_var_810; |
| 11916 | stream->read((uint64_t*)&cgen_var_810, 8); |
| 11917 | stream->handleMapping()->mapHandles_u64_VkSwapchainKHR(&cgen_var_810, (VkSwapchainKHR*)pSwapchain, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11918 | stream->unsetHandleMapping(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11919 | VkResult vkCreateSwapchainKHR_VkResult_return = (VkResult)0; |
| 11920 | stream->read(&vkCreateSwapchainKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 11921 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 11922 | countingStream->clearPool(); |
| 11923 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11924 | mImpl->log("finish vkCreateSwapchainKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11925 | return vkCreateSwapchainKHR_VkResult_return; |
| 11926 | } |
| 11927 | |
| 11928 | void VkEncoder::vkDestroySwapchainKHR( |
| 11929 | VkDevice device, |
| 11930 | VkSwapchainKHR swapchain, |
| 11931 | const VkAllocationCallbacks* pAllocator) |
| 11932 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 11933 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11934 | mImpl->log("start vkDestroySwapchainKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11935 | auto stream = mImpl->stream(); |
| 11936 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11937 | auto resources = mImpl->resources(); |
| 11938 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 11939 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11940 | VkDevice local_device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 11941 | VkSwapchainKHR local_swapchain; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11942 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 11943 | local_device = device; |
| 11944 | local_swapchain = swapchain; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11945 | local_pAllocator = nullptr; |
| 11946 | if (pAllocator) |
| 11947 | { |
| 11948 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 11949 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 11950 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 11951 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 11952 | if (local_pAllocator) |
| 11953 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 11954 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 11955 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11956 | countingStream->rewind(); |
| 11957 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11958 | uint64_t cgen_var_811; |
| 11959 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_811, 1); |
| 11960 | countingStream->write((uint64_t*)&cgen_var_811, 1 * 8); |
| 11961 | uint64_t cgen_var_812; |
| 11962 | countingStream->handleMapping()->mapHandles_VkSwapchainKHR_u64(&local_swapchain, &cgen_var_812, 1); |
| 11963 | countingStream->write((uint64_t*)&cgen_var_812, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11964 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11965 | uint64_t cgen_var_813 = (uint64_t)(uintptr_t)local_pAllocator; |
| 11966 | countingStream->putBe64(cgen_var_813); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11967 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11968 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11969 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11970 | } |
| 11971 | } |
| 11972 | uint32_t packetSize_vkDestroySwapchainKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 11973 | countingStream->rewind(); |
| 11974 | uint32_t opcode_vkDestroySwapchainKHR = OP_vkDestroySwapchainKHR; |
| 11975 | stream->write(&opcode_vkDestroySwapchainKHR, sizeof(uint32_t)); |
| 11976 | stream->write(&packetSize_vkDestroySwapchainKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11977 | uint64_t cgen_var_814; |
| 11978 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_814, 1); |
| 11979 | stream->write((uint64_t*)&cgen_var_814, 1 * 8); |
| 11980 | uint64_t cgen_var_815; |
| 11981 | stream->handleMapping()->mapHandles_VkSwapchainKHR_u64(&local_swapchain, &cgen_var_815, 1); |
| 11982 | stream->write((uint64_t*)&cgen_var_815, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 11983 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 11984 | uint64_t cgen_var_816 = (uint64_t)(uintptr_t)local_pAllocator; |
| 11985 | stream->putBe64(cgen_var_816); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11986 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11987 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11988 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11989 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 11990 | resources->destroyMapping()->mapHandles_VkSwapchainKHR((VkSwapchainKHR*)&swapchain); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 11991 | pool->freeAll(); |
| 11992 | countingStream->clearPool(); |
| 11993 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 11994 | mImpl->log("finish vkDestroySwapchainKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 11995 | } |
| 11996 | |
| 11997 | VkResult VkEncoder::vkGetSwapchainImagesKHR( |
| 11998 | VkDevice device, |
| 11999 | VkSwapchainKHR swapchain, |
| 12000 | uint32_t* pSwapchainImageCount, |
| 12001 | VkImage* pSwapchainImages) |
| 12002 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 12003 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 12004 | mImpl->log("start vkGetSwapchainImagesKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12005 | auto stream = mImpl->stream(); |
| 12006 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12007 | auto resources = mImpl->resources(); |
| 12008 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12009 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12010 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12011 | VkSwapchainKHR local_swapchain; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 12012 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12013 | local_swapchain = swapchain; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12014 | countingStream->rewind(); |
| 12015 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12016 | uint64_t cgen_var_817; |
| 12017 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_817, 1); |
| 12018 | countingStream->write((uint64_t*)&cgen_var_817, 1 * 8); |
| 12019 | uint64_t cgen_var_818; |
| 12020 | countingStream->handleMapping()->mapHandles_VkSwapchainKHR_u64(&local_swapchain, &cgen_var_818, 1); |
| 12021 | countingStream->write((uint64_t*)&cgen_var_818, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12022 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12023 | uint64_t cgen_var_819 = (uint64_t)(uintptr_t)pSwapchainImageCount; |
| 12024 | countingStream->putBe64(cgen_var_819); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12025 | if (pSwapchainImageCount) |
| 12026 | { |
| 12027 | countingStream->write((uint32_t*)pSwapchainImageCount, sizeof(uint32_t)); |
| 12028 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12029 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12030 | uint64_t cgen_var_820 = (uint64_t)(uintptr_t)pSwapchainImages; |
| 12031 | countingStream->putBe64(cgen_var_820); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12032 | if (pSwapchainImages) |
| 12033 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12034 | if ((*(pSwapchainImageCount))) |
| 12035 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12036 | uint64_t* cgen_var_821; |
| 12037 | countingStream->alloc((void**)&cgen_var_821, (*(pSwapchainImageCount)) * 8); |
| 12038 | countingStream->handleMapping()->mapHandles_VkImage_u64(pSwapchainImages, cgen_var_821, (*(pSwapchainImageCount))); |
| 12039 | countingStream->write((uint64_t*)cgen_var_821, (*(pSwapchainImageCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12040 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12041 | } |
| 12042 | } |
| 12043 | uint32_t packetSize_vkGetSwapchainImagesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 12044 | countingStream->rewind(); |
| 12045 | uint32_t opcode_vkGetSwapchainImagesKHR = OP_vkGetSwapchainImagesKHR; |
| 12046 | stream->write(&opcode_vkGetSwapchainImagesKHR, sizeof(uint32_t)); |
| 12047 | stream->write(&packetSize_vkGetSwapchainImagesKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12048 | uint64_t cgen_var_822; |
| 12049 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_822, 1); |
| 12050 | stream->write((uint64_t*)&cgen_var_822, 1 * 8); |
| 12051 | uint64_t cgen_var_823; |
| 12052 | stream->handleMapping()->mapHandles_VkSwapchainKHR_u64(&local_swapchain, &cgen_var_823, 1); |
| 12053 | stream->write((uint64_t*)&cgen_var_823, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12054 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12055 | uint64_t cgen_var_824 = (uint64_t)(uintptr_t)pSwapchainImageCount; |
| 12056 | stream->putBe64(cgen_var_824); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12057 | if (pSwapchainImageCount) |
| 12058 | { |
| 12059 | stream->write((uint32_t*)pSwapchainImageCount, sizeof(uint32_t)); |
| 12060 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12061 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12062 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12063 | uint64_t cgen_var_825 = (uint64_t)(uintptr_t)pSwapchainImages; |
| 12064 | stream->putBe64(cgen_var_825); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12065 | if (pSwapchainImages) |
| 12066 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12067 | if ((*(pSwapchainImageCount))) |
| 12068 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12069 | uint64_t* cgen_var_826; |
| 12070 | stream->alloc((void**)&cgen_var_826, (*(pSwapchainImageCount)) * 8); |
| 12071 | stream->handleMapping()->mapHandles_VkImage_u64(pSwapchainImages, cgen_var_826, (*(pSwapchainImageCount))); |
| 12072 | stream->write((uint64_t*)cgen_var_826, (*(pSwapchainImageCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12073 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12074 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12075 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12076 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12077 | uint32_t* check_pSwapchainImageCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12078 | check_pSwapchainImageCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12079 | if (pSwapchainImageCount) |
| 12080 | { |
| 12081 | if (!(check_pSwapchainImageCount)) |
| 12082 | { |
| 12083 | fprintf(stderr, "fatal: pSwapchainImageCount inconsistent between guest and host\n"); |
| 12084 | } |
| 12085 | stream->read((uint32_t*)pSwapchainImageCount, sizeof(uint32_t)); |
| 12086 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12087 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12088 | VkImage* check_pSwapchainImages; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12089 | check_pSwapchainImages = (VkImage*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12090 | if (pSwapchainImages) |
| 12091 | { |
| 12092 | if (!(check_pSwapchainImages)) |
| 12093 | { |
| 12094 | fprintf(stderr, "fatal: pSwapchainImages inconsistent between guest and host\n"); |
| 12095 | } |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12096 | if ((*(pSwapchainImageCount))) |
| 12097 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12098 | uint64_t* cgen_var_829; |
| 12099 | stream->alloc((void**)&cgen_var_829, (*(pSwapchainImageCount)) * 8); |
| 12100 | stream->read((uint64_t*)cgen_var_829, (*(pSwapchainImageCount)) * 8); |
| 12101 | stream->handleMapping()->mapHandles_u64_VkImage(cgen_var_829, (VkImage*)pSwapchainImages, (*(pSwapchainImageCount))); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12102 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12103 | } |
| 12104 | VkResult vkGetSwapchainImagesKHR_VkResult_return = (VkResult)0; |
| 12105 | stream->read(&vkGetSwapchainImagesKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 12106 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12107 | countingStream->clearPool(); |
| 12108 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 12109 | mImpl->log("finish vkGetSwapchainImagesKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12110 | return vkGetSwapchainImagesKHR_VkResult_return; |
| 12111 | } |
| 12112 | |
| 12113 | VkResult VkEncoder::vkAcquireNextImageKHR( |
| 12114 | VkDevice device, |
| 12115 | VkSwapchainKHR swapchain, |
| 12116 | uint64_t timeout, |
| 12117 | VkSemaphore semaphore, |
| 12118 | VkFence fence, |
| 12119 | uint32_t* pImageIndex) |
| 12120 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 12121 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 12122 | mImpl->log("start vkAcquireNextImageKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12123 | auto stream = mImpl->stream(); |
| 12124 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12125 | auto resources = mImpl->resources(); |
| 12126 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12127 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12128 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12129 | VkSwapchainKHR local_swapchain; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12130 | uint64_t local_timeout; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12131 | VkSemaphore local_semaphore; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12132 | VkFence local_fence; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 12133 | local_device = device; |
| 12134 | local_swapchain = swapchain; |
| 12135 | local_timeout = timeout; |
| 12136 | local_semaphore = semaphore; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12137 | local_fence = fence; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12138 | countingStream->rewind(); |
| 12139 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12140 | uint64_t cgen_var_830; |
| 12141 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_830, 1); |
| 12142 | countingStream->write((uint64_t*)&cgen_var_830, 1 * 8); |
| 12143 | uint64_t cgen_var_831; |
| 12144 | countingStream->handleMapping()->mapHandles_VkSwapchainKHR_u64(&local_swapchain, &cgen_var_831, 1); |
| 12145 | countingStream->write((uint64_t*)&cgen_var_831, 1 * 8); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 12146 | countingStream->write((uint64_t*)&local_timeout, sizeof(uint64_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12147 | uint64_t cgen_var_832; |
| 12148 | countingStream->handleMapping()->mapHandles_VkSemaphore_u64(&local_semaphore, &cgen_var_832, 1); |
| 12149 | countingStream->write((uint64_t*)&cgen_var_832, 1 * 8); |
| 12150 | uint64_t cgen_var_833; |
| 12151 | countingStream->handleMapping()->mapHandles_VkFence_u64(&local_fence, &cgen_var_833, 1); |
| 12152 | countingStream->write((uint64_t*)&cgen_var_833, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12153 | countingStream->write((uint32_t*)pImageIndex, sizeof(uint32_t)); |
| 12154 | } |
| 12155 | uint32_t packetSize_vkAcquireNextImageKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 12156 | countingStream->rewind(); |
| 12157 | uint32_t opcode_vkAcquireNextImageKHR = OP_vkAcquireNextImageKHR; |
| 12158 | stream->write(&opcode_vkAcquireNextImageKHR, sizeof(uint32_t)); |
| 12159 | stream->write(&packetSize_vkAcquireNextImageKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12160 | uint64_t cgen_var_834; |
| 12161 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_834, 1); |
| 12162 | stream->write((uint64_t*)&cgen_var_834, 1 * 8); |
| 12163 | uint64_t cgen_var_835; |
| 12164 | stream->handleMapping()->mapHandles_VkSwapchainKHR_u64(&local_swapchain, &cgen_var_835, 1); |
| 12165 | stream->write((uint64_t*)&cgen_var_835, 1 * 8); |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 12166 | stream->write((uint64_t*)&local_timeout, sizeof(uint64_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12167 | uint64_t cgen_var_836; |
| 12168 | stream->handleMapping()->mapHandles_VkSemaphore_u64(&local_semaphore, &cgen_var_836, 1); |
| 12169 | stream->write((uint64_t*)&cgen_var_836, 1 * 8); |
| 12170 | uint64_t cgen_var_837; |
| 12171 | stream->handleMapping()->mapHandles_VkFence_u64(&local_fence, &cgen_var_837, 1); |
| 12172 | stream->write((uint64_t*)&cgen_var_837, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12173 | stream->write((uint32_t*)pImageIndex, sizeof(uint32_t)); |
| 12174 | stream->read((uint32_t*)pImageIndex, sizeof(uint32_t)); |
| 12175 | VkResult vkAcquireNextImageKHR_VkResult_return = (VkResult)0; |
| 12176 | stream->read(&vkAcquireNextImageKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 12177 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12178 | countingStream->clearPool(); |
| 12179 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 12180 | mImpl->log("finish vkAcquireNextImageKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12181 | return vkAcquireNextImageKHR_VkResult_return; |
| 12182 | } |
| 12183 | |
| 12184 | VkResult VkEncoder::vkQueuePresentKHR( |
| 12185 | VkQueue queue, |
| 12186 | const VkPresentInfoKHR* pPresentInfo) |
| 12187 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 12188 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 12189 | mImpl->log("start vkQueuePresentKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12190 | auto stream = mImpl->stream(); |
| 12191 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12192 | auto resources = mImpl->resources(); |
| 12193 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12194 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12195 | VkQueue local_queue; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12196 | VkPresentInfoKHR* local_pPresentInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 12197 | local_queue = queue; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12198 | local_pPresentInfo = nullptr; |
| 12199 | if (pPresentInfo) |
| 12200 | { |
| 12201 | local_pPresentInfo = (VkPresentInfoKHR*)pool->alloc(sizeof(const VkPresentInfoKHR)); |
| 12202 | deepcopy_VkPresentInfoKHR(pool, pPresentInfo, (VkPresentInfoKHR*)(local_pPresentInfo)); |
| 12203 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 12204 | if (local_pPresentInfo) |
| 12205 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 12206 | transform_tohost_VkPresentInfoKHR(mImpl->resources(), (VkPresentInfoKHR*)(local_pPresentInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 12207 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12208 | countingStream->rewind(); |
| 12209 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12210 | uint64_t cgen_var_838; |
| 12211 | countingStream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_838, 1); |
| 12212 | countingStream->write((uint64_t*)&cgen_var_838, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12213 | marshal_VkPresentInfoKHR(countingStream, (VkPresentInfoKHR*)(local_pPresentInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12214 | } |
| 12215 | uint32_t packetSize_vkQueuePresentKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 12216 | countingStream->rewind(); |
| 12217 | uint32_t opcode_vkQueuePresentKHR = OP_vkQueuePresentKHR; |
| 12218 | stream->write(&opcode_vkQueuePresentKHR, sizeof(uint32_t)); |
| 12219 | stream->write(&packetSize_vkQueuePresentKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12220 | uint64_t cgen_var_839; |
| 12221 | stream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_839, 1); |
| 12222 | stream->write((uint64_t*)&cgen_var_839, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12223 | marshal_VkPresentInfoKHR(stream, (VkPresentInfoKHR*)(local_pPresentInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12224 | VkResult vkQueuePresentKHR_VkResult_return = (VkResult)0; |
| 12225 | stream->read(&vkQueuePresentKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 12226 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12227 | countingStream->clearPool(); |
| 12228 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 12229 | mImpl->log("finish vkQueuePresentKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12230 | return vkQueuePresentKHR_VkResult_return; |
| 12231 | } |
| 12232 | |
| 12233 | VkResult VkEncoder::vkGetDeviceGroupPresentCapabilitiesKHR( |
| 12234 | VkDevice device, |
| 12235 | VkDeviceGroupPresentCapabilitiesKHR* pDeviceGroupPresentCapabilities) |
| 12236 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 12237 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 12238 | mImpl->log("start vkGetDeviceGroupPresentCapabilitiesKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12239 | auto stream = mImpl->stream(); |
| 12240 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12241 | auto resources = mImpl->resources(); |
| 12242 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12243 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12244 | VkDevice local_device; |
| 12245 | local_device = device; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12246 | countingStream->rewind(); |
| 12247 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12248 | uint64_t cgen_var_840; |
| 12249 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_840, 1); |
| 12250 | countingStream->write((uint64_t*)&cgen_var_840, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12251 | marshal_VkDeviceGroupPresentCapabilitiesKHR(countingStream, (VkDeviceGroupPresentCapabilitiesKHR*)(pDeviceGroupPresentCapabilities)); |
| 12252 | } |
| 12253 | uint32_t packetSize_vkGetDeviceGroupPresentCapabilitiesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 12254 | countingStream->rewind(); |
| 12255 | uint32_t opcode_vkGetDeviceGroupPresentCapabilitiesKHR = OP_vkGetDeviceGroupPresentCapabilitiesKHR; |
| 12256 | stream->write(&opcode_vkGetDeviceGroupPresentCapabilitiesKHR, sizeof(uint32_t)); |
| 12257 | stream->write(&packetSize_vkGetDeviceGroupPresentCapabilitiesKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12258 | uint64_t cgen_var_841; |
| 12259 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_841, 1); |
| 12260 | stream->write((uint64_t*)&cgen_var_841, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12261 | marshal_VkDeviceGroupPresentCapabilitiesKHR(stream, (VkDeviceGroupPresentCapabilitiesKHR*)(pDeviceGroupPresentCapabilities)); |
| 12262 | unmarshal_VkDeviceGroupPresentCapabilitiesKHR(stream, (VkDeviceGroupPresentCapabilitiesKHR*)(pDeviceGroupPresentCapabilities)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 12263 | if (pDeviceGroupPresentCapabilities) |
| 12264 | { |
| 12265 | transform_fromhost_VkDeviceGroupPresentCapabilitiesKHR(mImpl->resources(), (VkDeviceGroupPresentCapabilitiesKHR*)(pDeviceGroupPresentCapabilities)); |
| 12266 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12267 | VkResult vkGetDeviceGroupPresentCapabilitiesKHR_VkResult_return = (VkResult)0; |
| 12268 | stream->read(&vkGetDeviceGroupPresentCapabilitiesKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 12269 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12270 | countingStream->clearPool(); |
| 12271 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 12272 | mImpl->log("finish vkGetDeviceGroupPresentCapabilitiesKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12273 | return vkGetDeviceGroupPresentCapabilitiesKHR_VkResult_return; |
| 12274 | } |
| 12275 | |
| 12276 | VkResult VkEncoder::vkGetDeviceGroupSurfacePresentModesKHR( |
| 12277 | VkDevice device, |
| 12278 | VkSurfaceKHR surface, |
| 12279 | VkDeviceGroupPresentModeFlagsKHR* pModes) |
| 12280 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 12281 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 12282 | mImpl->log("start vkGetDeviceGroupSurfacePresentModesKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12283 | auto stream = mImpl->stream(); |
| 12284 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12285 | auto resources = mImpl->resources(); |
| 12286 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12287 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12288 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12289 | VkSurfaceKHR local_surface; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 12290 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12291 | local_surface = surface; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12292 | countingStream->rewind(); |
| 12293 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12294 | uint64_t cgen_var_842; |
| 12295 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_842, 1); |
| 12296 | countingStream->write((uint64_t*)&cgen_var_842, 1 * 8); |
| 12297 | uint64_t cgen_var_843; |
| 12298 | countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(&local_surface, &cgen_var_843, 1); |
| 12299 | countingStream->write((uint64_t*)&cgen_var_843, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12300 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12301 | uint64_t cgen_var_844 = (uint64_t)(uintptr_t)pModes; |
| 12302 | countingStream->putBe64(cgen_var_844); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12303 | if (pModes) |
| 12304 | { |
| 12305 | countingStream->write((VkDeviceGroupPresentModeFlagsKHR*)pModes, sizeof(VkDeviceGroupPresentModeFlagsKHR)); |
| 12306 | } |
| 12307 | } |
| 12308 | uint32_t packetSize_vkGetDeviceGroupSurfacePresentModesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 12309 | countingStream->rewind(); |
| 12310 | uint32_t opcode_vkGetDeviceGroupSurfacePresentModesKHR = OP_vkGetDeviceGroupSurfacePresentModesKHR; |
| 12311 | stream->write(&opcode_vkGetDeviceGroupSurfacePresentModesKHR, sizeof(uint32_t)); |
| 12312 | stream->write(&packetSize_vkGetDeviceGroupSurfacePresentModesKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12313 | uint64_t cgen_var_845; |
| 12314 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_845, 1); |
| 12315 | stream->write((uint64_t*)&cgen_var_845, 1 * 8); |
| 12316 | uint64_t cgen_var_846; |
| 12317 | stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(&local_surface, &cgen_var_846, 1); |
| 12318 | stream->write((uint64_t*)&cgen_var_846, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12319 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12320 | uint64_t cgen_var_847 = (uint64_t)(uintptr_t)pModes; |
| 12321 | stream->putBe64(cgen_var_847); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12322 | if (pModes) |
| 12323 | { |
| 12324 | stream->write((VkDeviceGroupPresentModeFlagsKHR*)pModes, sizeof(VkDeviceGroupPresentModeFlagsKHR)); |
| 12325 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12326 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12327 | VkDeviceGroupPresentModeFlagsKHR* check_pModes; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12328 | check_pModes = (VkDeviceGroupPresentModeFlagsKHR*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12329 | if (pModes) |
| 12330 | { |
| 12331 | if (!(check_pModes)) |
| 12332 | { |
| 12333 | fprintf(stderr, "fatal: pModes inconsistent between guest and host\n"); |
| 12334 | } |
| 12335 | stream->read((VkDeviceGroupPresentModeFlagsKHR*)pModes, sizeof(VkDeviceGroupPresentModeFlagsKHR)); |
| 12336 | } |
| 12337 | VkResult vkGetDeviceGroupSurfacePresentModesKHR_VkResult_return = (VkResult)0; |
| 12338 | stream->read(&vkGetDeviceGroupSurfacePresentModesKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 12339 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12340 | countingStream->clearPool(); |
| 12341 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 12342 | mImpl->log("finish vkGetDeviceGroupSurfacePresentModesKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12343 | return vkGetDeviceGroupSurfacePresentModesKHR_VkResult_return; |
| 12344 | } |
| 12345 | |
| 12346 | VkResult VkEncoder::vkGetPhysicalDevicePresentRectanglesKHR( |
| 12347 | VkPhysicalDevice physicalDevice, |
| 12348 | VkSurfaceKHR surface, |
| 12349 | uint32_t* pRectCount, |
| 12350 | VkRect2D* pRects) |
| 12351 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 12352 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 12353 | mImpl->log("start vkGetPhysicalDevicePresentRectanglesKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12354 | auto stream = mImpl->stream(); |
| 12355 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12356 | auto resources = mImpl->resources(); |
| 12357 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12358 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12359 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12360 | VkSurfaceKHR local_surface; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 12361 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12362 | local_surface = surface; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12363 | countingStream->rewind(); |
| 12364 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12365 | uint64_t cgen_var_849; |
| 12366 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_849, 1); |
| 12367 | countingStream->write((uint64_t*)&cgen_var_849, 1 * 8); |
| 12368 | uint64_t cgen_var_850; |
| 12369 | countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(&local_surface, &cgen_var_850, 1); |
| 12370 | countingStream->write((uint64_t*)&cgen_var_850, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12371 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12372 | uint64_t cgen_var_851 = (uint64_t)(uintptr_t)pRectCount; |
| 12373 | countingStream->putBe64(cgen_var_851); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12374 | if (pRectCount) |
| 12375 | { |
| 12376 | countingStream->write((uint32_t*)pRectCount, sizeof(uint32_t)); |
| 12377 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12378 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12379 | uint64_t cgen_var_852 = (uint64_t)(uintptr_t)pRects; |
| 12380 | countingStream->putBe64(cgen_var_852); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12381 | if (pRects) |
| 12382 | { |
| 12383 | for (uint32_t i = 0; i < (uint32_t)(*(pRectCount)); ++i) |
| 12384 | { |
| 12385 | marshal_VkRect2D(countingStream, (VkRect2D*)(pRects + i)); |
| 12386 | } |
| 12387 | } |
| 12388 | } |
| 12389 | uint32_t packetSize_vkGetPhysicalDevicePresentRectanglesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 12390 | countingStream->rewind(); |
| 12391 | uint32_t opcode_vkGetPhysicalDevicePresentRectanglesKHR = OP_vkGetPhysicalDevicePresentRectanglesKHR; |
| 12392 | stream->write(&opcode_vkGetPhysicalDevicePresentRectanglesKHR, sizeof(uint32_t)); |
| 12393 | stream->write(&packetSize_vkGetPhysicalDevicePresentRectanglesKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12394 | uint64_t cgen_var_853; |
| 12395 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_853, 1); |
| 12396 | stream->write((uint64_t*)&cgen_var_853, 1 * 8); |
| 12397 | uint64_t cgen_var_854; |
| 12398 | stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(&local_surface, &cgen_var_854, 1); |
| 12399 | stream->write((uint64_t*)&cgen_var_854, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12400 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12401 | uint64_t cgen_var_855 = (uint64_t)(uintptr_t)pRectCount; |
| 12402 | stream->putBe64(cgen_var_855); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12403 | if (pRectCount) |
| 12404 | { |
| 12405 | stream->write((uint32_t*)pRectCount, sizeof(uint32_t)); |
| 12406 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12407 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12408 | uint64_t cgen_var_856 = (uint64_t)(uintptr_t)pRects; |
| 12409 | stream->putBe64(cgen_var_856); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12410 | if (pRects) |
| 12411 | { |
| 12412 | for (uint32_t i = 0; i < (uint32_t)(*(pRectCount)); ++i) |
| 12413 | { |
| 12414 | marshal_VkRect2D(stream, (VkRect2D*)(pRects + i)); |
| 12415 | } |
| 12416 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12417 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12418 | uint32_t* check_pRectCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12419 | check_pRectCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12420 | if (pRectCount) |
| 12421 | { |
| 12422 | if (!(check_pRectCount)) |
| 12423 | { |
| 12424 | fprintf(stderr, "fatal: pRectCount inconsistent between guest and host\n"); |
| 12425 | } |
| 12426 | stream->read((uint32_t*)pRectCount, sizeof(uint32_t)); |
| 12427 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12428 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12429 | VkRect2D* check_pRects; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12430 | check_pRects = (VkRect2D*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12431 | if (pRects) |
| 12432 | { |
| 12433 | if (!(check_pRects)) |
| 12434 | { |
| 12435 | fprintf(stderr, "fatal: pRects inconsistent between guest and host\n"); |
| 12436 | } |
| 12437 | for (uint32_t i = 0; i < (uint32_t)(*(pRectCount)); ++i) |
| 12438 | { |
| 12439 | unmarshal_VkRect2D(stream, (VkRect2D*)(pRects + i)); |
| 12440 | } |
| 12441 | } |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 12442 | if (pRects) |
| 12443 | { |
| 12444 | for (uint32_t i = 0; i < (uint32_t)(*(pRectCount)); ++i) |
| 12445 | { |
| 12446 | transform_fromhost_VkRect2D(mImpl->resources(), (VkRect2D*)(pRects + i)); |
| 12447 | } |
| 12448 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12449 | VkResult vkGetPhysicalDevicePresentRectanglesKHR_VkResult_return = (VkResult)0; |
| 12450 | stream->read(&vkGetPhysicalDevicePresentRectanglesKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 12451 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12452 | countingStream->clearPool(); |
| 12453 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 12454 | mImpl->log("finish vkGetPhysicalDevicePresentRectanglesKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12455 | return vkGetPhysicalDevicePresentRectanglesKHR_VkResult_return; |
| 12456 | } |
| 12457 | |
| 12458 | VkResult VkEncoder::vkAcquireNextImage2KHR( |
| 12459 | VkDevice device, |
| 12460 | const VkAcquireNextImageInfoKHR* pAcquireInfo, |
| 12461 | uint32_t* pImageIndex) |
| 12462 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 12463 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 12464 | mImpl->log("start vkAcquireNextImage2KHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12465 | auto stream = mImpl->stream(); |
| 12466 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12467 | auto resources = mImpl->resources(); |
| 12468 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12469 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12470 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12471 | VkAcquireNextImageInfoKHR* local_pAcquireInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 12472 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12473 | local_pAcquireInfo = nullptr; |
| 12474 | if (pAcquireInfo) |
| 12475 | { |
| 12476 | local_pAcquireInfo = (VkAcquireNextImageInfoKHR*)pool->alloc(sizeof(const VkAcquireNextImageInfoKHR)); |
| 12477 | deepcopy_VkAcquireNextImageInfoKHR(pool, pAcquireInfo, (VkAcquireNextImageInfoKHR*)(local_pAcquireInfo)); |
| 12478 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 12479 | if (local_pAcquireInfo) |
| 12480 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 12481 | transform_tohost_VkAcquireNextImageInfoKHR(mImpl->resources(), (VkAcquireNextImageInfoKHR*)(local_pAcquireInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 12482 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12483 | countingStream->rewind(); |
| 12484 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12485 | uint64_t cgen_var_859; |
| 12486 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_859, 1); |
| 12487 | countingStream->write((uint64_t*)&cgen_var_859, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12488 | marshal_VkAcquireNextImageInfoKHR(countingStream, (VkAcquireNextImageInfoKHR*)(local_pAcquireInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12489 | countingStream->write((uint32_t*)pImageIndex, sizeof(uint32_t)); |
| 12490 | } |
| 12491 | uint32_t packetSize_vkAcquireNextImage2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 12492 | countingStream->rewind(); |
| 12493 | uint32_t opcode_vkAcquireNextImage2KHR = OP_vkAcquireNextImage2KHR; |
| 12494 | stream->write(&opcode_vkAcquireNextImage2KHR, sizeof(uint32_t)); |
| 12495 | stream->write(&packetSize_vkAcquireNextImage2KHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12496 | uint64_t cgen_var_860; |
| 12497 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_860, 1); |
| 12498 | stream->write((uint64_t*)&cgen_var_860, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12499 | marshal_VkAcquireNextImageInfoKHR(stream, (VkAcquireNextImageInfoKHR*)(local_pAcquireInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12500 | stream->write((uint32_t*)pImageIndex, sizeof(uint32_t)); |
| 12501 | stream->read((uint32_t*)pImageIndex, sizeof(uint32_t)); |
| 12502 | VkResult vkAcquireNextImage2KHR_VkResult_return = (VkResult)0; |
| 12503 | stream->read(&vkAcquireNextImage2KHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 12504 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12505 | countingStream->clearPool(); |
| 12506 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 12507 | mImpl->log("finish vkAcquireNextImage2KHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12508 | return vkAcquireNextImage2KHR_VkResult_return; |
| 12509 | } |
| 12510 | |
| 12511 | #endif |
| 12512 | #ifdef VK_KHR_display |
| 12513 | VkResult VkEncoder::vkGetPhysicalDeviceDisplayPropertiesKHR( |
| 12514 | VkPhysicalDevice physicalDevice, |
| 12515 | uint32_t* pPropertyCount, |
| 12516 | VkDisplayPropertiesKHR* pProperties) |
| 12517 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 12518 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 12519 | mImpl->log("start vkGetPhysicalDeviceDisplayPropertiesKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12520 | auto stream = mImpl->stream(); |
| 12521 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12522 | auto resources = mImpl->resources(); |
| 12523 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12524 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12525 | VkPhysicalDevice local_physicalDevice; |
| 12526 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12527 | countingStream->rewind(); |
| 12528 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12529 | uint64_t cgen_var_861; |
| 12530 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_861, 1); |
| 12531 | countingStream->write((uint64_t*)&cgen_var_861, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12532 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12533 | uint64_t cgen_var_862 = (uint64_t)(uintptr_t)pPropertyCount; |
| 12534 | countingStream->putBe64(cgen_var_862); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12535 | if (pPropertyCount) |
| 12536 | { |
| 12537 | countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 12538 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12539 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12540 | uint64_t cgen_var_863 = (uint64_t)(uintptr_t)pProperties; |
| 12541 | countingStream->putBe64(cgen_var_863); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12542 | if (pProperties) |
| 12543 | { |
| 12544 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 12545 | { |
| 12546 | marshal_VkDisplayPropertiesKHR(countingStream, (VkDisplayPropertiesKHR*)(pProperties + i)); |
| 12547 | } |
| 12548 | } |
| 12549 | } |
| 12550 | uint32_t packetSize_vkGetPhysicalDeviceDisplayPropertiesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 12551 | countingStream->rewind(); |
| 12552 | uint32_t opcode_vkGetPhysicalDeviceDisplayPropertiesKHR = OP_vkGetPhysicalDeviceDisplayPropertiesKHR; |
| 12553 | stream->write(&opcode_vkGetPhysicalDeviceDisplayPropertiesKHR, sizeof(uint32_t)); |
| 12554 | stream->write(&packetSize_vkGetPhysicalDeviceDisplayPropertiesKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12555 | uint64_t cgen_var_864; |
| 12556 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_864, 1); |
| 12557 | stream->write((uint64_t*)&cgen_var_864, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12558 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12559 | uint64_t cgen_var_865 = (uint64_t)(uintptr_t)pPropertyCount; |
| 12560 | stream->putBe64(cgen_var_865); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12561 | if (pPropertyCount) |
| 12562 | { |
| 12563 | stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 12564 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12565 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12566 | uint64_t cgen_var_866 = (uint64_t)(uintptr_t)pProperties; |
| 12567 | stream->putBe64(cgen_var_866); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12568 | if (pProperties) |
| 12569 | { |
| 12570 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 12571 | { |
| 12572 | marshal_VkDisplayPropertiesKHR(stream, (VkDisplayPropertiesKHR*)(pProperties + i)); |
| 12573 | } |
| 12574 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12575 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12576 | uint32_t* check_pPropertyCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12577 | check_pPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12578 | if (pPropertyCount) |
| 12579 | { |
| 12580 | if (!(check_pPropertyCount)) |
| 12581 | { |
| 12582 | fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n"); |
| 12583 | } |
| 12584 | stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 12585 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12586 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12587 | VkDisplayPropertiesKHR* check_pProperties; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12588 | check_pProperties = (VkDisplayPropertiesKHR*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12589 | if (pProperties) |
| 12590 | { |
| 12591 | if (!(check_pProperties)) |
| 12592 | { |
| 12593 | fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n"); |
| 12594 | } |
| 12595 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 12596 | { |
| 12597 | unmarshal_VkDisplayPropertiesKHR(stream, (VkDisplayPropertiesKHR*)(pProperties + i)); |
| 12598 | } |
| 12599 | } |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 12600 | if (pProperties) |
| 12601 | { |
| 12602 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 12603 | { |
| 12604 | transform_fromhost_VkDisplayPropertiesKHR(mImpl->resources(), (VkDisplayPropertiesKHR*)(pProperties + i)); |
| 12605 | } |
| 12606 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12607 | VkResult vkGetPhysicalDeviceDisplayPropertiesKHR_VkResult_return = (VkResult)0; |
| 12608 | stream->read(&vkGetPhysicalDeviceDisplayPropertiesKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 12609 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12610 | countingStream->clearPool(); |
| 12611 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 12612 | mImpl->log("finish vkGetPhysicalDeviceDisplayPropertiesKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12613 | return vkGetPhysicalDeviceDisplayPropertiesKHR_VkResult_return; |
| 12614 | } |
| 12615 | |
| 12616 | VkResult VkEncoder::vkGetPhysicalDeviceDisplayPlanePropertiesKHR( |
| 12617 | VkPhysicalDevice physicalDevice, |
| 12618 | uint32_t* pPropertyCount, |
| 12619 | VkDisplayPlanePropertiesKHR* pProperties) |
| 12620 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 12621 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 12622 | mImpl->log("start vkGetPhysicalDeviceDisplayPlanePropertiesKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12623 | auto stream = mImpl->stream(); |
| 12624 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12625 | auto resources = mImpl->resources(); |
| 12626 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12627 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12628 | VkPhysicalDevice local_physicalDevice; |
| 12629 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12630 | countingStream->rewind(); |
| 12631 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12632 | uint64_t cgen_var_869; |
| 12633 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_869, 1); |
| 12634 | countingStream->write((uint64_t*)&cgen_var_869, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12635 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12636 | uint64_t cgen_var_870 = (uint64_t)(uintptr_t)pPropertyCount; |
| 12637 | countingStream->putBe64(cgen_var_870); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12638 | if (pPropertyCount) |
| 12639 | { |
| 12640 | countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 12641 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12642 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12643 | uint64_t cgen_var_871 = (uint64_t)(uintptr_t)pProperties; |
| 12644 | countingStream->putBe64(cgen_var_871); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12645 | if (pProperties) |
| 12646 | { |
| 12647 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 12648 | { |
| 12649 | marshal_VkDisplayPlanePropertiesKHR(countingStream, (VkDisplayPlanePropertiesKHR*)(pProperties + i)); |
| 12650 | } |
| 12651 | } |
| 12652 | } |
| 12653 | uint32_t packetSize_vkGetPhysicalDeviceDisplayPlanePropertiesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 12654 | countingStream->rewind(); |
| 12655 | uint32_t opcode_vkGetPhysicalDeviceDisplayPlanePropertiesKHR = OP_vkGetPhysicalDeviceDisplayPlanePropertiesKHR; |
| 12656 | stream->write(&opcode_vkGetPhysicalDeviceDisplayPlanePropertiesKHR, sizeof(uint32_t)); |
| 12657 | stream->write(&packetSize_vkGetPhysicalDeviceDisplayPlanePropertiesKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12658 | uint64_t cgen_var_872; |
| 12659 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_872, 1); |
| 12660 | stream->write((uint64_t*)&cgen_var_872, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12661 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12662 | uint64_t cgen_var_873 = (uint64_t)(uintptr_t)pPropertyCount; |
| 12663 | stream->putBe64(cgen_var_873); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12664 | if (pPropertyCount) |
| 12665 | { |
| 12666 | stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 12667 | } |
| 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_874 = (uint64_t)(uintptr_t)pProperties; |
| 12670 | stream->putBe64(cgen_var_874); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12671 | if (pProperties) |
| 12672 | { |
| 12673 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 12674 | { |
| 12675 | marshal_VkDisplayPlanePropertiesKHR(stream, (VkDisplayPlanePropertiesKHR*)(pProperties + i)); |
| 12676 | } |
| 12677 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12678 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12679 | uint32_t* check_pPropertyCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12680 | check_pPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12681 | if (pPropertyCount) |
| 12682 | { |
| 12683 | if (!(check_pPropertyCount)) |
| 12684 | { |
| 12685 | fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n"); |
| 12686 | } |
| 12687 | stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 12688 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12689 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12690 | VkDisplayPlanePropertiesKHR* check_pProperties; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12691 | check_pProperties = (VkDisplayPlanePropertiesKHR*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12692 | if (pProperties) |
| 12693 | { |
| 12694 | if (!(check_pProperties)) |
| 12695 | { |
| 12696 | fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n"); |
| 12697 | } |
| 12698 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 12699 | { |
| 12700 | unmarshal_VkDisplayPlanePropertiesKHR(stream, (VkDisplayPlanePropertiesKHR*)(pProperties + i)); |
| 12701 | } |
| 12702 | } |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 12703 | if (pProperties) |
| 12704 | { |
| 12705 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 12706 | { |
| 12707 | transform_fromhost_VkDisplayPlanePropertiesKHR(mImpl->resources(), (VkDisplayPlanePropertiesKHR*)(pProperties + i)); |
| 12708 | } |
| 12709 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12710 | VkResult vkGetPhysicalDeviceDisplayPlanePropertiesKHR_VkResult_return = (VkResult)0; |
| 12711 | stream->read(&vkGetPhysicalDeviceDisplayPlanePropertiesKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 12712 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12713 | countingStream->clearPool(); |
| 12714 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 12715 | mImpl->log("finish vkGetPhysicalDeviceDisplayPlanePropertiesKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12716 | return vkGetPhysicalDeviceDisplayPlanePropertiesKHR_VkResult_return; |
| 12717 | } |
| 12718 | |
| 12719 | VkResult VkEncoder::vkGetDisplayPlaneSupportedDisplaysKHR( |
| 12720 | VkPhysicalDevice physicalDevice, |
| 12721 | uint32_t planeIndex, |
| 12722 | uint32_t* pDisplayCount, |
| 12723 | VkDisplayKHR* pDisplays) |
| 12724 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 12725 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 12726 | mImpl->log("start vkGetDisplayPlaneSupportedDisplaysKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12727 | auto stream = mImpl->stream(); |
| 12728 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12729 | auto resources = mImpl->resources(); |
| 12730 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12731 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12732 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12733 | uint32_t local_planeIndex; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 12734 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12735 | local_planeIndex = planeIndex; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12736 | countingStream->rewind(); |
| 12737 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12738 | uint64_t cgen_var_877; |
| 12739 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_877, 1); |
| 12740 | countingStream->write((uint64_t*)&cgen_var_877, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12741 | countingStream->write((uint32_t*)&local_planeIndex, sizeof(uint32_t)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12742 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12743 | uint64_t cgen_var_878 = (uint64_t)(uintptr_t)pDisplayCount; |
| 12744 | countingStream->putBe64(cgen_var_878); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12745 | if (pDisplayCount) |
| 12746 | { |
| 12747 | countingStream->write((uint32_t*)pDisplayCount, sizeof(uint32_t)); |
| 12748 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12749 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12750 | uint64_t cgen_var_879 = (uint64_t)(uintptr_t)pDisplays; |
| 12751 | countingStream->putBe64(cgen_var_879); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12752 | if (pDisplays) |
| 12753 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12754 | if ((*(pDisplayCount))) |
| 12755 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12756 | uint64_t* cgen_var_880; |
| 12757 | countingStream->alloc((void**)&cgen_var_880, (*(pDisplayCount)) * 8); |
| 12758 | countingStream->handleMapping()->mapHandles_VkDisplayKHR_u64(pDisplays, cgen_var_880, (*(pDisplayCount))); |
| 12759 | countingStream->write((uint64_t*)cgen_var_880, (*(pDisplayCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12760 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12761 | } |
| 12762 | } |
| 12763 | uint32_t packetSize_vkGetDisplayPlaneSupportedDisplaysKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 12764 | countingStream->rewind(); |
| 12765 | uint32_t opcode_vkGetDisplayPlaneSupportedDisplaysKHR = OP_vkGetDisplayPlaneSupportedDisplaysKHR; |
| 12766 | stream->write(&opcode_vkGetDisplayPlaneSupportedDisplaysKHR, sizeof(uint32_t)); |
| 12767 | stream->write(&packetSize_vkGetDisplayPlaneSupportedDisplaysKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12768 | uint64_t cgen_var_881; |
| 12769 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_881, 1); |
| 12770 | stream->write((uint64_t*)&cgen_var_881, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12771 | stream->write((uint32_t*)&local_planeIndex, sizeof(uint32_t)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12772 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12773 | uint64_t cgen_var_882 = (uint64_t)(uintptr_t)pDisplayCount; |
| 12774 | stream->putBe64(cgen_var_882); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12775 | if (pDisplayCount) |
| 12776 | { |
| 12777 | stream->write((uint32_t*)pDisplayCount, sizeof(uint32_t)); |
| 12778 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12779 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12780 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12781 | uint64_t cgen_var_883 = (uint64_t)(uintptr_t)pDisplays; |
| 12782 | stream->putBe64(cgen_var_883); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12783 | if (pDisplays) |
| 12784 | { |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12785 | if ((*(pDisplayCount))) |
| 12786 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12787 | uint64_t* cgen_var_884; |
| 12788 | stream->alloc((void**)&cgen_var_884, (*(pDisplayCount)) * 8); |
| 12789 | stream->handleMapping()->mapHandles_VkDisplayKHR_u64(pDisplays, cgen_var_884, (*(pDisplayCount))); |
| 12790 | stream->write((uint64_t*)cgen_var_884, (*(pDisplayCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12791 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12792 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12793 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12794 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12795 | uint32_t* check_pDisplayCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12796 | check_pDisplayCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12797 | if (pDisplayCount) |
| 12798 | { |
| 12799 | if (!(check_pDisplayCount)) |
| 12800 | { |
| 12801 | fprintf(stderr, "fatal: pDisplayCount inconsistent between guest and host\n"); |
| 12802 | } |
| 12803 | stream->read((uint32_t*)pDisplayCount, sizeof(uint32_t)); |
| 12804 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12805 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12806 | VkDisplayKHR* check_pDisplays; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12807 | check_pDisplays = (VkDisplayKHR*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12808 | if (pDisplays) |
| 12809 | { |
| 12810 | if (!(check_pDisplays)) |
| 12811 | { |
| 12812 | fprintf(stderr, "fatal: pDisplays inconsistent between guest and host\n"); |
| 12813 | } |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12814 | if ((*(pDisplayCount))) |
| 12815 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12816 | uint64_t* cgen_var_887; |
| 12817 | stream->alloc((void**)&cgen_var_887, (*(pDisplayCount)) * 8); |
| 12818 | stream->read((uint64_t*)cgen_var_887, (*(pDisplayCount)) * 8); |
| 12819 | stream->handleMapping()->mapHandles_u64_VkDisplayKHR(cgen_var_887, (VkDisplayKHR*)pDisplays, (*(pDisplayCount))); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12820 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12821 | } |
| 12822 | VkResult vkGetDisplayPlaneSupportedDisplaysKHR_VkResult_return = (VkResult)0; |
| 12823 | stream->read(&vkGetDisplayPlaneSupportedDisplaysKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 12824 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12825 | countingStream->clearPool(); |
| 12826 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 12827 | mImpl->log("finish vkGetDisplayPlaneSupportedDisplaysKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12828 | return vkGetDisplayPlaneSupportedDisplaysKHR_VkResult_return; |
| 12829 | } |
| 12830 | |
| 12831 | VkResult VkEncoder::vkGetDisplayModePropertiesKHR( |
| 12832 | VkPhysicalDevice physicalDevice, |
| 12833 | VkDisplayKHR display, |
| 12834 | uint32_t* pPropertyCount, |
| 12835 | VkDisplayModePropertiesKHR* pProperties) |
| 12836 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 12837 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 12838 | mImpl->log("start vkGetDisplayModePropertiesKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12839 | auto stream = mImpl->stream(); |
| 12840 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12841 | auto resources = mImpl->resources(); |
| 12842 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12843 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12844 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12845 | VkDisplayKHR local_display; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 12846 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12847 | local_display = display; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12848 | countingStream->rewind(); |
| 12849 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12850 | uint64_t cgen_var_888; |
| 12851 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_888, 1); |
| 12852 | countingStream->write((uint64_t*)&cgen_var_888, 1 * 8); |
| 12853 | uint64_t cgen_var_889; |
| 12854 | countingStream->handleMapping()->mapHandles_VkDisplayKHR_u64(&local_display, &cgen_var_889, 1); |
| 12855 | countingStream->write((uint64_t*)&cgen_var_889, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12856 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12857 | uint64_t cgen_var_890 = (uint64_t)(uintptr_t)pPropertyCount; |
| 12858 | countingStream->putBe64(cgen_var_890); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12859 | if (pPropertyCount) |
| 12860 | { |
| 12861 | countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 12862 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12863 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12864 | uint64_t cgen_var_891 = (uint64_t)(uintptr_t)pProperties; |
| 12865 | countingStream->putBe64(cgen_var_891); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12866 | if (pProperties) |
| 12867 | { |
| 12868 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 12869 | { |
| 12870 | marshal_VkDisplayModePropertiesKHR(countingStream, (VkDisplayModePropertiesKHR*)(pProperties + i)); |
| 12871 | } |
| 12872 | } |
| 12873 | } |
| 12874 | uint32_t packetSize_vkGetDisplayModePropertiesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 12875 | countingStream->rewind(); |
| 12876 | uint32_t opcode_vkGetDisplayModePropertiesKHR = OP_vkGetDisplayModePropertiesKHR; |
| 12877 | stream->write(&opcode_vkGetDisplayModePropertiesKHR, sizeof(uint32_t)); |
| 12878 | stream->write(&packetSize_vkGetDisplayModePropertiesKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12879 | uint64_t cgen_var_892; |
| 12880 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_892, 1); |
| 12881 | stream->write((uint64_t*)&cgen_var_892, 1 * 8); |
| 12882 | uint64_t cgen_var_893; |
| 12883 | stream->handleMapping()->mapHandles_VkDisplayKHR_u64(&local_display, &cgen_var_893, 1); |
| 12884 | stream->write((uint64_t*)&cgen_var_893, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12885 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12886 | uint64_t cgen_var_894 = (uint64_t)(uintptr_t)pPropertyCount; |
| 12887 | stream->putBe64(cgen_var_894); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12888 | if (pPropertyCount) |
| 12889 | { |
| 12890 | stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 12891 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12892 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12893 | uint64_t cgen_var_895 = (uint64_t)(uintptr_t)pProperties; |
| 12894 | stream->putBe64(cgen_var_895); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12895 | if (pProperties) |
| 12896 | { |
| 12897 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 12898 | { |
| 12899 | marshal_VkDisplayModePropertiesKHR(stream, (VkDisplayModePropertiesKHR*)(pProperties + i)); |
| 12900 | } |
| 12901 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12902 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12903 | uint32_t* check_pPropertyCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12904 | check_pPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12905 | if (pPropertyCount) |
| 12906 | { |
| 12907 | if (!(check_pPropertyCount)) |
| 12908 | { |
| 12909 | fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n"); |
| 12910 | } |
| 12911 | stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 12912 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12913 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12914 | VkDisplayModePropertiesKHR* check_pProperties; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12915 | check_pProperties = (VkDisplayModePropertiesKHR*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12916 | if (pProperties) |
| 12917 | { |
| 12918 | if (!(check_pProperties)) |
| 12919 | { |
| 12920 | fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n"); |
| 12921 | } |
| 12922 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 12923 | { |
| 12924 | unmarshal_VkDisplayModePropertiesKHR(stream, (VkDisplayModePropertiesKHR*)(pProperties + i)); |
| 12925 | } |
| 12926 | } |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 12927 | if (pProperties) |
| 12928 | { |
| 12929 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 12930 | { |
| 12931 | transform_fromhost_VkDisplayModePropertiesKHR(mImpl->resources(), (VkDisplayModePropertiesKHR*)(pProperties + i)); |
| 12932 | } |
| 12933 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12934 | VkResult vkGetDisplayModePropertiesKHR_VkResult_return = (VkResult)0; |
| 12935 | stream->read(&vkGetDisplayModePropertiesKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 12936 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 12937 | countingStream->clearPool(); |
| 12938 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 12939 | mImpl->log("finish vkGetDisplayModePropertiesKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12940 | return vkGetDisplayModePropertiesKHR_VkResult_return; |
| 12941 | } |
| 12942 | |
| 12943 | VkResult VkEncoder::vkCreateDisplayModeKHR( |
| 12944 | VkPhysicalDevice physicalDevice, |
| 12945 | VkDisplayKHR display, |
| 12946 | const VkDisplayModeCreateInfoKHR* pCreateInfo, |
| 12947 | const VkAllocationCallbacks* pAllocator, |
| 12948 | VkDisplayModeKHR* pMode) |
| 12949 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 12950 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 12951 | mImpl->log("start vkCreateDisplayModeKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12952 | auto stream = mImpl->stream(); |
| 12953 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12954 | auto resources = mImpl->resources(); |
| 12955 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 12956 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12957 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12958 | VkDisplayKHR local_display; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12959 | VkDisplayModeCreateInfoKHR* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 12960 | VkAllocationCallbacks* local_pAllocator; |
| 12961 | local_physicalDevice = physicalDevice; |
| 12962 | local_display = display; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12963 | local_pCreateInfo = nullptr; |
| 12964 | if (pCreateInfo) |
| 12965 | { |
| 12966 | local_pCreateInfo = (VkDisplayModeCreateInfoKHR*)pool->alloc(sizeof(const VkDisplayModeCreateInfoKHR)); |
| 12967 | deepcopy_VkDisplayModeCreateInfoKHR(pool, pCreateInfo, (VkDisplayModeCreateInfoKHR*)(local_pCreateInfo)); |
| 12968 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12969 | local_pAllocator = nullptr; |
| 12970 | if (pAllocator) |
| 12971 | { |
| 12972 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 12973 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 12974 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 12975 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 12976 | if (local_pCreateInfo) |
| 12977 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 12978 | transform_tohost_VkDisplayModeCreateInfoKHR(mImpl->resources(), (VkDisplayModeCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 12979 | } |
| 12980 | if (local_pAllocator) |
| 12981 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 12982 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 12983 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12984 | countingStream->rewind(); |
| 12985 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12986 | uint64_t cgen_var_898; |
| 12987 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_898, 1); |
| 12988 | countingStream->write((uint64_t*)&cgen_var_898, 1 * 8); |
| 12989 | uint64_t cgen_var_899; |
| 12990 | countingStream->handleMapping()->mapHandles_VkDisplayKHR_u64(&local_display, &cgen_var_899, 1); |
| 12991 | countingStream->write((uint64_t*)&cgen_var_899, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12992 | marshal_VkDisplayModeCreateInfoKHR(countingStream, (VkDisplayModeCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 12993 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 12994 | uint64_t cgen_var_900 = (uint64_t)(uintptr_t)local_pAllocator; |
| 12995 | countingStream->putBe64(cgen_var_900); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12996 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12997 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 12998 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 12999 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13000 | uint64_t cgen_var_901; |
| 13001 | countingStream->handleMapping()->mapHandles_VkDisplayModeKHR_u64(pMode, &cgen_var_901, 1); |
| 13002 | countingStream->write((uint64_t*)&cgen_var_901, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13003 | } |
| 13004 | uint32_t packetSize_vkCreateDisplayModeKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 13005 | countingStream->rewind(); |
| 13006 | uint32_t opcode_vkCreateDisplayModeKHR = OP_vkCreateDisplayModeKHR; |
| 13007 | stream->write(&opcode_vkCreateDisplayModeKHR, sizeof(uint32_t)); |
| 13008 | stream->write(&packetSize_vkCreateDisplayModeKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13009 | uint64_t cgen_var_902; |
| 13010 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_902, 1); |
| 13011 | stream->write((uint64_t*)&cgen_var_902, 1 * 8); |
| 13012 | uint64_t cgen_var_903; |
| 13013 | stream->handleMapping()->mapHandles_VkDisplayKHR_u64(&local_display, &cgen_var_903, 1); |
| 13014 | stream->write((uint64_t*)&cgen_var_903, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13015 | marshal_VkDisplayModeCreateInfoKHR(stream, (VkDisplayModeCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13016 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13017 | uint64_t cgen_var_904 = (uint64_t)(uintptr_t)local_pAllocator; |
| 13018 | stream->putBe64(cgen_var_904); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13019 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13020 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13021 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13022 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13023 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13024 | uint64_t cgen_var_905; |
| 13025 | stream->handleMapping()->mapHandles_VkDisplayModeKHR_u64(pMode, &cgen_var_905, 1); |
| 13026 | stream->write((uint64_t*)&cgen_var_905, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13027 | stream->setHandleMapping(resources->unwrapMapping()); |
| 13028 | stream->setHandleMapping(resources->createMapping()); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13029 | uint64_t cgen_var_906; |
| 13030 | stream->read((uint64_t*)&cgen_var_906, 8); |
| 13031 | stream->handleMapping()->mapHandles_u64_VkDisplayModeKHR(&cgen_var_906, (VkDisplayModeKHR*)pMode, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13032 | stream->unsetHandleMapping(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13033 | VkResult vkCreateDisplayModeKHR_VkResult_return = (VkResult)0; |
| 13034 | stream->read(&vkCreateDisplayModeKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 13035 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13036 | countingStream->clearPool(); |
| 13037 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 13038 | mImpl->log("finish vkCreateDisplayModeKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13039 | return vkCreateDisplayModeKHR_VkResult_return; |
| 13040 | } |
| 13041 | |
| 13042 | VkResult VkEncoder::vkGetDisplayPlaneCapabilitiesKHR( |
| 13043 | VkPhysicalDevice physicalDevice, |
| 13044 | VkDisplayModeKHR mode, |
| 13045 | uint32_t planeIndex, |
| 13046 | VkDisplayPlaneCapabilitiesKHR* pCapabilities) |
| 13047 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 13048 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 13049 | mImpl->log("start vkGetDisplayPlaneCapabilitiesKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13050 | auto stream = mImpl->stream(); |
| 13051 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13052 | auto resources = mImpl->resources(); |
| 13053 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13054 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13055 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13056 | VkDisplayModeKHR local_mode; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13057 | uint32_t local_planeIndex; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 13058 | local_physicalDevice = physicalDevice; |
| 13059 | local_mode = mode; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13060 | local_planeIndex = planeIndex; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13061 | countingStream->rewind(); |
| 13062 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13063 | uint64_t cgen_var_907; |
| 13064 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_907, 1); |
| 13065 | countingStream->write((uint64_t*)&cgen_var_907, 1 * 8); |
| 13066 | uint64_t cgen_var_908; |
| 13067 | countingStream->handleMapping()->mapHandles_VkDisplayModeKHR_u64(&local_mode, &cgen_var_908, 1); |
| 13068 | countingStream->write((uint64_t*)&cgen_var_908, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13069 | countingStream->write((uint32_t*)&local_planeIndex, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13070 | marshal_VkDisplayPlaneCapabilitiesKHR(countingStream, (VkDisplayPlaneCapabilitiesKHR*)(pCapabilities)); |
| 13071 | } |
| 13072 | uint32_t packetSize_vkGetDisplayPlaneCapabilitiesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 13073 | countingStream->rewind(); |
| 13074 | uint32_t opcode_vkGetDisplayPlaneCapabilitiesKHR = OP_vkGetDisplayPlaneCapabilitiesKHR; |
| 13075 | stream->write(&opcode_vkGetDisplayPlaneCapabilitiesKHR, sizeof(uint32_t)); |
| 13076 | stream->write(&packetSize_vkGetDisplayPlaneCapabilitiesKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13077 | uint64_t cgen_var_909; |
| 13078 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_909, 1); |
| 13079 | stream->write((uint64_t*)&cgen_var_909, 1 * 8); |
| 13080 | uint64_t cgen_var_910; |
| 13081 | stream->handleMapping()->mapHandles_VkDisplayModeKHR_u64(&local_mode, &cgen_var_910, 1); |
| 13082 | stream->write((uint64_t*)&cgen_var_910, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13083 | stream->write((uint32_t*)&local_planeIndex, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13084 | marshal_VkDisplayPlaneCapabilitiesKHR(stream, (VkDisplayPlaneCapabilitiesKHR*)(pCapabilities)); |
| 13085 | unmarshal_VkDisplayPlaneCapabilitiesKHR(stream, (VkDisplayPlaneCapabilitiesKHR*)(pCapabilities)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 13086 | if (pCapabilities) |
| 13087 | { |
| 13088 | transform_fromhost_VkDisplayPlaneCapabilitiesKHR(mImpl->resources(), (VkDisplayPlaneCapabilitiesKHR*)(pCapabilities)); |
| 13089 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13090 | VkResult vkGetDisplayPlaneCapabilitiesKHR_VkResult_return = (VkResult)0; |
| 13091 | stream->read(&vkGetDisplayPlaneCapabilitiesKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 13092 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13093 | countingStream->clearPool(); |
| 13094 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 13095 | mImpl->log("finish vkGetDisplayPlaneCapabilitiesKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13096 | return vkGetDisplayPlaneCapabilitiesKHR_VkResult_return; |
| 13097 | } |
| 13098 | |
| 13099 | VkResult VkEncoder::vkCreateDisplayPlaneSurfaceKHR( |
| 13100 | VkInstance instance, |
| 13101 | const VkDisplaySurfaceCreateInfoKHR* pCreateInfo, |
| 13102 | const VkAllocationCallbacks* pAllocator, |
| 13103 | VkSurfaceKHR* pSurface) |
| 13104 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 13105 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 13106 | mImpl->log("start vkCreateDisplayPlaneSurfaceKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13107 | auto stream = mImpl->stream(); |
| 13108 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13109 | auto resources = mImpl->resources(); |
| 13110 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13111 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13112 | VkInstance local_instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13113 | VkDisplaySurfaceCreateInfoKHR* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 13114 | VkAllocationCallbacks* local_pAllocator; |
| 13115 | local_instance = instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13116 | local_pCreateInfo = nullptr; |
| 13117 | if (pCreateInfo) |
| 13118 | { |
| 13119 | local_pCreateInfo = (VkDisplaySurfaceCreateInfoKHR*)pool->alloc(sizeof(const VkDisplaySurfaceCreateInfoKHR)); |
| 13120 | deepcopy_VkDisplaySurfaceCreateInfoKHR(pool, pCreateInfo, (VkDisplaySurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| 13121 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13122 | local_pAllocator = nullptr; |
| 13123 | if (pAllocator) |
| 13124 | { |
| 13125 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 13126 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 13127 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 13128 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 13129 | if (local_pCreateInfo) |
| 13130 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 13131 | transform_tohost_VkDisplaySurfaceCreateInfoKHR(mImpl->resources(), (VkDisplaySurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 13132 | } |
| 13133 | if (local_pAllocator) |
| 13134 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 13135 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 13136 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13137 | countingStream->rewind(); |
| 13138 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13139 | uint64_t cgen_var_911; |
| 13140 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_911, 1); |
| 13141 | countingStream->write((uint64_t*)&cgen_var_911, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13142 | marshal_VkDisplaySurfaceCreateInfoKHR(countingStream, (VkDisplaySurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13143 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13144 | uint64_t cgen_var_912 = (uint64_t)(uintptr_t)local_pAllocator; |
| 13145 | countingStream->putBe64(cgen_var_912); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13146 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13147 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13148 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13149 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13150 | uint64_t cgen_var_913; |
| 13151 | countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_913, 1); |
| 13152 | countingStream->write((uint64_t*)&cgen_var_913, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13153 | } |
| 13154 | uint32_t packetSize_vkCreateDisplayPlaneSurfaceKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 13155 | countingStream->rewind(); |
| 13156 | uint32_t opcode_vkCreateDisplayPlaneSurfaceKHR = OP_vkCreateDisplayPlaneSurfaceKHR; |
| 13157 | stream->write(&opcode_vkCreateDisplayPlaneSurfaceKHR, sizeof(uint32_t)); |
| 13158 | stream->write(&packetSize_vkCreateDisplayPlaneSurfaceKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13159 | uint64_t cgen_var_914; |
| 13160 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_914, 1); |
| 13161 | stream->write((uint64_t*)&cgen_var_914, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13162 | marshal_VkDisplaySurfaceCreateInfoKHR(stream, (VkDisplaySurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13163 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13164 | uint64_t cgen_var_915 = (uint64_t)(uintptr_t)local_pAllocator; |
| 13165 | stream->putBe64(cgen_var_915); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13166 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13167 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13168 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13169 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13170 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13171 | uint64_t cgen_var_916; |
| 13172 | stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_916, 1); |
| 13173 | stream->write((uint64_t*)&cgen_var_916, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13174 | stream->setHandleMapping(resources->unwrapMapping()); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13175 | uint64_t cgen_var_917; |
| 13176 | stream->read((uint64_t*)&cgen_var_917, 8); |
| 13177 | stream->handleMapping()->mapHandles_u64_VkSurfaceKHR(&cgen_var_917, (VkSurfaceKHR*)pSurface, 1); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13178 | VkResult vkCreateDisplayPlaneSurfaceKHR_VkResult_return = (VkResult)0; |
| 13179 | stream->read(&vkCreateDisplayPlaneSurfaceKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 13180 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13181 | countingStream->clearPool(); |
| 13182 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 13183 | mImpl->log("finish vkCreateDisplayPlaneSurfaceKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13184 | return vkCreateDisplayPlaneSurfaceKHR_VkResult_return; |
| 13185 | } |
| 13186 | |
| 13187 | #endif |
| 13188 | #ifdef VK_KHR_display_swapchain |
| 13189 | VkResult VkEncoder::vkCreateSharedSwapchainsKHR( |
| 13190 | VkDevice device, |
| 13191 | uint32_t swapchainCount, |
| 13192 | const VkSwapchainCreateInfoKHR* pCreateInfos, |
| 13193 | const VkAllocationCallbacks* pAllocator, |
| 13194 | VkSwapchainKHR* pSwapchains) |
| 13195 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 13196 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 13197 | mImpl->log("start vkCreateSharedSwapchainsKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13198 | auto stream = mImpl->stream(); |
| 13199 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13200 | auto resources = mImpl->resources(); |
| 13201 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13202 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13203 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13204 | uint32_t local_swapchainCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13205 | VkSwapchainCreateInfoKHR* local_pCreateInfos; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 13206 | VkAllocationCallbacks* local_pAllocator; |
| 13207 | local_device = device; |
| 13208 | local_swapchainCount = swapchainCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13209 | local_pCreateInfos = nullptr; |
| 13210 | if (pCreateInfos) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13211 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13212 | local_pCreateInfos = (VkSwapchainCreateInfoKHR*)pool->alloc(((swapchainCount)) * sizeof(const VkSwapchainCreateInfoKHR)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13213 | for (uint32_t i = 0; i < (uint32_t)((swapchainCount)); ++i) |
| 13214 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13215 | deepcopy_VkSwapchainCreateInfoKHR(pool, pCreateInfos + i, (VkSwapchainCreateInfoKHR*)(local_pCreateInfos + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13216 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13217 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13218 | local_pAllocator = nullptr; |
| 13219 | if (pAllocator) |
| 13220 | { |
| 13221 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 13222 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 13223 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 13224 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 13225 | if (local_pCreateInfos) |
| 13226 | { |
| 13227 | for (uint32_t i = 0; i < (uint32_t)((swapchainCount)); ++i) |
| 13228 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 13229 | transform_tohost_VkSwapchainCreateInfoKHR(mImpl->resources(), (VkSwapchainCreateInfoKHR*)(local_pCreateInfos + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 13230 | } |
| 13231 | } |
| 13232 | if (local_pAllocator) |
| 13233 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 13234 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 13235 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13236 | countingStream->rewind(); |
| 13237 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13238 | uint64_t cgen_var_918; |
| 13239 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_918, 1); |
| 13240 | countingStream->write((uint64_t*)&cgen_var_918, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13241 | countingStream->write((uint32_t*)&local_swapchainCount, sizeof(uint32_t)); |
| 13242 | for (uint32_t i = 0; i < (uint32_t)((swapchainCount)); ++i) |
| 13243 | { |
| 13244 | marshal_VkSwapchainCreateInfoKHR(countingStream, (VkSwapchainCreateInfoKHR*)(local_pCreateInfos + i)); |
| 13245 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13246 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13247 | uint64_t cgen_var_919 = (uint64_t)(uintptr_t)local_pAllocator; |
| 13248 | countingStream->putBe64(cgen_var_919); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13249 | if (local_pAllocator) |
| 13250 | { |
| 13251 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13252 | } |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13253 | if (((swapchainCount))) |
| 13254 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13255 | uint64_t* cgen_var_920; |
| 13256 | countingStream->alloc((void**)&cgen_var_920, ((swapchainCount)) * 8); |
| 13257 | countingStream->handleMapping()->mapHandles_VkSwapchainKHR_u64(pSwapchains, cgen_var_920, ((swapchainCount))); |
| 13258 | countingStream->write((uint64_t*)cgen_var_920, ((swapchainCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13259 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13260 | } |
| 13261 | uint32_t packetSize_vkCreateSharedSwapchainsKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 13262 | countingStream->rewind(); |
| 13263 | uint32_t opcode_vkCreateSharedSwapchainsKHR = OP_vkCreateSharedSwapchainsKHR; |
| 13264 | stream->write(&opcode_vkCreateSharedSwapchainsKHR, sizeof(uint32_t)); |
| 13265 | stream->write(&packetSize_vkCreateSharedSwapchainsKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13266 | uint64_t cgen_var_921; |
| 13267 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_921, 1); |
| 13268 | stream->write((uint64_t*)&cgen_var_921, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13269 | stream->write((uint32_t*)&local_swapchainCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13270 | for (uint32_t i = 0; i < (uint32_t)((swapchainCount)); ++i) |
| 13271 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13272 | marshal_VkSwapchainCreateInfoKHR(stream, (VkSwapchainCreateInfoKHR*)(local_pCreateInfos + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13273 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13274 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13275 | uint64_t cgen_var_922 = (uint64_t)(uintptr_t)local_pAllocator; |
| 13276 | stream->putBe64(cgen_var_922); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13277 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13278 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13279 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13280 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13281 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13282 | if (((swapchainCount))) |
| 13283 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13284 | uint64_t* cgen_var_923; |
| 13285 | stream->alloc((void**)&cgen_var_923, ((swapchainCount)) * 8); |
| 13286 | stream->handleMapping()->mapHandles_VkSwapchainKHR_u64(pSwapchains, cgen_var_923, ((swapchainCount))); |
| 13287 | stream->write((uint64_t*)cgen_var_923, ((swapchainCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13288 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13289 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13290 | if (((swapchainCount))) |
| 13291 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13292 | uint64_t* cgen_var_924; |
| 13293 | stream->alloc((void**)&cgen_var_924, ((swapchainCount)) * 8); |
| 13294 | stream->read((uint64_t*)cgen_var_924, ((swapchainCount)) * 8); |
| 13295 | stream->handleMapping()->mapHandles_u64_VkSwapchainKHR(cgen_var_924, (VkSwapchainKHR*)pSwapchains, ((swapchainCount))); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13296 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13297 | VkResult vkCreateSharedSwapchainsKHR_VkResult_return = (VkResult)0; |
| 13298 | stream->read(&vkCreateSharedSwapchainsKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 13299 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13300 | countingStream->clearPool(); |
| 13301 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 13302 | mImpl->log("finish vkCreateSharedSwapchainsKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13303 | return vkCreateSharedSwapchainsKHR_VkResult_return; |
| 13304 | } |
| 13305 | |
| 13306 | #endif |
| 13307 | #ifdef VK_KHR_xlib_surface |
| 13308 | VkResult VkEncoder::vkCreateXlibSurfaceKHR( |
| 13309 | VkInstance instance, |
| 13310 | const VkXlibSurfaceCreateInfoKHR* pCreateInfo, |
| 13311 | const VkAllocationCallbacks* pAllocator, |
| 13312 | VkSurfaceKHR* pSurface) |
| 13313 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 13314 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 13315 | mImpl->log("start vkCreateXlibSurfaceKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13316 | auto stream = mImpl->stream(); |
| 13317 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13318 | auto resources = mImpl->resources(); |
| 13319 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13320 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13321 | VkInstance local_instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13322 | VkXlibSurfaceCreateInfoKHR* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 13323 | VkAllocationCallbacks* local_pAllocator; |
| 13324 | local_instance = instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13325 | local_pCreateInfo = nullptr; |
| 13326 | if (pCreateInfo) |
| 13327 | { |
| 13328 | local_pCreateInfo = (VkXlibSurfaceCreateInfoKHR*)pool->alloc(sizeof(const VkXlibSurfaceCreateInfoKHR)); |
| 13329 | deepcopy_VkXlibSurfaceCreateInfoKHR(pool, pCreateInfo, (VkXlibSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| 13330 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13331 | local_pAllocator = nullptr; |
| 13332 | if (pAllocator) |
| 13333 | { |
| 13334 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 13335 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 13336 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 13337 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 13338 | if (local_pCreateInfo) |
| 13339 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 13340 | transform_tohost_VkXlibSurfaceCreateInfoKHR(mImpl->resources(), (VkXlibSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 13341 | } |
| 13342 | if (local_pAllocator) |
| 13343 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 13344 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 13345 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13346 | countingStream->rewind(); |
| 13347 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13348 | uint64_t cgen_var_925; |
| 13349 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_925, 1); |
| 13350 | countingStream->write((uint64_t*)&cgen_var_925, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13351 | marshal_VkXlibSurfaceCreateInfoKHR(countingStream, (VkXlibSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13352 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13353 | uint64_t cgen_var_926 = (uint64_t)(uintptr_t)local_pAllocator; |
| 13354 | countingStream->putBe64(cgen_var_926); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13355 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13356 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13357 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13358 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13359 | uint64_t cgen_var_927; |
| 13360 | countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_927, 1); |
| 13361 | countingStream->write((uint64_t*)&cgen_var_927, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13362 | } |
| 13363 | uint32_t packetSize_vkCreateXlibSurfaceKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 13364 | countingStream->rewind(); |
| 13365 | uint32_t opcode_vkCreateXlibSurfaceKHR = OP_vkCreateXlibSurfaceKHR; |
| 13366 | stream->write(&opcode_vkCreateXlibSurfaceKHR, sizeof(uint32_t)); |
| 13367 | stream->write(&packetSize_vkCreateXlibSurfaceKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13368 | uint64_t cgen_var_928; |
| 13369 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_928, 1); |
| 13370 | stream->write((uint64_t*)&cgen_var_928, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13371 | marshal_VkXlibSurfaceCreateInfoKHR(stream, (VkXlibSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13372 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13373 | uint64_t cgen_var_929 = (uint64_t)(uintptr_t)local_pAllocator; |
| 13374 | stream->putBe64(cgen_var_929); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13375 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13376 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13377 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13378 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13379 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13380 | uint64_t cgen_var_930; |
| 13381 | stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_930, 1); |
| 13382 | stream->write((uint64_t*)&cgen_var_930, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13383 | stream->setHandleMapping(resources->unwrapMapping()); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13384 | uint64_t cgen_var_931; |
| 13385 | stream->read((uint64_t*)&cgen_var_931, 8); |
| 13386 | stream->handleMapping()->mapHandles_u64_VkSurfaceKHR(&cgen_var_931, (VkSurfaceKHR*)pSurface, 1); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13387 | VkResult vkCreateXlibSurfaceKHR_VkResult_return = (VkResult)0; |
| 13388 | stream->read(&vkCreateXlibSurfaceKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 13389 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13390 | countingStream->clearPool(); |
| 13391 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 13392 | mImpl->log("finish vkCreateXlibSurfaceKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13393 | return vkCreateXlibSurfaceKHR_VkResult_return; |
| 13394 | } |
| 13395 | |
| 13396 | VkBool32 VkEncoder::vkGetPhysicalDeviceXlibPresentationSupportKHR( |
| 13397 | VkPhysicalDevice physicalDevice, |
| 13398 | uint32_t queueFamilyIndex, |
| 13399 | Display* dpy, |
| 13400 | VisualID visualID) |
| 13401 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 13402 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 13403 | mImpl->log("start vkGetPhysicalDeviceXlibPresentationSupportKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13404 | auto stream = mImpl->stream(); |
| 13405 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13406 | auto resources = mImpl->resources(); |
| 13407 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13408 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13409 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13410 | uint32_t local_queueFamilyIndex; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13411 | VisualID local_visualID; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 13412 | local_physicalDevice = physicalDevice; |
| 13413 | local_queueFamilyIndex = queueFamilyIndex; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13414 | local_visualID = visualID; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13415 | countingStream->rewind(); |
| 13416 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13417 | uint64_t cgen_var_932; |
| 13418 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_932, 1); |
| 13419 | countingStream->write((uint64_t*)&cgen_var_932, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13420 | countingStream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13421 | countingStream->write((Display*)dpy, sizeof(Display)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13422 | countingStream->write((VisualID*)&local_visualID, sizeof(VisualID)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13423 | } |
| 13424 | uint32_t packetSize_vkGetPhysicalDeviceXlibPresentationSupportKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 13425 | countingStream->rewind(); |
| 13426 | uint32_t opcode_vkGetPhysicalDeviceXlibPresentationSupportKHR = OP_vkGetPhysicalDeviceXlibPresentationSupportKHR; |
| 13427 | stream->write(&opcode_vkGetPhysicalDeviceXlibPresentationSupportKHR, sizeof(uint32_t)); |
| 13428 | stream->write(&packetSize_vkGetPhysicalDeviceXlibPresentationSupportKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13429 | uint64_t cgen_var_933; |
| 13430 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_933, 1); |
| 13431 | stream->write((uint64_t*)&cgen_var_933, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13432 | stream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13433 | stream->write((Display*)dpy, sizeof(Display)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13434 | stream->write((VisualID*)&local_visualID, sizeof(VisualID)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13435 | stream->read((Display*)dpy, sizeof(Display)); |
| 13436 | VkBool32 vkGetPhysicalDeviceXlibPresentationSupportKHR_VkBool32_return = (VkBool32)0; |
| 13437 | stream->read(&vkGetPhysicalDeviceXlibPresentationSupportKHR_VkBool32_return, sizeof(VkBool32)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 13438 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13439 | countingStream->clearPool(); |
| 13440 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 13441 | mImpl->log("finish vkGetPhysicalDeviceXlibPresentationSupportKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13442 | return vkGetPhysicalDeviceXlibPresentationSupportKHR_VkBool32_return; |
| 13443 | } |
| 13444 | |
| 13445 | #endif |
| 13446 | #ifdef VK_KHR_xcb_surface |
| 13447 | VkResult VkEncoder::vkCreateXcbSurfaceKHR( |
| 13448 | VkInstance instance, |
| 13449 | const VkXcbSurfaceCreateInfoKHR* pCreateInfo, |
| 13450 | const VkAllocationCallbacks* pAllocator, |
| 13451 | VkSurfaceKHR* pSurface) |
| 13452 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 13453 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 13454 | mImpl->log("start vkCreateXcbSurfaceKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13455 | auto stream = mImpl->stream(); |
| 13456 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13457 | auto resources = mImpl->resources(); |
| 13458 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13459 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13460 | VkInstance local_instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13461 | VkXcbSurfaceCreateInfoKHR* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 13462 | VkAllocationCallbacks* local_pAllocator; |
| 13463 | local_instance = instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13464 | local_pCreateInfo = nullptr; |
| 13465 | if (pCreateInfo) |
| 13466 | { |
| 13467 | local_pCreateInfo = (VkXcbSurfaceCreateInfoKHR*)pool->alloc(sizeof(const VkXcbSurfaceCreateInfoKHR)); |
| 13468 | deepcopy_VkXcbSurfaceCreateInfoKHR(pool, pCreateInfo, (VkXcbSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| 13469 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13470 | local_pAllocator = nullptr; |
| 13471 | if (pAllocator) |
| 13472 | { |
| 13473 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 13474 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 13475 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 13476 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 13477 | if (local_pCreateInfo) |
| 13478 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 13479 | transform_tohost_VkXcbSurfaceCreateInfoKHR(mImpl->resources(), (VkXcbSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 13480 | } |
| 13481 | if (local_pAllocator) |
| 13482 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 13483 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 13484 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13485 | countingStream->rewind(); |
| 13486 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13487 | uint64_t cgen_var_934; |
| 13488 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_934, 1); |
| 13489 | countingStream->write((uint64_t*)&cgen_var_934, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13490 | marshal_VkXcbSurfaceCreateInfoKHR(countingStream, (VkXcbSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13491 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13492 | uint64_t cgen_var_935 = (uint64_t)(uintptr_t)local_pAllocator; |
| 13493 | countingStream->putBe64(cgen_var_935); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13494 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13495 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13496 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13497 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13498 | uint64_t cgen_var_936; |
| 13499 | countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_936, 1); |
| 13500 | countingStream->write((uint64_t*)&cgen_var_936, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13501 | } |
| 13502 | uint32_t packetSize_vkCreateXcbSurfaceKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 13503 | countingStream->rewind(); |
| 13504 | uint32_t opcode_vkCreateXcbSurfaceKHR = OP_vkCreateXcbSurfaceKHR; |
| 13505 | stream->write(&opcode_vkCreateXcbSurfaceKHR, sizeof(uint32_t)); |
| 13506 | stream->write(&packetSize_vkCreateXcbSurfaceKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13507 | uint64_t cgen_var_937; |
| 13508 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_937, 1); |
| 13509 | stream->write((uint64_t*)&cgen_var_937, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13510 | marshal_VkXcbSurfaceCreateInfoKHR(stream, (VkXcbSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13511 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13512 | uint64_t cgen_var_938 = (uint64_t)(uintptr_t)local_pAllocator; |
| 13513 | stream->putBe64(cgen_var_938); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13514 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13515 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13516 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13517 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13518 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13519 | uint64_t cgen_var_939; |
| 13520 | stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_939, 1); |
| 13521 | stream->write((uint64_t*)&cgen_var_939, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13522 | stream->setHandleMapping(resources->unwrapMapping()); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13523 | uint64_t cgen_var_940; |
| 13524 | stream->read((uint64_t*)&cgen_var_940, 8); |
| 13525 | stream->handleMapping()->mapHandles_u64_VkSurfaceKHR(&cgen_var_940, (VkSurfaceKHR*)pSurface, 1); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13526 | VkResult vkCreateXcbSurfaceKHR_VkResult_return = (VkResult)0; |
| 13527 | stream->read(&vkCreateXcbSurfaceKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 13528 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13529 | countingStream->clearPool(); |
| 13530 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 13531 | mImpl->log("finish vkCreateXcbSurfaceKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13532 | return vkCreateXcbSurfaceKHR_VkResult_return; |
| 13533 | } |
| 13534 | |
| 13535 | VkBool32 VkEncoder::vkGetPhysicalDeviceXcbPresentationSupportKHR( |
| 13536 | VkPhysicalDevice physicalDevice, |
| 13537 | uint32_t queueFamilyIndex, |
| 13538 | xcb_connection_t* connection, |
| 13539 | xcb_visualid_t visual_id) |
| 13540 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 13541 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 13542 | mImpl->log("start vkGetPhysicalDeviceXcbPresentationSupportKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13543 | auto stream = mImpl->stream(); |
| 13544 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13545 | auto resources = mImpl->resources(); |
| 13546 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13547 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13548 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13549 | uint32_t local_queueFamilyIndex; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13550 | xcb_visualid_t local_visual_id; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 13551 | local_physicalDevice = physicalDevice; |
| 13552 | local_queueFamilyIndex = queueFamilyIndex; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13553 | local_visual_id = visual_id; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13554 | countingStream->rewind(); |
| 13555 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13556 | uint64_t cgen_var_941; |
| 13557 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_941, 1); |
| 13558 | countingStream->write((uint64_t*)&cgen_var_941, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13559 | countingStream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13560 | countingStream->write((xcb_connection_t*)connection, sizeof(xcb_connection_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13561 | countingStream->write((xcb_visualid_t*)&local_visual_id, sizeof(xcb_visualid_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13562 | } |
| 13563 | uint32_t packetSize_vkGetPhysicalDeviceXcbPresentationSupportKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 13564 | countingStream->rewind(); |
| 13565 | uint32_t opcode_vkGetPhysicalDeviceXcbPresentationSupportKHR = OP_vkGetPhysicalDeviceXcbPresentationSupportKHR; |
| 13566 | stream->write(&opcode_vkGetPhysicalDeviceXcbPresentationSupportKHR, sizeof(uint32_t)); |
| 13567 | stream->write(&packetSize_vkGetPhysicalDeviceXcbPresentationSupportKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13568 | uint64_t cgen_var_942; |
| 13569 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_942, 1); |
| 13570 | stream->write((uint64_t*)&cgen_var_942, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13571 | stream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13572 | stream->write((xcb_connection_t*)connection, sizeof(xcb_connection_t)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13573 | stream->write((xcb_visualid_t*)&local_visual_id, sizeof(xcb_visualid_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13574 | stream->read((xcb_connection_t*)connection, sizeof(xcb_connection_t)); |
| 13575 | VkBool32 vkGetPhysicalDeviceXcbPresentationSupportKHR_VkBool32_return = (VkBool32)0; |
| 13576 | stream->read(&vkGetPhysicalDeviceXcbPresentationSupportKHR_VkBool32_return, sizeof(VkBool32)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 13577 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13578 | countingStream->clearPool(); |
| 13579 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 13580 | mImpl->log("finish vkGetPhysicalDeviceXcbPresentationSupportKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13581 | return vkGetPhysicalDeviceXcbPresentationSupportKHR_VkBool32_return; |
| 13582 | } |
| 13583 | |
| 13584 | #endif |
| 13585 | #ifdef VK_KHR_wayland_surface |
| 13586 | VkResult VkEncoder::vkCreateWaylandSurfaceKHR( |
| 13587 | VkInstance instance, |
| 13588 | const VkWaylandSurfaceCreateInfoKHR* pCreateInfo, |
| 13589 | const VkAllocationCallbacks* pAllocator, |
| 13590 | VkSurfaceKHR* pSurface) |
| 13591 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 13592 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 13593 | mImpl->log("start vkCreateWaylandSurfaceKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13594 | auto stream = mImpl->stream(); |
| 13595 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13596 | auto resources = mImpl->resources(); |
| 13597 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13598 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13599 | VkInstance local_instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13600 | VkWaylandSurfaceCreateInfoKHR* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 13601 | VkAllocationCallbacks* local_pAllocator; |
| 13602 | local_instance = instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13603 | local_pCreateInfo = nullptr; |
| 13604 | if (pCreateInfo) |
| 13605 | { |
| 13606 | local_pCreateInfo = (VkWaylandSurfaceCreateInfoKHR*)pool->alloc(sizeof(const VkWaylandSurfaceCreateInfoKHR)); |
| 13607 | deepcopy_VkWaylandSurfaceCreateInfoKHR(pool, pCreateInfo, (VkWaylandSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| 13608 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13609 | local_pAllocator = nullptr; |
| 13610 | if (pAllocator) |
| 13611 | { |
| 13612 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 13613 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 13614 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 13615 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 13616 | if (local_pCreateInfo) |
| 13617 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 13618 | transform_tohost_VkWaylandSurfaceCreateInfoKHR(mImpl->resources(), (VkWaylandSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 13619 | } |
| 13620 | if (local_pAllocator) |
| 13621 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 13622 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 13623 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13624 | countingStream->rewind(); |
| 13625 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13626 | uint64_t cgen_var_943; |
| 13627 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_943, 1); |
| 13628 | countingStream->write((uint64_t*)&cgen_var_943, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13629 | marshal_VkWaylandSurfaceCreateInfoKHR(countingStream, (VkWaylandSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13630 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13631 | uint64_t cgen_var_944 = (uint64_t)(uintptr_t)local_pAllocator; |
| 13632 | countingStream->putBe64(cgen_var_944); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13633 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13634 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13635 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13636 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13637 | uint64_t cgen_var_945; |
| 13638 | countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_945, 1); |
| 13639 | countingStream->write((uint64_t*)&cgen_var_945, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13640 | } |
| 13641 | uint32_t packetSize_vkCreateWaylandSurfaceKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 13642 | countingStream->rewind(); |
| 13643 | uint32_t opcode_vkCreateWaylandSurfaceKHR = OP_vkCreateWaylandSurfaceKHR; |
| 13644 | stream->write(&opcode_vkCreateWaylandSurfaceKHR, sizeof(uint32_t)); |
| 13645 | stream->write(&packetSize_vkCreateWaylandSurfaceKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13646 | uint64_t cgen_var_946; |
| 13647 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_946, 1); |
| 13648 | stream->write((uint64_t*)&cgen_var_946, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13649 | marshal_VkWaylandSurfaceCreateInfoKHR(stream, (VkWaylandSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13650 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13651 | uint64_t cgen_var_947 = (uint64_t)(uintptr_t)local_pAllocator; |
| 13652 | stream->putBe64(cgen_var_947); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13653 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13654 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13655 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13656 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13657 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13658 | uint64_t cgen_var_948; |
| 13659 | stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_948, 1); |
| 13660 | stream->write((uint64_t*)&cgen_var_948, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13661 | stream->setHandleMapping(resources->unwrapMapping()); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13662 | uint64_t cgen_var_949; |
| 13663 | stream->read((uint64_t*)&cgen_var_949, 8); |
| 13664 | stream->handleMapping()->mapHandles_u64_VkSurfaceKHR(&cgen_var_949, (VkSurfaceKHR*)pSurface, 1); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13665 | VkResult vkCreateWaylandSurfaceKHR_VkResult_return = (VkResult)0; |
| 13666 | stream->read(&vkCreateWaylandSurfaceKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 13667 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13668 | countingStream->clearPool(); |
| 13669 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 13670 | mImpl->log("finish vkCreateWaylandSurfaceKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13671 | return vkCreateWaylandSurfaceKHR_VkResult_return; |
| 13672 | } |
| 13673 | |
| 13674 | VkBool32 VkEncoder::vkGetPhysicalDeviceWaylandPresentationSupportKHR( |
| 13675 | VkPhysicalDevice physicalDevice, |
| 13676 | uint32_t queueFamilyIndex, |
| 13677 | wl_display* display) |
| 13678 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 13679 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 13680 | mImpl->log("start vkGetPhysicalDeviceWaylandPresentationSupportKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13681 | auto stream = mImpl->stream(); |
| 13682 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13683 | auto resources = mImpl->resources(); |
| 13684 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13685 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13686 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13687 | uint32_t local_queueFamilyIndex; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 13688 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13689 | local_queueFamilyIndex = queueFamilyIndex; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13690 | countingStream->rewind(); |
| 13691 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13692 | uint64_t cgen_var_950; |
| 13693 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_950, 1); |
| 13694 | countingStream->write((uint64_t*)&cgen_var_950, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13695 | countingStream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13696 | countingStream->write((wl_display*)display, sizeof(wl_display)); |
| 13697 | } |
| 13698 | uint32_t packetSize_vkGetPhysicalDeviceWaylandPresentationSupportKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 13699 | countingStream->rewind(); |
| 13700 | uint32_t opcode_vkGetPhysicalDeviceWaylandPresentationSupportKHR = OP_vkGetPhysicalDeviceWaylandPresentationSupportKHR; |
| 13701 | stream->write(&opcode_vkGetPhysicalDeviceWaylandPresentationSupportKHR, sizeof(uint32_t)); |
| 13702 | stream->write(&packetSize_vkGetPhysicalDeviceWaylandPresentationSupportKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13703 | uint64_t cgen_var_951; |
| 13704 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_951, 1); |
| 13705 | stream->write((uint64_t*)&cgen_var_951, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13706 | stream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13707 | stream->write((wl_display*)display, sizeof(wl_display)); |
| 13708 | stream->read((wl_display*)display, sizeof(wl_display)); |
| 13709 | VkBool32 vkGetPhysicalDeviceWaylandPresentationSupportKHR_VkBool32_return = (VkBool32)0; |
| 13710 | stream->read(&vkGetPhysicalDeviceWaylandPresentationSupportKHR_VkBool32_return, sizeof(VkBool32)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 13711 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13712 | countingStream->clearPool(); |
| 13713 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 13714 | mImpl->log("finish vkGetPhysicalDeviceWaylandPresentationSupportKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13715 | return vkGetPhysicalDeviceWaylandPresentationSupportKHR_VkBool32_return; |
| 13716 | } |
| 13717 | |
| 13718 | #endif |
| 13719 | #ifdef VK_KHR_mir_surface |
| 13720 | VkResult VkEncoder::vkCreateMirSurfaceKHR( |
| 13721 | VkInstance instance, |
| 13722 | const VkMirSurfaceCreateInfoKHR* pCreateInfo, |
| 13723 | const VkAllocationCallbacks* pAllocator, |
| 13724 | VkSurfaceKHR* pSurface) |
| 13725 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 13726 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 13727 | mImpl->log("start vkCreateMirSurfaceKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13728 | auto stream = mImpl->stream(); |
| 13729 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13730 | auto resources = mImpl->resources(); |
| 13731 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13732 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13733 | VkInstance local_instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13734 | VkMirSurfaceCreateInfoKHR* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 13735 | VkAllocationCallbacks* local_pAllocator; |
| 13736 | local_instance = instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13737 | local_pCreateInfo = nullptr; |
| 13738 | if (pCreateInfo) |
| 13739 | { |
| 13740 | local_pCreateInfo = (VkMirSurfaceCreateInfoKHR*)pool->alloc(sizeof(const VkMirSurfaceCreateInfoKHR)); |
| 13741 | deepcopy_VkMirSurfaceCreateInfoKHR(pool, pCreateInfo, (VkMirSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| 13742 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13743 | local_pAllocator = nullptr; |
| 13744 | if (pAllocator) |
| 13745 | { |
| 13746 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 13747 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 13748 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 13749 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 13750 | if (local_pCreateInfo) |
| 13751 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 13752 | transform_tohost_VkMirSurfaceCreateInfoKHR(mImpl->resources(), (VkMirSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 13753 | } |
| 13754 | if (local_pAllocator) |
| 13755 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 13756 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 13757 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13758 | countingStream->rewind(); |
| 13759 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13760 | uint64_t cgen_var_952; |
| 13761 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_952, 1); |
| 13762 | countingStream->write((uint64_t*)&cgen_var_952, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13763 | marshal_VkMirSurfaceCreateInfoKHR(countingStream, (VkMirSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13764 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13765 | uint64_t cgen_var_953 = (uint64_t)(uintptr_t)local_pAllocator; |
| 13766 | countingStream->putBe64(cgen_var_953); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13767 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13768 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13769 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13770 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13771 | uint64_t cgen_var_954; |
| 13772 | countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_954, 1); |
| 13773 | countingStream->write((uint64_t*)&cgen_var_954, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13774 | } |
| 13775 | uint32_t packetSize_vkCreateMirSurfaceKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 13776 | countingStream->rewind(); |
| 13777 | uint32_t opcode_vkCreateMirSurfaceKHR = OP_vkCreateMirSurfaceKHR; |
| 13778 | stream->write(&opcode_vkCreateMirSurfaceKHR, sizeof(uint32_t)); |
| 13779 | stream->write(&packetSize_vkCreateMirSurfaceKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13780 | uint64_t cgen_var_955; |
| 13781 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_955, 1); |
| 13782 | stream->write((uint64_t*)&cgen_var_955, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13783 | marshal_VkMirSurfaceCreateInfoKHR(stream, (VkMirSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13784 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13785 | uint64_t cgen_var_956 = (uint64_t)(uintptr_t)local_pAllocator; |
| 13786 | stream->putBe64(cgen_var_956); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13787 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13788 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13789 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13790 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13791 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13792 | uint64_t cgen_var_957; |
| 13793 | stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_957, 1); |
| 13794 | stream->write((uint64_t*)&cgen_var_957, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13795 | stream->setHandleMapping(resources->unwrapMapping()); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13796 | uint64_t cgen_var_958; |
| 13797 | stream->read((uint64_t*)&cgen_var_958, 8); |
| 13798 | stream->handleMapping()->mapHandles_u64_VkSurfaceKHR(&cgen_var_958, (VkSurfaceKHR*)pSurface, 1); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13799 | VkResult vkCreateMirSurfaceKHR_VkResult_return = (VkResult)0; |
| 13800 | stream->read(&vkCreateMirSurfaceKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 13801 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13802 | countingStream->clearPool(); |
| 13803 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 13804 | mImpl->log("finish vkCreateMirSurfaceKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13805 | return vkCreateMirSurfaceKHR_VkResult_return; |
| 13806 | } |
| 13807 | |
| 13808 | VkBool32 VkEncoder::vkGetPhysicalDeviceMirPresentationSupportKHR( |
| 13809 | VkPhysicalDevice physicalDevice, |
| 13810 | uint32_t queueFamilyIndex, |
| 13811 | MirConnection* connection) |
| 13812 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 13813 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 13814 | mImpl->log("start vkGetPhysicalDeviceMirPresentationSupportKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13815 | auto stream = mImpl->stream(); |
| 13816 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13817 | auto resources = mImpl->resources(); |
| 13818 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13819 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13820 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13821 | uint32_t local_queueFamilyIndex; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 13822 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13823 | local_queueFamilyIndex = queueFamilyIndex; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13824 | countingStream->rewind(); |
| 13825 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13826 | uint64_t cgen_var_959; |
| 13827 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_959, 1); |
| 13828 | countingStream->write((uint64_t*)&cgen_var_959, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13829 | countingStream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13830 | countingStream->write((MirConnection*)connection, sizeof(MirConnection)); |
| 13831 | } |
| 13832 | uint32_t packetSize_vkGetPhysicalDeviceMirPresentationSupportKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 13833 | countingStream->rewind(); |
| 13834 | uint32_t opcode_vkGetPhysicalDeviceMirPresentationSupportKHR = OP_vkGetPhysicalDeviceMirPresentationSupportKHR; |
| 13835 | stream->write(&opcode_vkGetPhysicalDeviceMirPresentationSupportKHR, sizeof(uint32_t)); |
| 13836 | stream->write(&packetSize_vkGetPhysicalDeviceMirPresentationSupportKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13837 | uint64_t cgen_var_960; |
| 13838 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_960, 1); |
| 13839 | stream->write((uint64_t*)&cgen_var_960, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13840 | stream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13841 | stream->write((MirConnection*)connection, sizeof(MirConnection)); |
| 13842 | stream->read((MirConnection*)connection, sizeof(MirConnection)); |
| 13843 | VkBool32 vkGetPhysicalDeviceMirPresentationSupportKHR_VkBool32_return = (VkBool32)0; |
| 13844 | stream->read(&vkGetPhysicalDeviceMirPresentationSupportKHR_VkBool32_return, sizeof(VkBool32)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 13845 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13846 | countingStream->clearPool(); |
| 13847 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 13848 | mImpl->log("finish vkGetPhysicalDeviceMirPresentationSupportKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13849 | return vkGetPhysicalDeviceMirPresentationSupportKHR_VkBool32_return; |
| 13850 | } |
| 13851 | |
| 13852 | #endif |
| 13853 | #ifdef VK_KHR_android_surface |
| 13854 | VkResult VkEncoder::vkCreateAndroidSurfaceKHR( |
| 13855 | VkInstance instance, |
| 13856 | const VkAndroidSurfaceCreateInfoKHR* pCreateInfo, |
| 13857 | const VkAllocationCallbacks* pAllocator, |
| 13858 | VkSurfaceKHR* pSurface) |
| 13859 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 13860 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 13861 | mImpl->log("start vkCreateAndroidSurfaceKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13862 | auto stream = mImpl->stream(); |
| 13863 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13864 | auto resources = mImpl->resources(); |
| 13865 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13866 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13867 | VkInstance local_instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13868 | VkAndroidSurfaceCreateInfoKHR* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 13869 | VkAllocationCallbacks* local_pAllocator; |
| 13870 | local_instance = instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13871 | local_pCreateInfo = nullptr; |
| 13872 | if (pCreateInfo) |
| 13873 | { |
| 13874 | local_pCreateInfo = (VkAndroidSurfaceCreateInfoKHR*)pool->alloc(sizeof(const VkAndroidSurfaceCreateInfoKHR)); |
| 13875 | deepcopy_VkAndroidSurfaceCreateInfoKHR(pool, pCreateInfo, (VkAndroidSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| 13876 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13877 | local_pAllocator = nullptr; |
| 13878 | if (pAllocator) |
| 13879 | { |
| 13880 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 13881 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 13882 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 13883 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 13884 | if (local_pCreateInfo) |
| 13885 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 13886 | transform_tohost_VkAndroidSurfaceCreateInfoKHR(mImpl->resources(), (VkAndroidSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 13887 | } |
| 13888 | if (local_pAllocator) |
| 13889 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 13890 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 13891 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13892 | countingStream->rewind(); |
| 13893 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13894 | uint64_t cgen_var_961; |
| 13895 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_961, 1); |
| 13896 | countingStream->write((uint64_t*)&cgen_var_961, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13897 | marshal_VkAndroidSurfaceCreateInfoKHR(countingStream, (VkAndroidSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13898 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13899 | uint64_t cgen_var_962 = (uint64_t)(uintptr_t)local_pAllocator; |
| 13900 | countingStream->putBe64(cgen_var_962); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13901 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13902 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13903 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13904 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13905 | uint64_t cgen_var_963; |
| 13906 | countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_963, 1); |
| 13907 | countingStream->write((uint64_t*)&cgen_var_963, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13908 | } |
| 13909 | uint32_t packetSize_vkCreateAndroidSurfaceKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 13910 | countingStream->rewind(); |
| 13911 | uint32_t opcode_vkCreateAndroidSurfaceKHR = OP_vkCreateAndroidSurfaceKHR; |
| 13912 | stream->write(&opcode_vkCreateAndroidSurfaceKHR, sizeof(uint32_t)); |
| 13913 | stream->write(&packetSize_vkCreateAndroidSurfaceKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13914 | uint64_t cgen_var_964; |
| 13915 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_964, 1); |
| 13916 | stream->write((uint64_t*)&cgen_var_964, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13917 | marshal_VkAndroidSurfaceCreateInfoKHR(stream, (VkAndroidSurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13918 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13919 | uint64_t cgen_var_965 = (uint64_t)(uintptr_t)local_pAllocator; |
| 13920 | stream->putBe64(cgen_var_965); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13921 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13922 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13923 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13924 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13925 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13926 | uint64_t cgen_var_966; |
| 13927 | stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_966, 1); |
| 13928 | stream->write((uint64_t*)&cgen_var_966, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13929 | stream->setHandleMapping(resources->unwrapMapping()); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13930 | uint64_t cgen_var_967; |
| 13931 | stream->read((uint64_t*)&cgen_var_967, 8); |
| 13932 | stream->handleMapping()->mapHandles_u64_VkSurfaceKHR(&cgen_var_967, (VkSurfaceKHR*)pSurface, 1); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13933 | VkResult vkCreateAndroidSurfaceKHR_VkResult_return = (VkResult)0; |
| 13934 | stream->read(&vkCreateAndroidSurfaceKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 13935 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 13936 | countingStream->clearPool(); |
| 13937 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 13938 | mImpl->log("finish vkCreateAndroidSurfaceKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13939 | return vkCreateAndroidSurfaceKHR_VkResult_return; |
| 13940 | } |
| 13941 | |
| 13942 | #endif |
| 13943 | #ifdef VK_KHR_win32_surface |
| 13944 | VkResult VkEncoder::vkCreateWin32SurfaceKHR( |
| 13945 | VkInstance instance, |
| 13946 | const VkWin32SurfaceCreateInfoKHR* pCreateInfo, |
| 13947 | const VkAllocationCallbacks* pAllocator, |
| 13948 | VkSurfaceKHR* pSurface) |
| 13949 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 13950 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 13951 | mImpl->log("start vkCreateWin32SurfaceKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13952 | auto stream = mImpl->stream(); |
| 13953 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13954 | auto resources = mImpl->resources(); |
| 13955 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 13956 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13957 | VkInstance local_instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13958 | VkWin32SurfaceCreateInfoKHR* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 13959 | VkAllocationCallbacks* local_pAllocator; |
| 13960 | local_instance = instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13961 | local_pCreateInfo = nullptr; |
| 13962 | if (pCreateInfo) |
| 13963 | { |
| 13964 | local_pCreateInfo = (VkWin32SurfaceCreateInfoKHR*)pool->alloc(sizeof(const VkWin32SurfaceCreateInfoKHR)); |
| 13965 | deepcopy_VkWin32SurfaceCreateInfoKHR(pool, pCreateInfo, (VkWin32SurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| 13966 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13967 | local_pAllocator = nullptr; |
| 13968 | if (pAllocator) |
| 13969 | { |
| 13970 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 13971 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 13972 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 13973 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 13974 | if (local_pCreateInfo) |
| 13975 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 13976 | transform_tohost_VkWin32SurfaceCreateInfoKHR(mImpl->resources(), (VkWin32SurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 13977 | } |
| 13978 | if (local_pAllocator) |
| 13979 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 13980 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 13981 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13982 | countingStream->rewind(); |
| 13983 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13984 | uint64_t cgen_var_968; |
| 13985 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_968, 1); |
| 13986 | countingStream->write((uint64_t*)&cgen_var_968, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13987 | marshal_VkWin32SurfaceCreateInfoKHR(countingStream, (VkWin32SurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 13988 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13989 | uint64_t cgen_var_969 = (uint64_t)(uintptr_t)local_pAllocator; |
| 13990 | countingStream->putBe64(cgen_var_969); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13991 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13992 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 13993 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13994 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 13995 | uint64_t cgen_var_970; |
| 13996 | countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_970, 1); |
| 13997 | countingStream->write((uint64_t*)&cgen_var_970, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 13998 | } |
| 13999 | uint32_t packetSize_vkCreateWin32SurfaceKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 14000 | countingStream->rewind(); |
| 14001 | uint32_t opcode_vkCreateWin32SurfaceKHR = OP_vkCreateWin32SurfaceKHR; |
| 14002 | stream->write(&opcode_vkCreateWin32SurfaceKHR, sizeof(uint32_t)); |
| 14003 | stream->write(&packetSize_vkCreateWin32SurfaceKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14004 | uint64_t cgen_var_971; |
| 14005 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_971, 1); |
| 14006 | stream->write((uint64_t*)&cgen_var_971, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14007 | marshal_VkWin32SurfaceCreateInfoKHR(stream, (VkWin32SurfaceCreateInfoKHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14008 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14009 | uint64_t cgen_var_972 = (uint64_t)(uintptr_t)local_pAllocator; |
| 14010 | stream->putBe64(cgen_var_972); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14011 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14012 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14013 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14014 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14015 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14016 | uint64_t cgen_var_973; |
| 14017 | stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_973, 1); |
| 14018 | stream->write((uint64_t*)&cgen_var_973, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14019 | stream->setHandleMapping(resources->unwrapMapping()); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14020 | uint64_t cgen_var_974; |
| 14021 | stream->read((uint64_t*)&cgen_var_974, 8); |
| 14022 | stream->handleMapping()->mapHandles_u64_VkSurfaceKHR(&cgen_var_974, (VkSurfaceKHR*)pSurface, 1); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14023 | VkResult vkCreateWin32SurfaceKHR_VkResult_return = (VkResult)0; |
| 14024 | stream->read(&vkCreateWin32SurfaceKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 14025 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 14026 | countingStream->clearPool(); |
| 14027 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14028 | mImpl->log("finish vkCreateWin32SurfaceKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14029 | return vkCreateWin32SurfaceKHR_VkResult_return; |
| 14030 | } |
| 14031 | |
| 14032 | VkBool32 VkEncoder::vkGetPhysicalDeviceWin32PresentationSupportKHR( |
| 14033 | VkPhysicalDevice physicalDevice, |
| 14034 | uint32_t queueFamilyIndex) |
| 14035 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 14036 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14037 | mImpl->log("start vkGetPhysicalDeviceWin32PresentationSupportKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14038 | auto stream = mImpl->stream(); |
| 14039 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14040 | auto resources = mImpl->resources(); |
| 14041 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14042 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14043 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14044 | uint32_t local_queueFamilyIndex; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 14045 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14046 | local_queueFamilyIndex = queueFamilyIndex; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14047 | countingStream->rewind(); |
| 14048 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14049 | uint64_t cgen_var_975; |
| 14050 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_975, 1); |
| 14051 | countingStream->write((uint64_t*)&cgen_var_975, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14052 | countingStream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14053 | } |
| 14054 | uint32_t packetSize_vkGetPhysicalDeviceWin32PresentationSupportKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 14055 | countingStream->rewind(); |
| 14056 | uint32_t opcode_vkGetPhysicalDeviceWin32PresentationSupportKHR = OP_vkGetPhysicalDeviceWin32PresentationSupportKHR; |
| 14057 | stream->write(&opcode_vkGetPhysicalDeviceWin32PresentationSupportKHR, sizeof(uint32_t)); |
| 14058 | stream->write(&packetSize_vkGetPhysicalDeviceWin32PresentationSupportKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14059 | uint64_t cgen_var_976; |
| 14060 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_976, 1); |
| 14061 | stream->write((uint64_t*)&cgen_var_976, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14062 | stream->write((uint32_t*)&local_queueFamilyIndex, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14063 | VkBool32 vkGetPhysicalDeviceWin32PresentationSupportKHR_VkBool32_return = (VkBool32)0; |
| 14064 | stream->read(&vkGetPhysicalDeviceWin32PresentationSupportKHR_VkBool32_return, sizeof(VkBool32)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 14065 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 14066 | countingStream->clearPool(); |
| 14067 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14068 | mImpl->log("finish vkGetPhysicalDeviceWin32PresentationSupportKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14069 | return vkGetPhysicalDeviceWin32PresentationSupportKHR_VkBool32_return; |
| 14070 | } |
| 14071 | |
| 14072 | #endif |
| 14073 | #ifdef VK_KHR_sampler_mirror_clamp_to_edge |
| 14074 | #endif |
| 14075 | #ifdef VK_KHR_multiview |
| 14076 | #endif |
| 14077 | #ifdef VK_KHR_get_physical_device_properties2 |
| 14078 | void VkEncoder::vkGetPhysicalDeviceFeatures2KHR( |
| 14079 | VkPhysicalDevice physicalDevice, |
| 14080 | VkPhysicalDeviceFeatures2* pFeatures) |
| 14081 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 14082 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14083 | mImpl->log("start vkGetPhysicalDeviceFeatures2KHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14084 | auto stream = mImpl->stream(); |
| 14085 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14086 | auto resources = mImpl->resources(); |
| 14087 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14088 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14089 | VkPhysicalDevice local_physicalDevice; |
| 14090 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14091 | countingStream->rewind(); |
| 14092 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14093 | uint64_t cgen_var_977; |
| 14094 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_977, 1); |
| 14095 | countingStream->write((uint64_t*)&cgen_var_977, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14096 | marshal_VkPhysicalDeviceFeatures2(countingStream, (VkPhysicalDeviceFeatures2*)(pFeatures)); |
| 14097 | } |
| 14098 | uint32_t packetSize_vkGetPhysicalDeviceFeatures2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 14099 | countingStream->rewind(); |
| 14100 | uint32_t opcode_vkGetPhysicalDeviceFeatures2KHR = OP_vkGetPhysicalDeviceFeatures2KHR; |
| 14101 | stream->write(&opcode_vkGetPhysicalDeviceFeatures2KHR, sizeof(uint32_t)); |
| 14102 | stream->write(&packetSize_vkGetPhysicalDeviceFeatures2KHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14103 | uint64_t cgen_var_978; |
| 14104 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_978, 1); |
| 14105 | stream->write((uint64_t*)&cgen_var_978, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14106 | marshal_VkPhysicalDeviceFeatures2(stream, (VkPhysicalDeviceFeatures2*)(pFeatures)); |
| 14107 | unmarshal_VkPhysicalDeviceFeatures2(stream, (VkPhysicalDeviceFeatures2*)(pFeatures)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 14108 | if (pFeatures) |
| 14109 | { |
| 14110 | transform_fromhost_VkPhysicalDeviceFeatures2(mImpl->resources(), (VkPhysicalDeviceFeatures2*)(pFeatures)); |
| 14111 | } |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 14112 | pool->freeAll(); |
| 14113 | countingStream->clearPool(); |
| 14114 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14115 | mImpl->log("finish vkGetPhysicalDeviceFeatures2KHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14116 | } |
| 14117 | |
| 14118 | void VkEncoder::vkGetPhysicalDeviceProperties2KHR( |
| 14119 | VkPhysicalDevice physicalDevice, |
| 14120 | VkPhysicalDeviceProperties2* pProperties) |
| 14121 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 14122 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14123 | mImpl->log("start vkGetPhysicalDeviceProperties2KHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14124 | auto stream = mImpl->stream(); |
| 14125 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14126 | auto resources = mImpl->resources(); |
| 14127 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14128 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14129 | VkPhysicalDevice local_physicalDevice; |
| 14130 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14131 | countingStream->rewind(); |
| 14132 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14133 | uint64_t cgen_var_979; |
| 14134 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_979, 1); |
| 14135 | countingStream->write((uint64_t*)&cgen_var_979, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14136 | marshal_VkPhysicalDeviceProperties2(countingStream, (VkPhysicalDeviceProperties2*)(pProperties)); |
| 14137 | } |
| 14138 | uint32_t packetSize_vkGetPhysicalDeviceProperties2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 14139 | countingStream->rewind(); |
| 14140 | uint32_t opcode_vkGetPhysicalDeviceProperties2KHR = OP_vkGetPhysicalDeviceProperties2KHR; |
| 14141 | stream->write(&opcode_vkGetPhysicalDeviceProperties2KHR, sizeof(uint32_t)); |
| 14142 | stream->write(&packetSize_vkGetPhysicalDeviceProperties2KHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14143 | uint64_t cgen_var_980; |
| 14144 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_980, 1); |
| 14145 | stream->write((uint64_t*)&cgen_var_980, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14146 | marshal_VkPhysicalDeviceProperties2(stream, (VkPhysicalDeviceProperties2*)(pProperties)); |
| 14147 | unmarshal_VkPhysicalDeviceProperties2(stream, (VkPhysicalDeviceProperties2*)(pProperties)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 14148 | if (pProperties) |
| 14149 | { |
| 14150 | transform_fromhost_VkPhysicalDeviceProperties2(mImpl->resources(), (VkPhysicalDeviceProperties2*)(pProperties)); |
| 14151 | } |
| Yilong Li | f336908 | 2020-06-25 03:39:24 -0700 | [diff] [blame] | 14152 | mImpl->resources()->on_vkGetPhysicalDeviceProperties2KHR(this, physicalDevice, pProperties); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 14153 | pool->freeAll(); |
| 14154 | countingStream->clearPool(); |
| 14155 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14156 | mImpl->log("finish vkGetPhysicalDeviceProperties2KHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14157 | } |
| 14158 | |
| 14159 | void VkEncoder::vkGetPhysicalDeviceFormatProperties2KHR( |
| 14160 | VkPhysicalDevice physicalDevice, |
| 14161 | VkFormat format, |
| 14162 | VkFormatProperties2* pFormatProperties) |
| 14163 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 14164 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14165 | mImpl->log("start vkGetPhysicalDeviceFormatProperties2KHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14166 | auto stream = mImpl->stream(); |
| 14167 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14168 | auto resources = mImpl->resources(); |
| 14169 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14170 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14171 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14172 | VkFormat local_format; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 14173 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14174 | local_format = format; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14175 | countingStream->rewind(); |
| 14176 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14177 | uint64_t cgen_var_981; |
| 14178 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_981, 1); |
| 14179 | countingStream->write((uint64_t*)&cgen_var_981, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14180 | countingStream->write((VkFormat*)&local_format, sizeof(VkFormat)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14181 | marshal_VkFormatProperties2(countingStream, (VkFormatProperties2*)(pFormatProperties)); |
| 14182 | } |
| 14183 | uint32_t packetSize_vkGetPhysicalDeviceFormatProperties2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 14184 | countingStream->rewind(); |
| 14185 | uint32_t opcode_vkGetPhysicalDeviceFormatProperties2KHR = OP_vkGetPhysicalDeviceFormatProperties2KHR; |
| 14186 | stream->write(&opcode_vkGetPhysicalDeviceFormatProperties2KHR, sizeof(uint32_t)); |
| 14187 | stream->write(&packetSize_vkGetPhysicalDeviceFormatProperties2KHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14188 | uint64_t cgen_var_982; |
| 14189 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_982, 1); |
| 14190 | stream->write((uint64_t*)&cgen_var_982, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14191 | stream->write((VkFormat*)&local_format, sizeof(VkFormat)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14192 | marshal_VkFormatProperties2(stream, (VkFormatProperties2*)(pFormatProperties)); |
| 14193 | unmarshal_VkFormatProperties2(stream, (VkFormatProperties2*)(pFormatProperties)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 14194 | if (pFormatProperties) |
| 14195 | { |
| 14196 | transform_fromhost_VkFormatProperties2(mImpl->resources(), (VkFormatProperties2*)(pFormatProperties)); |
| 14197 | } |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 14198 | pool->freeAll(); |
| 14199 | countingStream->clearPool(); |
| 14200 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14201 | mImpl->log("finish vkGetPhysicalDeviceFormatProperties2KHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14202 | } |
| 14203 | |
| 14204 | VkResult VkEncoder::vkGetPhysicalDeviceImageFormatProperties2KHR( |
| 14205 | VkPhysicalDevice physicalDevice, |
| 14206 | const VkPhysicalDeviceImageFormatInfo2* pImageFormatInfo, |
| 14207 | VkImageFormatProperties2* pImageFormatProperties) |
| 14208 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 14209 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14210 | mImpl->log("start vkGetPhysicalDeviceImageFormatProperties2KHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14211 | auto stream = mImpl->stream(); |
| 14212 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14213 | auto resources = mImpl->resources(); |
| 14214 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14215 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14216 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14217 | VkPhysicalDeviceImageFormatInfo2* local_pImageFormatInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 14218 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14219 | local_pImageFormatInfo = nullptr; |
| 14220 | if (pImageFormatInfo) |
| 14221 | { |
| 14222 | local_pImageFormatInfo = (VkPhysicalDeviceImageFormatInfo2*)pool->alloc(sizeof(const VkPhysicalDeviceImageFormatInfo2)); |
| 14223 | deepcopy_VkPhysicalDeviceImageFormatInfo2(pool, pImageFormatInfo, (VkPhysicalDeviceImageFormatInfo2*)(local_pImageFormatInfo)); |
| 14224 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 14225 | if (local_pImageFormatInfo) |
| 14226 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 14227 | transform_tohost_VkPhysicalDeviceImageFormatInfo2(mImpl->resources(), (VkPhysicalDeviceImageFormatInfo2*)(local_pImageFormatInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 14228 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14229 | countingStream->rewind(); |
| 14230 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14231 | uint64_t cgen_var_983; |
| 14232 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_983, 1); |
| 14233 | countingStream->write((uint64_t*)&cgen_var_983, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14234 | marshal_VkPhysicalDeviceImageFormatInfo2(countingStream, (VkPhysicalDeviceImageFormatInfo2*)(local_pImageFormatInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14235 | marshal_VkImageFormatProperties2(countingStream, (VkImageFormatProperties2*)(pImageFormatProperties)); |
| 14236 | } |
| 14237 | uint32_t packetSize_vkGetPhysicalDeviceImageFormatProperties2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 14238 | countingStream->rewind(); |
| 14239 | uint32_t opcode_vkGetPhysicalDeviceImageFormatProperties2KHR = OP_vkGetPhysicalDeviceImageFormatProperties2KHR; |
| 14240 | stream->write(&opcode_vkGetPhysicalDeviceImageFormatProperties2KHR, sizeof(uint32_t)); |
| 14241 | stream->write(&packetSize_vkGetPhysicalDeviceImageFormatProperties2KHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14242 | uint64_t cgen_var_984; |
| 14243 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_984, 1); |
| 14244 | stream->write((uint64_t*)&cgen_var_984, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14245 | marshal_VkPhysicalDeviceImageFormatInfo2(stream, (VkPhysicalDeviceImageFormatInfo2*)(local_pImageFormatInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14246 | marshal_VkImageFormatProperties2(stream, (VkImageFormatProperties2*)(pImageFormatProperties)); |
| 14247 | unmarshal_VkImageFormatProperties2(stream, (VkImageFormatProperties2*)(pImageFormatProperties)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 14248 | if (pImageFormatProperties) |
| 14249 | { |
| 14250 | transform_fromhost_VkImageFormatProperties2(mImpl->resources(), (VkImageFormatProperties2*)(pImageFormatProperties)); |
| 14251 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14252 | VkResult vkGetPhysicalDeviceImageFormatProperties2KHR_VkResult_return = (VkResult)0; |
| 14253 | stream->read(&vkGetPhysicalDeviceImageFormatProperties2KHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 14254 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 14255 | countingStream->clearPool(); |
| 14256 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14257 | mImpl->log("finish vkGetPhysicalDeviceImageFormatProperties2KHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14258 | return vkGetPhysicalDeviceImageFormatProperties2KHR_VkResult_return; |
| 14259 | } |
| 14260 | |
| 14261 | void VkEncoder::vkGetPhysicalDeviceQueueFamilyProperties2KHR( |
| 14262 | VkPhysicalDevice physicalDevice, |
| 14263 | uint32_t* pQueueFamilyPropertyCount, |
| 14264 | VkQueueFamilyProperties2* pQueueFamilyProperties) |
| 14265 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 14266 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14267 | mImpl->log("start vkGetPhysicalDeviceQueueFamilyProperties2KHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14268 | auto stream = mImpl->stream(); |
| 14269 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14270 | auto resources = mImpl->resources(); |
| 14271 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14272 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14273 | VkPhysicalDevice local_physicalDevice; |
| 14274 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14275 | countingStream->rewind(); |
| 14276 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14277 | uint64_t cgen_var_985; |
| 14278 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_985, 1); |
| 14279 | countingStream->write((uint64_t*)&cgen_var_985, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14280 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14281 | uint64_t cgen_var_986 = (uint64_t)(uintptr_t)pQueueFamilyPropertyCount; |
| 14282 | countingStream->putBe64(cgen_var_986); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14283 | if (pQueueFamilyPropertyCount) |
| 14284 | { |
| 14285 | countingStream->write((uint32_t*)pQueueFamilyPropertyCount, sizeof(uint32_t)); |
| 14286 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14287 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14288 | uint64_t cgen_var_987 = (uint64_t)(uintptr_t)pQueueFamilyProperties; |
| 14289 | countingStream->putBe64(cgen_var_987); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14290 | if (pQueueFamilyProperties) |
| 14291 | { |
| 14292 | for (uint32_t i = 0; i < (uint32_t)(*(pQueueFamilyPropertyCount)); ++i) |
| 14293 | { |
| 14294 | marshal_VkQueueFamilyProperties2(countingStream, (VkQueueFamilyProperties2*)(pQueueFamilyProperties + i)); |
| 14295 | } |
| 14296 | } |
| 14297 | } |
| 14298 | uint32_t packetSize_vkGetPhysicalDeviceQueueFamilyProperties2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 14299 | countingStream->rewind(); |
| 14300 | uint32_t opcode_vkGetPhysicalDeviceQueueFamilyProperties2KHR = OP_vkGetPhysicalDeviceQueueFamilyProperties2KHR; |
| 14301 | stream->write(&opcode_vkGetPhysicalDeviceQueueFamilyProperties2KHR, sizeof(uint32_t)); |
| 14302 | stream->write(&packetSize_vkGetPhysicalDeviceQueueFamilyProperties2KHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14303 | uint64_t cgen_var_988; |
| 14304 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_988, 1); |
| 14305 | stream->write((uint64_t*)&cgen_var_988, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14306 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14307 | uint64_t cgen_var_989 = (uint64_t)(uintptr_t)pQueueFamilyPropertyCount; |
| 14308 | stream->putBe64(cgen_var_989); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14309 | if (pQueueFamilyPropertyCount) |
| 14310 | { |
| 14311 | stream->write((uint32_t*)pQueueFamilyPropertyCount, sizeof(uint32_t)); |
| 14312 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14313 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14314 | uint64_t cgen_var_990 = (uint64_t)(uintptr_t)pQueueFamilyProperties; |
| 14315 | stream->putBe64(cgen_var_990); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14316 | if (pQueueFamilyProperties) |
| 14317 | { |
| 14318 | for (uint32_t i = 0; i < (uint32_t)(*(pQueueFamilyPropertyCount)); ++i) |
| 14319 | { |
| 14320 | marshal_VkQueueFamilyProperties2(stream, (VkQueueFamilyProperties2*)(pQueueFamilyProperties + i)); |
| 14321 | } |
| 14322 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14323 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14324 | uint32_t* check_pQueueFamilyPropertyCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14325 | check_pQueueFamilyPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14326 | if (pQueueFamilyPropertyCount) |
| 14327 | { |
| 14328 | if (!(check_pQueueFamilyPropertyCount)) |
| 14329 | { |
| 14330 | fprintf(stderr, "fatal: pQueueFamilyPropertyCount inconsistent between guest and host\n"); |
| 14331 | } |
| 14332 | stream->read((uint32_t*)pQueueFamilyPropertyCount, sizeof(uint32_t)); |
| 14333 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14334 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14335 | VkQueueFamilyProperties2* check_pQueueFamilyProperties; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14336 | check_pQueueFamilyProperties = (VkQueueFamilyProperties2*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14337 | if (pQueueFamilyProperties) |
| 14338 | { |
| 14339 | if (!(check_pQueueFamilyProperties)) |
| 14340 | { |
| 14341 | fprintf(stderr, "fatal: pQueueFamilyProperties inconsistent between guest and host\n"); |
| 14342 | } |
| 14343 | for (uint32_t i = 0; i < (uint32_t)(*(pQueueFamilyPropertyCount)); ++i) |
| 14344 | { |
| 14345 | unmarshal_VkQueueFamilyProperties2(stream, (VkQueueFamilyProperties2*)(pQueueFamilyProperties + i)); |
| 14346 | } |
| 14347 | } |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 14348 | if (pQueueFamilyProperties) |
| 14349 | { |
| 14350 | for (uint32_t i = 0; i < (uint32_t)(*(pQueueFamilyPropertyCount)); ++i) |
| 14351 | { |
| 14352 | transform_fromhost_VkQueueFamilyProperties2(mImpl->resources(), (VkQueueFamilyProperties2*)(pQueueFamilyProperties + i)); |
| 14353 | } |
| 14354 | } |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 14355 | pool->freeAll(); |
| 14356 | countingStream->clearPool(); |
| 14357 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14358 | mImpl->log("finish vkGetPhysicalDeviceQueueFamilyProperties2KHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14359 | } |
| 14360 | |
| 14361 | void VkEncoder::vkGetPhysicalDeviceMemoryProperties2KHR( |
| 14362 | VkPhysicalDevice physicalDevice, |
| 14363 | VkPhysicalDeviceMemoryProperties2* pMemoryProperties) |
| 14364 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 14365 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14366 | mImpl->log("start vkGetPhysicalDeviceMemoryProperties2KHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14367 | auto stream = mImpl->stream(); |
| 14368 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14369 | auto resources = mImpl->resources(); |
| 14370 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14371 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14372 | VkPhysicalDevice local_physicalDevice; |
| 14373 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14374 | countingStream->rewind(); |
| 14375 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14376 | uint64_t cgen_var_993; |
| 14377 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_993, 1); |
| 14378 | countingStream->write((uint64_t*)&cgen_var_993, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14379 | marshal_VkPhysicalDeviceMemoryProperties2(countingStream, (VkPhysicalDeviceMemoryProperties2*)(pMemoryProperties)); |
| 14380 | } |
| 14381 | uint32_t packetSize_vkGetPhysicalDeviceMemoryProperties2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 14382 | countingStream->rewind(); |
| 14383 | uint32_t opcode_vkGetPhysicalDeviceMemoryProperties2KHR = OP_vkGetPhysicalDeviceMemoryProperties2KHR; |
| 14384 | stream->write(&opcode_vkGetPhysicalDeviceMemoryProperties2KHR, sizeof(uint32_t)); |
| 14385 | stream->write(&packetSize_vkGetPhysicalDeviceMemoryProperties2KHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14386 | uint64_t cgen_var_994; |
| 14387 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_994, 1); |
| 14388 | stream->write((uint64_t*)&cgen_var_994, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14389 | marshal_VkPhysicalDeviceMemoryProperties2(stream, (VkPhysicalDeviceMemoryProperties2*)(pMemoryProperties)); |
| 14390 | unmarshal_VkPhysicalDeviceMemoryProperties2(stream, (VkPhysicalDeviceMemoryProperties2*)(pMemoryProperties)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 14391 | if (pMemoryProperties) |
| 14392 | { |
| 14393 | transform_fromhost_VkPhysicalDeviceMemoryProperties2(mImpl->resources(), (VkPhysicalDeviceMemoryProperties2*)(pMemoryProperties)); |
| 14394 | } |
| Lingfeng Yang | 154a33c | 2019-01-29 19:06:23 -0800 | [diff] [blame] | 14395 | mImpl->resources()->on_vkGetPhysicalDeviceMemoryProperties2KHR(this, physicalDevice, pMemoryProperties); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 14396 | pool->freeAll(); |
| 14397 | countingStream->clearPool(); |
| 14398 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14399 | mImpl->log("finish vkGetPhysicalDeviceMemoryProperties2KHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14400 | } |
| 14401 | |
| 14402 | void VkEncoder::vkGetPhysicalDeviceSparseImageFormatProperties2KHR( |
| 14403 | VkPhysicalDevice physicalDevice, |
| 14404 | const VkPhysicalDeviceSparseImageFormatInfo2* pFormatInfo, |
| 14405 | uint32_t* pPropertyCount, |
| 14406 | VkSparseImageFormatProperties2* pProperties) |
| 14407 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 14408 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14409 | mImpl->log("start vkGetPhysicalDeviceSparseImageFormatProperties2KHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14410 | auto stream = mImpl->stream(); |
| 14411 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14412 | auto resources = mImpl->resources(); |
| 14413 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14414 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14415 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14416 | VkPhysicalDeviceSparseImageFormatInfo2* local_pFormatInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 14417 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14418 | local_pFormatInfo = nullptr; |
| 14419 | if (pFormatInfo) |
| 14420 | { |
| 14421 | local_pFormatInfo = (VkPhysicalDeviceSparseImageFormatInfo2*)pool->alloc(sizeof(const VkPhysicalDeviceSparseImageFormatInfo2)); |
| 14422 | deepcopy_VkPhysicalDeviceSparseImageFormatInfo2(pool, pFormatInfo, (VkPhysicalDeviceSparseImageFormatInfo2*)(local_pFormatInfo)); |
| 14423 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 14424 | if (local_pFormatInfo) |
| 14425 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 14426 | transform_tohost_VkPhysicalDeviceSparseImageFormatInfo2(mImpl->resources(), (VkPhysicalDeviceSparseImageFormatInfo2*)(local_pFormatInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 14427 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14428 | countingStream->rewind(); |
| 14429 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14430 | uint64_t cgen_var_995; |
| 14431 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_995, 1); |
| 14432 | countingStream->write((uint64_t*)&cgen_var_995, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14433 | marshal_VkPhysicalDeviceSparseImageFormatInfo2(countingStream, (VkPhysicalDeviceSparseImageFormatInfo2*)(local_pFormatInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14434 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14435 | uint64_t cgen_var_996 = (uint64_t)(uintptr_t)pPropertyCount; |
| 14436 | countingStream->putBe64(cgen_var_996); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14437 | if (pPropertyCount) |
| 14438 | { |
| 14439 | countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 14440 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14441 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14442 | uint64_t cgen_var_997 = (uint64_t)(uintptr_t)pProperties; |
| 14443 | countingStream->putBe64(cgen_var_997); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14444 | if (pProperties) |
| 14445 | { |
| 14446 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 14447 | { |
| 14448 | marshal_VkSparseImageFormatProperties2(countingStream, (VkSparseImageFormatProperties2*)(pProperties + i)); |
| 14449 | } |
| 14450 | } |
| 14451 | } |
| 14452 | uint32_t packetSize_vkGetPhysicalDeviceSparseImageFormatProperties2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 14453 | countingStream->rewind(); |
| 14454 | uint32_t opcode_vkGetPhysicalDeviceSparseImageFormatProperties2KHR = OP_vkGetPhysicalDeviceSparseImageFormatProperties2KHR; |
| 14455 | stream->write(&opcode_vkGetPhysicalDeviceSparseImageFormatProperties2KHR, sizeof(uint32_t)); |
| 14456 | stream->write(&packetSize_vkGetPhysicalDeviceSparseImageFormatProperties2KHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14457 | uint64_t cgen_var_998; |
| 14458 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_998, 1); |
| 14459 | stream->write((uint64_t*)&cgen_var_998, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14460 | marshal_VkPhysicalDeviceSparseImageFormatInfo2(stream, (VkPhysicalDeviceSparseImageFormatInfo2*)(local_pFormatInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14461 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14462 | uint64_t cgen_var_999 = (uint64_t)(uintptr_t)pPropertyCount; |
| 14463 | stream->putBe64(cgen_var_999); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14464 | if (pPropertyCount) |
| 14465 | { |
| 14466 | stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 14467 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14468 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14469 | uint64_t cgen_var_1000 = (uint64_t)(uintptr_t)pProperties; |
| 14470 | stream->putBe64(cgen_var_1000); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14471 | if (pProperties) |
| 14472 | { |
| 14473 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 14474 | { |
| 14475 | marshal_VkSparseImageFormatProperties2(stream, (VkSparseImageFormatProperties2*)(pProperties + i)); |
| 14476 | } |
| 14477 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14478 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14479 | uint32_t* check_pPropertyCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14480 | check_pPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14481 | if (pPropertyCount) |
| 14482 | { |
| 14483 | if (!(check_pPropertyCount)) |
| 14484 | { |
| 14485 | fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n"); |
| 14486 | } |
| 14487 | stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 14488 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14489 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14490 | VkSparseImageFormatProperties2* check_pProperties; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14491 | check_pProperties = (VkSparseImageFormatProperties2*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14492 | if (pProperties) |
| 14493 | { |
| 14494 | if (!(check_pProperties)) |
| 14495 | { |
| 14496 | fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n"); |
| 14497 | } |
| 14498 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 14499 | { |
| 14500 | unmarshal_VkSparseImageFormatProperties2(stream, (VkSparseImageFormatProperties2*)(pProperties + i)); |
| 14501 | } |
| 14502 | } |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 14503 | if (pProperties) |
| 14504 | { |
| 14505 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 14506 | { |
| 14507 | transform_fromhost_VkSparseImageFormatProperties2(mImpl->resources(), (VkSparseImageFormatProperties2*)(pProperties + i)); |
| 14508 | } |
| 14509 | } |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 14510 | pool->freeAll(); |
| 14511 | countingStream->clearPool(); |
| 14512 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14513 | mImpl->log("finish vkGetPhysicalDeviceSparseImageFormatProperties2KHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14514 | } |
| 14515 | |
| 14516 | #endif |
| 14517 | #ifdef VK_KHR_device_group |
| 14518 | void VkEncoder::vkGetDeviceGroupPeerMemoryFeaturesKHR( |
| 14519 | VkDevice device, |
| 14520 | uint32_t heapIndex, |
| 14521 | uint32_t localDeviceIndex, |
| 14522 | uint32_t remoteDeviceIndex, |
| 14523 | VkPeerMemoryFeatureFlags* pPeerMemoryFeatures) |
| 14524 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 14525 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14526 | mImpl->log("start vkGetDeviceGroupPeerMemoryFeaturesKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14527 | auto stream = mImpl->stream(); |
| 14528 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14529 | auto resources = mImpl->resources(); |
| 14530 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14531 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14532 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14533 | uint32_t local_heapIndex; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14534 | uint32_t local_localDeviceIndex; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14535 | uint32_t local_remoteDeviceIndex; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 14536 | local_device = device; |
| 14537 | local_heapIndex = heapIndex; |
| 14538 | local_localDeviceIndex = localDeviceIndex; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14539 | local_remoteDeviceIndex = remoteDeviceIndex; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14540 | countingStream->rewind(); |
| 14541 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14542 | uint64_t cgen_var_1003; |
| 14543 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1003, 1); |
| 14544 | countingStream->write((uint64_t*)&cgen_var_1003, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14545 | countingStream->write((uint32_t*)&local_heapIndex, sizeof(uint32_t)); |
| 14546 | countingStream->write((uint32_t*)&local_localDeviceIndex, sizeof(uint32_t)); |
| 14547 | countingStream->write((uint32_t*)&local_remoteDeviceIndex, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14548 | countingStream->write((VkPeerMemoryFeatureFlags*)pPeerMemoryFeatures, sizeof(VkPeerMemoryFeatureFlags)); |
| 14549 | } |
| 14550 | uint32_t packetSize_vkGetDeviceGroupPeerMemoryFeaturesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 14551 | countingStream->rewind(); |
| 14552 | uint32_t opcode_vkGetDeviceGroupPeerMemoryFeaturesKHR = OP_vkGetDeviceGroupPeerMemoryFeaturesKHR; |
| 14553 | stream->write(&opcode_vkGetDeviceGroupPeerMemoryFeaturesKHR, sizeof(uint32_t)); |
| 14554 | stream->write(&packetSize_vkGetDeviceGroupPeerMemoryFeaturesKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14555 | uint64_t cgen_var_1004; |
| 14556 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1004, 1); |
| 14557 | stream->write((uint64_t*)&cgen_var_1004, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14558 | stream->write((uint32_t*)&local_heapIndex, sizeof(uint32_t)); |
| 14559 | stream->write((uint32_t*)&local_localDeviceIndex, sizeof(uint32_t)); |
| 14560 | stream->write((uint32_t*)&local_remoteDeviceIndex, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14561 | stream->write((VkPeerMemoryFeatureFlags*)pPeerMemoryFeatures, sizeof(VkPeerMemoryFeatureFlags)); |
| 14562 | stream->read((VkPeerMemoryFeatureFlags*)pPeerMemoryFeatures, sizeof(VkPeerMemoryFeatureFlags)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 14563 | pool->freeAll(); |
| 14564 | countingStream->clearPool(); |
| 14565 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14566 | mImpl->log("finish vkGetDeviceGroupPeerMemoryFeaturesKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14567 | } |
| 14568 | |
| 14569 | void VkEncoder::vkCmdSetDeviceMaskKHR( |
| 14570 | VkCommandBuffer commandBuffer, |
| 14571 | uint32_t deviceMask) |
| 14572 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 14573 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14574 | mImpl->log("start vkCmdSetDeviceMaskKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14575 | auto stream = mImpl->stream(); |
| 14576 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14577 | auto resources = mImpl->resources(); |
| 14578 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14579 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14580 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14581 | uint32_t local_deviceMask; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 14582 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14583 | local_deviceMask = deviceMask; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14584 | countingStream->rewind(); |
| 14585 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14586 | uint64_t cgen_var_1005; |
| 14587 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1005, 1); |
| 14588 | countingStream->write((uint64_t*)&cgen_var_1005, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14589 | countingStream->write((uint32_t*)&local_deviceMask, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14590 | } |
| 14591 | uint32_t packetSize_vkCmdSetDeviceMaskKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 14592 | countingStream->rewind(); |
| 14593 | uint32_t opcode_vkCmdSetDeviceMaskKHR = OP_vkCmdSetDeviceMaskKHR; |
| 14594 | stream->write(&opcode_vkCmdSetDeviceMaskKHR, sizeof(uint32_t)); |
| 14595 | stream->write(&packetSize_vkCmdSetDeviceMaskKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14596 | uint64_t cgen_var_1006; |
| 14597 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1006, 1); |
| 14598 | stream->write((uint64_t*)&cgen_var_1006, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14599 | stream->write((uint32_t*)&local_deviceMask, sizeof(uint32_t)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 14600 | pool->freeAll(); |
| 14601 | countingStream->clearPool(); |
| 14602 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14603 | mImpl->log("finish vkCmdSetDeviceMaskKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14604 | } |
| 14605 | |
| 14606 | void VkEncoder::vkCmdDispatchBaseKHR( |
| 14607 | VkCommandBuffer commandBuffer, |
| 14608 | uint32_t baseGroupX, |
| 14609 | uint32_t baseGroupY, |
| 14610 | uint32_t baseGroupZ, |
| 14611 | uint32_t groupCountX, |
| 14612 | uint32_t groupCountY, |
| 14613 | uint32_t groupCountZ) |
| 14614 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 14615 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14616 | mImpl->log("start vkCmdDispatchBaseKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14617 | auto stream = mImpl->stream(); |
| 14618 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14619 | auto resources = mImpl->resources(); |
| 14620 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14621 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14622 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14623 | uint32_t local_baseGroupX; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14624 | uint32_t local_baseGroupY; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14625 | uint32_t local_baseGroupZ; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14626 | uint32_t local_groupCountX; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14627 | uint32_t local_groupCountY; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14628 | uint32_t local_groupCountZ; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 14629 | local_commandBuffer = commandBuffer; |
| 14630 | local_baseGroupX = baseGroupX; |
| 14631 | local_baseGroupY = baseGroupY; |
| 14632 | local_baseGroupZ = baseGroupZ; |
| 14633 | local_groupCountX = groupCountX; |
| 14634 | local_groupCountY = groupCountY; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14635 | local_groupCountZ = groupCountZ; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14636 | countingStream->rewind(); |
| 14637 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14638 | uint64_t cgen_var_1007; |
| 14639 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1007, 1); |
| 14640 | countingStream->write((uint64_t*)&cgen_var_1007, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14641 | countingStream->write((uint32_t*)&local_baseGroupX, sizeof(uint32_t)); |
| 14642 | countingStream->write((uint32_t*)&local_baseGroupY, sizeof(uint32_t)); |
| 14643 | countingStream->write((uint32_t*)&local_baseGroupZ, sizeof(uint32_t)); |
| 14644 | countingStream->write((uint32_t*)&local_groupCountX, sizeof(uint32_t)); |
| 14645 | countingStream->write((uint32_t*)&local_groupCountY, sizeof(uint32_t)); |
| 14646 | countingStream->write((uint32_t*)&local_groupCountZ, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14647 | } |
| 14648 | uint32_t packetSize_vkCmdDispatchBaseKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 14649 | countingStream->rewind(); |
| 14650 | uint32_t opcode_vkCmdDispatchBaseKHR = OP_vkCmdDispatchBaseKHR; |
| 14651 | stream->write(&opcode_vkCmdDispatchBaseKHR, sizeof(uint32_t)); |
| 14652 | stream->write(&packetSize_vkCmdDispatchBaseKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14653 | uint64_t cgen_var_1008; |
| 14654 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1008, 1); |
| 14655 | stream->write((uint64_t*)&cgen_var_1008, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14656 | stream->write((uint32_t*)&local_baseGroupX, sizeof(uint32_t)); |
| 14657 | stream->write((uint32_t*)&local_baseGroupY, sizeof(uint32_t)); |
| 14658 | stream->write((uint32_t*)&local_baseGroupZ, sizeof(uint32_t)); |
| 14659 | stream->write((uint32_t*)&local_groupCountX, sizeof(uint32_t)); |
| 14660 | stream->write((uint32_t*)&local_groupCountY, sizeof(uint32_t)); |
| 14661 | stream->write((uint32_t*)&local_groupCountZ, sizeof(uint32_t)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 14662 | pool->freeAll(); |
| 14663 | countingStream->clearPool(); |
| 14664 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14665 | mImpl->log("finish vkCmdDispatchBaseKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14666 | } |
| 14667 | |
| 14668 | #endif |
| 14669 | #ifdef VK_KHR_shader_draw_parameters |
| 14670 | #endif |
| 14671 | #ifdef VK_KHR_maintenance1 |
| 14672 | void VkEncoder::vkTrimCommandPoolKHR( |
| 14673 | VkDevice device, |
| 14674 | VkCommandPool commandPool, |
| 14675 | VkCommandPoolTrimFlags flags) |
| 14676 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 14677 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14678 | mImpl->log("start vkTrimCommandPoolKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14679 | auto stream = mImpl->stream(); |
| 14680 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14681 | auto resources = mImpl->resources(); |
| 14682 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14683 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14684 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14685 | VkCommandPool local_commandPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14686 | VkCommandPoolTrimFlags local_flags; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 14687 | local_device = device; |
| 14688 | local_commandPool = commandPool; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14689 | local_flags = flags; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14690 | countingStream->rewind(); |
| 14691 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14692 | uint64_t cgen_var_1009; |
| 14693 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1009, 1); |
| 14694 | countingStream->write((uint64_t*)&cgen_var_1009, 1 * 8); |
| 14695 | uint64_t cgen_var_1010; |
| 14696 | countingStream->handleMapping()->mapHandles_VkCommandPool_u64(&local_commandPool, &cgen_var_1010, 1); |
| 14697 | countingStream->write((uint64_t*)&cgen_var_1010, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14698 | countingStream->write((VkCommandPoolTrimFlags*)&local_flags, sizeof(VkCommandPoolTrimFlags)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14699 | } |
| 14700 | uint32_t packetSize_vkTrimCommandPoolKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 14701 | countingStream->rewind(); |
| 14702 | uint32_t opcode_vkTrimCommandPoolKHR = OP_vkTrimCommandPoolKHR; |
| 14703 | stream->write(&opcode_vkTrimCommandPoolKHR, sizeof(uint32_t)); |
| 14704 | stream->write(&packetSize_vkTrimCommandPoolKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14705 | uint64_t cgen_var_1011; |
| 14706 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1011, 1); |
| 14707 | stream->write((uint64_t*)&cgen_var_1011, 1 * 8); |
| 14708 | uint64_t cgen_var_1012; |
| 14709 | stream->handleMapping()->mapHandles_VkCommandPool_u64(&local_commandPool, &cgen_var_1012, 1); |
| 14710 | stream->write((uint64_t*)&cgen_var_1012, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14711 | stream->write((VkCommandPoolTrimFlags*)&local_flags, sizeof(VkCommandPoolTrimFlags)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 14712 | pool->freeAll(); |
| 14713 | countingStream->clearPool(); |
| 14714 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14715 | mImpl->log("finish vkTrimCommandPoolKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14716 | } |
| 14717 | |
| 14718 | #endif |
| 14719 | #ifdef VK_KHR_device_group_creation |
| 14720 | VkResult VkEncoder::vkEnumeratePhysicalDeviceGroupsKHR( |
| 14721 | VkInstance instance, |
| 14722 | uint32_t* pPhysicalDeviceGroupCount, |
| 14723 | VkPhysicalDeviceGroupProperties* pPhysicalDeviceGroupProperties) |
| 14724 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 14725 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14726 | mImpl->log("start vkEnumeratePhysicalDeviceGroupsKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14727 | auto stream = mImpl->stream(); |
| 14728 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14729 | auto resources = mImpl->resources(); |
| 14730 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14731 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14732 | VkInstance local_instance; |
| 14733 | local_instance = instance; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14734 | countingStream->rewind(); |
| 14735 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14736 | uint64_t cgen_var_1013; |
| 14737 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1013, 1); |
| 14738 | countingStream->write((uint64_t*)&cgen_var_1013, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14739 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14740 | uint64_t cgen_var_1014 = (uint64_t)(uintptr_t)pPhysicalDeviceGroupCount; |
| 14741 | countingStream->putBe64(cgen_var_1014); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14742 | if (pPhysicalDeviceGroupCount) |
| 14743 | { |
| 14744 | countingStream->write((uint32_t*)pPhysicalDeviceGroupCount, sizeof(uint32_t)); |
| 14745 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14746 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14747 | uint64_t cgen_var_1015 = (uint64_t)(uintptr_t)pPhysicalDeviceGroupProperties; |
| 14748 | countingStream->putBe64(cgen_var_1015); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14749 | if (pPhysicalDeviceGroupProperties) |
| 14750 | { |
| 14751 | for (uint32_t i = 0; i < (uint32_t)(*(pPhysicalDeviceGroupCount)); ++i) |
| 14752 | { |
| 14753 | marshal_VkPhysicalDeviceGroupProperties(countingStream, (VkPhysicalDeviceGroupProperties*)(pPhysicalDeviceGroupProperties + i)); |
| 14754 | } |
| 14755 | } |
| 14756 | } |
| 14757 | uint32_t packetSize_vkEnumeratePhysicalDeviceGroupsKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 14758 | countingStream->rewind(); |
| 14759 | uint32_t opcode_vkEnumeratePhysicalDeviceGroupsKHR = OP_vkEnumeratePhysicalDeviceGroupsKHR; |
| 14760 | stream->write(&opcode_vkEnumeratePhysicalDeviceGroupsKHR, sizeof(uint32_t)); |
| 14761 | stream->write(&packetSize_vkEnumeratePhysicalDeviceGroupsKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14762 | uint64_t cgen_var_1016; |
| 14763 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1016, 1); |
| 14764 | stream->write((uint64_t*)&cgen_var_1016, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14765 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14766 | uint64_t cgen_var_1017 = (uint64_t)(uintptr_t)pPhysicalDeviceGroupCount; |
| 14767 | stream->putBe64(cgen_var_1017); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14768 | if (pPhysicalDeviceGroupCount) |
| 14769 | { |
| 14770 | stream->write((uint32_t*)pPhysicalDeviceGroupCount, sizeof(uint32_t)); |
| 14771 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14772 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14773 | uint64_t cgen_var_1018 = (uint64_t)(uintptr_t)pPhysicalDeviceGroupProperties; |
| 14774 | stream->putBe64(cgen_var_1018); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14775 | if (pPhysicalDeviceGroupProperties) |
| 14776 | { |
| 14777 | for (uint32_t i = 0; i < (uint32_t)(*(pPhysicalDeviceGroupCount)); ++i) |
| 14778 | { |
| 14779 | marshal_VkPhysicalDeviceGroupProperties(stream, (VkPhysicalDeviceGroupProperties*)(pPhysicalDeviceGroupProperties + i)); |
| 14780 | } |
| 14781 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14782 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14783 | uint32_t* check_pPhysicalDeviceGroupCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14784 | check_pPhysicalDeviceGroupCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14785 | if (pPhysicalDeviceGroupCount) |
| 14786 | { |
| 14787 | if (!(check_pPhysicalDeviceGroupCount)) |
| 14788 | { |
| 14789 | fprintf(stderr, "fatal: pPhysicalDeviceGroupCount inconsistent between guest and host\n"); |
| 14790 | } |
| 14791 | stream->read((uint32_t*)pPhysicalDeviceGroupCount, sizeof(uint32_t)); |
| 14792 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14793 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14794 | VkPhysicalDeviceGroupProperties* check_pPhysicalDeviceGroupProperties; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 14795 | check_pPhysicalDeviceGroupProperties = (VkPhysicalDeviceGroupProperties*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14796 | if (pPhysicalDeviceGroupProperties) |
| 14797 | { |
| 14798 | if (!(check_pPhysicalDeviceGroupProperties)) |
| 14799 | { |
| 14800 | fprintf(stderr, "fatal: pPhysicalDeviceGroupProperties inconsistent between guest and host\n"); |
| 14801 | } |
| 14802 | for (uint32_t i = 0; i < (uint32_t)(*(pPhysicalDeviceGroupCount)); ++i) |
| 14803 | { |
| 14804 | unmarshal_VkPhysicalDeviceGroupProperties(stream, (VkPhysicalDeviceGroupProperties*)(pPhysicalDeviceGroupProperties + i)); |
| 14805 | } |
| 14806 | } |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 14807 | if (pPhysicalDeviceGroupProperties) |
| 14808 | { |
| 14809 | for (uint32_t i = 0; i < (uint32_t)(*(pPhysicalDeviceGroupCount)); ++i) |
| 14810 | { |
| 14811 | transform_fromhost_VkPhysicalDeviceGroupProperties(mImpl->resources(), (VkPhysicalDeviceGroupProperties*)(pPhysicalDeviceGroupProperties + i)); |
| 14812 | } |
| 14813 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14814 | VkResult vkEnumeratePhysicalDeviceGroupsKHR_VkResult_return = (VkResult)0; |
| 14815 | stream->read(&vkEnumeratePhysicalDeviceGroupsKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 14816 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 14817 | countingStream->clearPool(); |
| 14818 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14819 | mImpl->log("finish vkEnumeratePhysicalDeviceGroupsKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14820 | return vkEnumeratePhysicalDeviceGroupsKHR_VkResult_return; |
| 14821 | } |
| 14822 | |
| 14823 | #endif |
| 14824 | #ifdef VK_KHR_external_memory_capabilities |
| 14825 | void VkEncoder::vkGetPhysicalDeviceExternalBufferPropertiesKHR( |
| 14826 | VkPhysicalDevice physicalDevice, |
| 14827 | const VkPhysicalDeviceExternalBufferInfo* pExternalBufferInfo, |
| 14828 | VkExternalBufferProperties* pExternalBufferProperties) |
| 14829 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 14830 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14831 | mImpl->log("start vkGetPhysicalDeviceExternalBufferPropertiesKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14832 | auto stream = mImpl->stream(); |
| 14833 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14834 | auto resources = mImpl->resources(); |
| 14835 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14836 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14837 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14838 | VkPhysicalDeviceExternalBufferInfo* local_pExternalBufferInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 14839 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14840 | local_pExternalBufferInfo = nullptr; |
| 14841 | if (pExternalBufferInfo) |
| 14842 | { |
| 14843 | local_pExternalBufferInfo = (VkPhysicalDeviceExternalBufferInfo*)pool->alloc(sizeof(const VkPhysicalDeviceExternalBufferInfo)); |
| 14844 | deepcopy_VkPhysicalDeviceExternalBufferInfo(pool, pExternalBufferInfo, (VkPhysicalDeviceExternalBufferInfo*)(local_pExternalBufferInfo)); |
| 14845 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 14846 | if (local_pExternalBufferInfo) |
| 14847 | { |
| Lingfeng Yang | 2b1b8cf | 2019-02-08 09:53:36 -0800 | [diff] [blame] | 14848 | mImpl->resources()->transformImpl_VkPhysicalDeviceExternalBufferInfo_tohost(local_pExternalBufferInfo, 1); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 14849 | transform_tohost_VkPhysicalDeviceExternalBufferInfo(mImpl->resources(), (VkPhysicalDeviceExternalBufferInfo*)(local_pExternalBufferInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 14850 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14851 | countingStream->rewind(); |
| 14852 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14853 | uint64_t cgen_var_1021; |
| 14854 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1021, 1); |
| 14855 | countingStream->write((uint64_t*)&cgen_var_1021, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14856 | marshal_VkPhysicalDeviceExternalBufferInfo(countingStream, (VkPhysicalDeviceExternalBufferInfo*)(local_pExternalBufferInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14857 | marshal_VkExternalBufferProperties(countingStream, (VkExternalBufferProperties*)(pExternalBufferProperties)); |
| 14858 | } |
| 14859 | uint32_t packetSize_vkGetPhysicalDeviceExternalBufferPropertiesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 14860 | countingStream->rewind(); |
| 14861 | uint32_t opcode_vkGetPhysicalDeviceExternalBufferPropertiesKHR = OP_vkGetPhysicalDeviceExternalBufferPropertiesKHR; |
| 14862 | stream->write(&opcode_vkGetPhysicalDeviceExternalBufferPropertiesKHR, sizeof(uint32_t)); |
| 14863 | stream->write(&packetSize_vkGetPhysicalDeviceExternalBufferPropertiesKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14864 | uint64_t cgen_var_1022; |
| 14865 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1022, 1); |
| 14866 | stream->write((uint64_t*)&cgen_var_1022, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14867 | marshal_VkPhysicalDeviceExternalBufferInfo(stream, (VkPhysicalDeviceExternalBufferInfo*)(local_pExternalBufferInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14868 | marshal_VkExternalBufferProperties(stream, (VkExternalBufferProperties*)(pExternalBufferProperties)); |
| 14869 | unmarshal_VkExternalBufferProperties(stream, (VkExternalBufferProperties*)(pExternalBufferProperties)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 14870 | if (pExternalBufferProperties) |
| 14871 | { |
| Lingfeng Yang | 2b1b8cf | 2019-02-08 09:53:36 -0800 | [diff] [blame] | 14872 | mImpl->resources()->transformImpl_VkExternalBufferProperties_fromhost(pExternalBufferProperties, 1); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 14873 | transform_fromhost_VkExternalBufferProperties(mImpl->resources(), (VkExternalBufferProperties*)(pExternalBufferProperties)); |
| 14874 | } |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 14875 | pool->freeAll(); |
| 14876 | countingStream->clearPool(); |
| 14877 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14878 | mImpl->log("finish vkGetPhysicalDeviceExternalBufferPropertiesKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14879 | } |
| 14880 | |
| 14881 | #endif |
| 14882 | #ifdef VK_KHR_external_memory |
| 14883 | #endif |
| 14884 | #ifdef VK_KHR_external_memory_win32 |
| 14885 | VkResult VkEncoder::vkGetMemoryWin32HandleKHR( |
| 14886 | VkDevice device, |
| 14887 | const VkMemoryGetWin32HandleInfoKHR* pGetWin32HandleInfo, |
| 14888 | HANDLE* pHandle) |
| 14889 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 14890 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14891 | mImpl->log("start vkGetMemoryWin32HandleKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14892 | auto stream = mImpl->stream(); |
| 14893 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14894 | auto resources = mImpl->resources(); |
| 14895 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14896 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14897 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14898 | VkMemoryGetWin32HandleInfoKHR* local_pGetWin32HandleInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 14899 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14900 | local_pGetWin32HandleInfo = nullptr; |
| 14901 | if (pGetWin32HandleInfo) |
| 14902 | { |
| 14903 | local_pGetWin32HandleInfo = (VkMemoryGetWin32HandleInfoKHR*)pool->alloc(sizeof(const VkMemoryGetWin32HandleInfoKHR)); |
| 14904 | deepcopy_VkMemoryGetWin32HandleInfoKHR(pool, pGetWin32HandleInfo, (VkMemoryGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo)); |
| 14905 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 14906 | if (local_pGetWin32HandleInfo) |
| 14907 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 14908 | transform_tohost_VkMemoryGetWin32HandleInfoKHR(mImpl->resources(), (VkMemoryGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 14909 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14910 | countingStream->rewind(); |
| 14911 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14912 | uint64_t cgen_var_1023; |
| 14913 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1023, 1); |
| 14914 | countingStream->write((uint64_t*)&cgen_var_1023, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14915 | marshal_VkMemoryGetWin32HandleInfoKHR(countingStream, (VkMemoryGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14916 | countingStream->write((HANDLE*)pHandle, sizeof(HANDLE)); |
| 14917 | } |
| 14918 | uint32_t packetSize_vkGetMemoryWin32HandleKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 14919 | countingStream->rewind(); |
| 14920 | uint32_t opcode_vkGetMemoryWin32HandleKHR = OP_vkGetMemoryWin32HandleKHR; |
| 14921 | stream->write(&opcode_vkGetMemoryWin32HandleKHR, sizeof(uint32_t)); |
| 14922 | stream->write(&packetSize_vkGetMemoryWin32HandleKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14923 | uint64_t cgen_var_1024; |
| 14924 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1024, 1); |
| 14925 | stream->write((uint64_t*)&cgen_var_1024, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14926 | marshal_VkMemoryGetWin32HandleInfoKHR(stream, (VkMemoryGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14927 | stream->write((HANDLE*)pHandle, sizeof(HANDLE)); |
| 14928 | stream->read((HANDLE*)pHandle, sizeof(HANDLE)); |
| 14929 | VkResult vkGetMemoryWin32HandleKHR_VkResult_return = (VkResult)0; |
| 14930 | stream->read(&vkGetMemoryWin32HandleKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 14931 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 14932 | countingStream->clearPool(); |
| 14933 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14934 | mImpl->log("finish vkGetMemoryWin32HandleKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14935 | return vkGetMemoryWin32HandleKHR_VkResult_return; |
| 14936 | } |
| 14937 | |
| 14938 | VkResult VkEncoder::vkGetMemoryWin32HandlePropertiesKHR( |
| 14939 | VkDevice device, |
| 14940 | VkExternalMemoryHandleTypeFlagBits handleType, |
| 14941 | HANDLE handle, |
| 14942 | VkMemoryWin32HandlePropertiesKHR* pMemoryWin32HandleProperties) |
| 14943 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 14944 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14945 | mImpl->log("start vkGetMemoryWin32HandlePropertiesKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14946 | auto stream = mImpl->stream(); |
| 14947 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14948 | auto resources = mImpl->resources(); |
| 14949 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 14950 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14951 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14952 | VkExternalMemoryHandleTypeFlagBits local_handleType; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14953 | HANDLE local_handle; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 14954 | local_device = device; |
| 14955 | local_handleType = handleType; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14956 | local_handle = handle; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14957 | countingStream->rewind(); |
| 14958 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14959 | uint64_t cgen_var_1025; |
| 14960 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1025, 1); |
| 14961 | countingStream->write((uint64_t*)&cgen_var_1025, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14962 | countingStream->write((VkExternalMemoryHandleTypeFlagBits*)&local_handleType, sizeof(VkExternalMemoryHandleTypeFlagBits)); |
| 14963 | countingStream->write((HANDLE*)&local_handle, sizeof(HANDLE)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14964 | marshal_VkMemoryWin32HandlePropertiesKHR(countingStream, (VkMemoryWin32HandlePropertiesKHR*)(pMemoryWin32HandleProperties)); |
| 14965 | } |
| 14966 | uint32_t packetSize_vkGetMemoryWin32HandlePropertiesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 14967 | countingStream->rewind(); |
| 14968 | uint32_t opcode_vkGetMemoryWin32HandlePropertiesKHR = OP_vkGetMemoryWin32HandlePropertiesKHR; |
| 14969 | stream->write(&opcode_vkGetMemoryWin32HandlePropertiesKHR, sizeof(uint32_t)); |
| 14970 | stream->write(&packetSize_vkGetMemoryWin32HandlePropertiesKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 14971 | uint64_t cgen_var_1026; |
| 14972 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1026, 1); |
| 14973 | stream->write((uint64_t*)&cgen_var_1026, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 14974 | stream->write((VkExternalMemoryHandleTypeFlagBits*)&local_handleType, sizeof(VkExternalMemoryHandleTypeFlagBits)); |
| 14975 | stream->write((HANDLE*)&local_handle, sizeof(HANDLE)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14976 | marshal_VkMemoryWin32HandlePropertiesKHR(stream, (VkMemoryWin32HandlePropertiesKHR*)(pMemoryWin32HandleProperties)); |
| 14977 | unmarshal_VkMemoryWin32HandlePropertiesKHR(stream, (VkMemoryWin32HandlePropertiesKHR*)(pMemoryWin32HandleProperties)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 14978 | if (pMemoryWin32HandleProperties) |
| 14979 | { |
| 14980 | transform_fromhost_VkMemoryWin32HandlePropertiesKHR(mImpl->resources(), (VkMemoryWin32HandlePropertiesKHR*)(pMemoryWin32HandleProperties)); |
| 14981 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14982 | VkResult vkGetMemoryWin32HandlePropertiesKHR_VkResult_return = (VkResult)0; |
| 14983 | stream->read(&vkGetMemoryWin32HandlePropertiesKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 14984 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 14985 | countingStream->clearPool(); |
| 14986 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14987 | mImpl->log("finish vkGetMemoryWin32HandlePropertiesKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 14988 | return vkGetMemoryWin32HandlePropertiesKHR_VkResult_return; |
| 14989 | } |
| 14990 | |
| 14991 | #endif |
| 14992 | #ifdef VK_KHR_external_memory_fd |
| 14993 | VkResult VkEncoder::vkGetMemoryFdKHR( |
| 14994 | VkDevice device, |
| 14995 | const VkMemoryGetFdInfoKHR* pGetFdInfo, |
| 14996 | int* pFd) |
| 14997 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 14998 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 14999 | mImpl->log("start vkGetMemoryFdKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15000 | auto stream = mImpl->stream(); |
| 15001 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15002 | auto resources = mImpl->resources(); |
| 15003 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 15004 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15005 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15006 | VkMemoryGetFdInfoKHR* local_pGetFdInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 15007 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15008 | local_pGetFdInfo = nullptr; |
| 15009 | if (pGetFdInfo) |
| 15010 | { |
| 15011 | local_pGetFdInfo = (VkMemoryGetFdInfoKHR*)pool->alloc(sizeof(const VkMemoryGetFdInfoKHR)); |
| 15012 | deepcopy_VkMemoryGetFdInfoKHR(pool, pGetFdInfo, (VkMemoryGetFdInfoKHR*)(local_pGetFdInfo)); |
| 15013 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 15014 | if (local_pGetFdInfo) |
| 15015 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 15016 | transform_tohost_VkMemoryGetFdInfoKHR(mImpl->resources(), (VkMemoryGetFdInfoKHR*)(local_pGetFdInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 15017 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15018 | countingStream->rewind(); |
| 15019 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15020 | uint64_t cgen_var_1027; |
| 15021 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1027, 1); |
| 15022 | countingStream->write((uint64_t*)&cgen_var_1027, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15023 | marshal_VkMemoryGetFdInfoKHR(countingStream, (VkMemoryGetFdInfoKHR*)(local_pGetFdInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15024 | countingStream->write((int*)pFd, sizeof(int)); |
| 15025 | } |
| 15026 | uint32_t packetSize_vkGetMemoryFdKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 15027 | countingStream->rewind(); |
| 15028 | uint32_t opcode_vkGetMemoryFdKHR = OP_vkGetMemoryFdKHR; |
| 15029 | stream->write(&opcode_vkGetMemoryFdKHR, sizeof(uint32_t)); |
| 15030 | stream->write(&packetSize_vkGetMemoryFdKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15031 | uint64_t cgen_var_1028; |
| 15032 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1028, 1); |
| 15033 | stream->write((uint64_t*)&cgen_var_1028, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15034 | marshal_VkMemoryGetFdInfoKHR(stream, (VkMemoryGetFdInfoKHR*)(local_pGetFdInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15035 | stream->write((int*)pFd, sizeof(int)); |
| 15036 | stream->read((int*)pFd, sizeof(int)); |
| 15037 | VkResult vkGetMemoryFdKHR_VkResult_return = (VkResult)0; |
| 15038 | stream->read(&vkGetMemoryFdKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 15039 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15040 | countingStream->clearPool(); |
| 15041 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15042 | mImpl->log("finish vkGetMemoryFdKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15043 | return vkGetMemoryFdKHR_VkResult_return; |
| 15044 | } |
| 15045 | |
| 15046 | VkResult VkEncoder::vkGetMemoryFdPropertiesKHR( |
| 15047 | VkDevice device, |
| 15048 | VkExternalMemoryHandleTypeFlagBits handleType, |
| 15049 | int fd, |
| 15050 | VkMemoryFdPropertiesKHR* pMemoryFdProperties) |
| 15051 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 15052 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15053 | mImpl->log("start vkGetMemoryFdPropertiesKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15054 | auto stream = mImpl->stream(); |
| 15055 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15056 | auto resources = mImpl->resources(); |
| 15057 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 15058 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15059 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15060 | VkExternalMemoryHandleTypeFlagBits local_handleType; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15061 | int local_fd; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 15062 | local_device = device; |
| 15063 | local_handleType = handleType; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15064 | local_fd = fd; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15065 | countingStream->rewind(); |
| 15066 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15067 | uint64_t cgen_var_1029; |
| 15068 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1029, 1); |
| 15069 | countingStream->write((uint64_t*)&cgen_var_1029, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15070 | countingStream->write((VkExternalMemoryHandleTypeFlagBits*)&local_handleType, sizeof(VkExternalMemoryHandleTypeFlagBits)); |
| 15071 | countingStream->write((int*)&local_fd, sizeof(int)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15072 | marshal_VkMemoryFdPropertiesKHR(countingStream, (VkMemoryFdPropertiesKHR*)(pMemoryFdProperties)); |
| 15073 | } |
| 15074 | uint32_t packetSize_vkGetMemoryFdPropertiesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 15075 | countingStream->rewind(); |
| 15076 | uint32_t opcode_vkGetMemoryFdPropertiesKHR = OP_vkGetMemoryFdPropertiesKHR; |
| 15077 | stream->write(&opcode_vkGetMemoryFdPropertiesKHR, sizeof(uint32_t)); |
| 15078 | stream->write(&packetSize_vkGetMemoryFdPropertiesKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15079 | uint64_t cgen_var_1030; |
| 15080 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1030, 1); |
| 15081 | stream->write((uint64_t*)&cgen_var_1030, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15082 | stream->write((VkExternalMemoryHandleTypeFlagBits*)&local_handleType, sizeof(VkExternalMemoryHandleTypeFlagBits)); |
| 15083 | stream->write((int*)&local_fd, sizeof(int)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15084 | marshal_VkMemoryFdPropertiesKHR(stream, (VkMemoryFdPropertiesKHR*)(pMemoryFdProperties)); |
| 15085 | unmarshal_VkMemoryFdPropertiesKHR(stream, (VkMemoryFdPropertiesKHR*)(pMemoryFdProperties)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 15086 | if (pMemoryFdProperties) |
| 15087 | { |
| 15088 | transform_fromhost_VkMemoryFdPropertiesKHR(mImpl->resources(), (VkMemoryFdPropertiesKHR*)(pMemoryFdProperties)); |
| 15089 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15090 | VkResult vkGetMemoryFdPropertiesKHR_VkResult_return = (VkResult)0; |
| 15091 | stream->read(&vkGetMemoryFdPropertiesKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 15092 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15093 | countingStream->clearPool(); |
| 15094 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15095 | mImpl->log("finish vkGetMemoryFdPropertiesKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15096 | return vkGetMemoryFdPropertiesKHR_VkResult_return; |
| 15097 | } |
| 15098 | |
| 15099 | #endif |
| 15100 | #ifdef VK_KHR_win32_keyed_mutex |
| 15101 | #endif |
| 15102 | #ifdef VK_KHR_external_semaphore_capabilities |
| 15103 | void VkEncoder::vkGetPhysicalDeviceExternalSemaphorePropertiesKHR( |
| 15104 | VkPhysicalDevice physicalDevice, |
| 15105 | const VkPhysicalDeviceExternalSemaphoreInfo* pExternalSemaphoreInfo, |
| 15106 | VkExternalSemaphoreProperties* pExternalSemaphoreProperties) |
| 15107 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 15108 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15109 | mImpl->log("start vkGetPhysicalDeviceExternalSemaphorePropertiesKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15110 | auto stream = mImpl->stream(); |
| 15111 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15112 | auto resources = mImpl->resources(); |
| 15113 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 15114 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15115 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15116 | VkPhysicalDeviceExternalSemaphoreInfo* local_pExternalSemaphoreInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 15117 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15118 | local_pExternalSemaphoreInfo = nullptr; |
| 15119 | if (pExternalSemaphoreInfo) |
| 15120 | { |
| 15121 | local_pExternalSemaphoreInfo = (VkPhysicalDeviceExternalSemaphoreInfo*)pool->alloc(sizeof(const VkPhysicalDeviceExternalSemaphoreInfo)); |
| 15122 | deepcopy_VkPhysicalDeviceExternalSemaphoreInfo(pool, pExternalSemaphoreInfo, (VkPhysicalDeviceExternalSemaphoreInfo*)(local_pExternalSemaphoreInfo)); |
| 15123 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 15124 | if (local_pExternalSemaphoreInfo) |
| 15125 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 15126 | transform_tohost_VkPhysicalDeviceExternalSemaphoreInfo(mImpl->resources(), (VkPhysicalDeviceExternalSemaphoreInfo*)(local_pExternalSemaphoreInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 15127 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15128 | countingStream->rewind(); |
| 15129 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15130 | uint64_t cgen_var_1031; |
| 15131 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1031, 1); |
| 15132 | countingStream->write((uint64_t*)&cgen_var_1031, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15133 | marshal_VkPhysicalDeviceExternalSemaphoreInfo(countingStream, (VkPhysicalDeviceExternalSemaphoreInfo*)(local_pExternalSemaphoreInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15134 | marshal_VkExternalSemaphoreProperties(countingStream, (VkExternalSemaphoreProperties*)(pExternalSemaphoreProperties)); |
| 15135 | } |
| 15136 | uint32_t packetSize_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 15137 | countingStream->rewind(); |
| 15138 | uint32_t opcode_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR = OP_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR; |
| 15139 | stream->write(&opcode_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR, sizeof(uint32_t)); |
| 15140 | stream->write(&packetSize_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15141 | uint64_t cgen_var_1032; |
| 15142 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1032, 1); |
| 15143 | stream->write((uint64_t*)&cgen_var_1032, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15144 | marshal_VkPhysicalDeviceExternalSemaphoreInfo(stream, (VkPhysicalDeviceExternalSemaphoreInfo*)(local_pExternalSemaphoreInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15145 | marshal_VkExternalSemaphoreProperties(stream, (VkExternalSemaphoreProperties*)(pExternalSemaphoreProperties)); |
| 15146 | unmarshal_VkExternalSemaphoreProperties(stream, (VkExternalSemaphoreProperties*)(pExternalSemaphoreProperties)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 15147 | if (pExternalSemaphoreProperties) |
| 15148 | { |
| 15149 | transform_fromhost_VkExternalSemaphoreProperties(mImpl->resources(), (VkExternalSemaphoreProperties*)(pExternalSemaphoreProperties)); |
| 15150 | } |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 15151 | pool->freeAll(); |
| 15152 | countingStream->clearPool(); |
| 15153 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15154 | mImpl->log("finish vkGetPhysicalDeviceExternalSemaphorePropertiesKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15155 | } |
| 15156 | |
| 15157 | #endif |
| 15158 | #ifdef VK_KHR_external_semaphore |
| 15159 | #endif |
| 15160 | #ifdef VK_KHR_external_semaphore_win32 |
| 15161 | VkResult VkEncoder::vkImportSemaphoreWin32HandleKHR( |
| 15162 | VkDevice device, |
| 15163 | const VkImportSemaphoreWin32HandleInfoKHR* pImportSemaphoreWin32HandleInfo) |
| 15164 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 15165 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15166 | mImpl->log("start vkImportSemaphoreWin32HandleKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15167 | auto stream = mImpl->stream(); |
| 15168 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15169 | auto resources = mImpl->resources(); |
| 15170 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 15171 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15172 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15173 | VkImportSemaphoreWin32HandleInfoKHR* local_pImportSemaphoreWin32HandleInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 15174 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15175 | local_pImportSemaphoreWin32HandleInfo = nullptr; |
| 15176 | if (pImportSemaphoreWin32HandleInfo) |
| 15177 | { |
| 15178 | local_pImportSemaphoreWin32HandleInfo = (VkImportSemaphoreWin32HandleInfoKHR*)pool->alloc(sizeof(const VkImportSemaphoreWin32HandleInfoKHR)); |
| 15179 | deepcopy_VkImportSemaphoreWin32HandleInfoKHR(pool, pImportSemaphoreWin32HandleInfo, (VkImportSemaphoreWin32HandleInfoKHR*)(local_pImportSemaphoreWin32HandleInfo)); |
| 15180 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 15181 | if (local_pImportSemaphoreWin32HandleInfo) |
| 15182 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 15183 | transform_tohost_VkImportSemaphoreWin32HandleInfoKHR(mImpl->resources(), (VkImportSemaphoreWin32HandleInfoKHR*)(local_pImportSemaphoreWin32HandleInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 15184 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15185 | countingStream->rewind(); |
| 15186 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15187 | uint64_t cgen_var_1033; |
| 15188 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1033, 1); |
| 15189 | countingStream->write((uint64_t*)&cgen_var_1033, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15190 | marshal_VkImportSemaphoreWin32HandleInfoKHR(countingStream, (VkImportSemaphoreWin32HandleInfoKHR*)(local_pImportSemaphoreWin32HandleInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15191 | } |
| 15192 | uint32_t packetSize_vkImportSemaphoreWin32HandleKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 15193 | countingStream->rewind(); |
| 15194 | uint32_t opcode_vkImportSemaphoreWin32HandleKHR = OP_vkImportSemaphoreWin32HandleKHR; |
| 15195 | stream->write(&opcode_vkImportSemaphoreWin32HandleKHR, sizeof(uint32_t)); |
| 15196 | stream->write(&packetSize_vkImportSemaphoreWin32HandleKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15197 | uint64_t cgen_var_1034; |
| 15198 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1034, 1); |
| 15199 | stream->write((uint64_t*)&cgen_var_1034, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15200 | marshal_VkImportSemaphoreWin32HandleInfoKHR(stream, (VkImportSemaphoreWin32HandleInfoKHR*)(local_pImportSemaphoreWin32HandleInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15201 | VkResult vkImportSemaphoreWin32HandleKHR_VkResult_return = (VkResult)0; |
| 15202 | stream->read(&vkImportSemaphoreWin32HandleKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 15203 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15204 | countingStream->clearPool(); |
| 15205 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15206 | mImpl->log("finish vkImportSemaphoreWin32HandleKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15207 | return vkImportSemaphoreWin32HandleKHR_VkResult_return; |
| 15208 | } |
| 15209 | |
| 15210 | VkResult VkEncoder::vkGetSemaphoreWin32HandleKHR( |
| 15211 | VkDevice device, |
| 15212 | const VkSemaphoreGetWin32HandleInfoKHR* pGetWin32HandleInfo, |
| 15213 | HANDLE* pHandle) |
| 15214 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 15215 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15216 | mImpl->log("start vkGetSemaphoreWin32HandleKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15217 | auto stream = mImpl->stream(); |
| 15218 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15219 | auto resources = mImpl->resources(); |
| 15220 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 15221 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15222 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15223 | VkSemaphoreGetWin32HandleInfoKHR* local_pGetWin32HandleInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 15224 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15225 | local_pGetWin32HandleInfo = nullptr; |
| 15226 | if (pGetWin32HandleInfo) |
| 15227 | { |
| 15228 | local_pGetWin32HandleInfo = (VkSemaphoreGetWin32HandleInfoKHR*)pool->alloc(sizeof(const VkSemaphoreGetWin32HandleInfoKHR)); |
| 15229 | deepcopy_VkSemaphoreGetWin32HandleInfoKHR(pool, pGetWin32HandleInfo, (VkSemaphoreGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo)); |
| 15230 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 15231 | if (local_pGetWin32HandleInfo) |
| 15232 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 15233 | transform_tohost_VkSemaphoreGetWin32HandleInfoKHR(mImpl->resources(), (VkSemaphoreGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 15234 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15235 | countingStream->rewind(); |
| 15236 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15237 | uint64_t cgen_var_1035; |
| 15238 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1035, 1); |
| 15239 | countingStream->write((uint64_t*)&cgen_var_1035, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15240 | marshal_VkSemaphoreGetWin32HandleInfoKHR(countingStream, (VkSemaphoreGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15241 | countingStream->write((HANDLE*)pHandle, sizeof(HANDLE)); |
| 15242 | } |
| 15243 | uint32_t packetSize_vkGetSemaphoreWin32HandleKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 15244 | countingStream->rewind(); |
| 15245 | uint32_t opcode_vkGetSemaphoreWin32HandleKHR = OP_vkGetSemaphoreWin32HandleKHR; |
| 15246 | stream->write(&opcode_vkGetSemaphoreWin32HandleKHR, sizeof(uint32_t)); |
| 15247 | stream->write(&packetSize_vkGetSemaphoreWin32HandleKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15248 | uint64_t cgen_var_1036; |
| 15249 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1036, 1); |
| 15250 | stream->write((uint64_t*)&cgen_var_1036, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15251 | marshal_VkSemaphoreGetWin32HandleInfoKHR(stream, (VkSemaphoreGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15252 | stream->write((HANDLE*)pHandle, sizeof(HANDLE)); |
| 15253 | stream->read((HANDLE*)pHandle, sizeof(HANDLE)); |
| 15254 | VkResult vkGetSemaphoreWin32HandleKHR_VkResult_return = (VkResult)0; |
| 15255 | stream->read(&vkGetSemaphoreWin32HandleKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 15256 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15257 | countingStream->clearPool(); |
| 15258 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15259 | mImpl->log("finish vkGetSemaphoreWin32HandleKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15260 | return vkGetSemaphoreWin32HandleKHR_VkResult_return; |
| 15261 | } |
| 15262 | |
| 15263 | #endif |
| 15264 | #ifdef VK_KHR_external_semaphore_fd |
| 15265 | VkResult VkEncoder::vkImportSemaphoreFdKHR( |
| 15266 | VkDevice device, |
| 15267 | const VkImportSemaphoreFdInfoKHR* pImportSemaphoreFdInfo) |
| 15268 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 15269 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15270 | mImpl->log("start vkImportSemaphoreFdKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15271 | auto stream = mImpl->stream(); |
| 15272 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15273 | auto resources = mImpl->resources(); |
| 15274 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 15275 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15276 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15277 | VkImportSemaphoreFdInfoKHR* local_pImportSemaphoreFdInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 15278 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15279 | local_pImportSemaphoreFdInfo = nullptr; |
| 15280 | if (pImportSemaphoreFdInfo) |
| 15281 | { |
| 15282 | local_pImportSemaphoreFdInfo = (VkImportSemaphoreFdInfoKHR*)pool->alloc(sizeof(const VkImportSemaphoreFdInfoKHR)); |
| 15283 | deepcopy_VkImportSemaphoreFdInfoKHR(pool, pImportSemaphoreFdInfo, (VkImportSemaphoreFdInfoKHR*)(local_pImportSemaphoreFdInfo)); |
| 15284 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 15285 | if (local_pImportSemaphoreFdInfo) |
| 15286 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 15287 | transform_tohost_VkImportSemaphoreFdInfoKHR(mImpl->resources(), (VkImportSemaphoreFdInfoKHR*)(local_pImportSemaphoreFdInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 15288 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15289 | countingStream->rewind(); |
| 15290 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15291 | uint64_t cgen_var_1037; |
| 15292 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1037, 1); |
| 15293 | countingStream->write((uint64_t*)&cgen_var_1037, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15294 | marshal_VkImportSemaphoreFdInfoKHR(countingStream, (VkImportSemaphoreFdInfoKHR*)(local_pImportSemaphoreFdInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15295 | } |
| 15296 | uint32_t packetSize_vkImportSemaphoreFdKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 15297 | countingStream->rewind(); |
| 15298 | uint32_t opcode_vkImportSemaphoreFdKHR = OP_vkImportSemaphoreFdKHR; |
| 15299 | stream->write(&opcode_vkImportSemaphoreFdKHR, sizeof(uint32_t)); |
| 15300 | stream->write(&packetSize_vkImportSemaphoreFdKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15301 | uint64_t cgen_var_1038; |
| 15302 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1038, 1); |
| 15303 | stream->write((uint64_t*)&cgen_var_1038, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15304 | marshal_VkImportSemaphoreFdInfoKHR(stream, (VkImportSemaphoreFdInfoKHR*)(local_pImportSemaphoreFdInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15305 | VkResult vkImportSemaphoreFdKHR_VkResult_return = (VkResult)0; |
| 15306 | stream->read(&vkImportSemaphoreFdKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 15307 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15308 | countingStream->clearPool(); |
| 15309 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15310 | mImpl->log("finish vkImportSemaphoreFdKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15311 | return vkImportSemaphoreFdKHR_VkResult_return; |
| 15312 | } |
| 15313 | |
| 15314 | VkResult VkEncoder::vkGetSemaphoreFdKHR( |
| 15315 | VkDevice device, |
| 15316 | const VkSemaphoreGetFdInfoKHR* pGetFdInfo, |
| 15317 | int* pFd) |
| 15318 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 15319 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15320 | mImpl->log("start vkGetSemaphoreFdKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15321 | auto stream = mImpl->stream(); |
| 15322 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15323 | auto resources = mImpl->resources(); |
| 15324 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 15325 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15326 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15327 | VkSemaphoreGetFdInfoKHR* local_pGetFdInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 15328 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15329 | local_pGetFdInfo = nullptr; |
| 15330 | if (pGetFdInfo) |
| 15331 | { |
| 15332 | local_pGetFdInfo = (VkSemaphoreGetFdInfoKHR*)pool->alloc(sizeof(const VkSemaphoreGetFdInfoKHR)); |
| 15333 | deepcopy_VkSemaphoreGetFdInfoKHR(pool, pGetFdInfo, (VkSemaphoreGetFdInfoKHR*)(local_pGetFdInfo)); |
| 15334 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 15335 | if (local_pGetFdInfo) |
| 15336 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 15337 | transform_tohost_VkSemaphoreGetFdInfoKHR(mImpl->resources(), (VkSemaphoreGetFdInfoKHR*)(local_pGetFdInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 15338 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15339 | countingStream->rewind(); |
| 15340 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15341 | uint64_t cgen_var_1039; |
| 15342 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1039, 1); |
| 15343 | countingStream->write((uint64_t*)&cgen_var_1039, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15344 | marshal_VkSemaphoreGetFdInfoKHR(countingStream, (VkSemaphoreGetFdInfoKHR*)(local_pGetFdInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15345 | countingStream->write((int*)pFd, sizeof(int)); |
| 15346 | } |
| 15347 | uint32_t packetSize_vkGetSemaphoreFdKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 15348 | countingStream->rewind(); |
| 15349 | uint32_t opcode_vkGetSemaphoreFdKHR = OP_vkGetSemaphoreFdKHR; |
| 15350 | stream->write(&opcode_vkGetSemaphoreFdKHR, sizeof(uint32_t)); |
| 15351 | stream->write(&packetSize_vkGetSemaphoreFdKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15352 | uint64_t cgen_var_1040; |
| 15353 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1040, 1); |
| 15354 | stream->write((uint64_t*)&cgen_var_1040, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15355 | marshal_VkSemaphoreGetFdInfoKHR(stream, (VkSemaphoreGetFdInfoKHR*)(local_pGetFdInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15356 | stream->write((int*)pFd, sizeof(int)); |
| 15357 | stream->read((int*)pFd, sizeof(int)); |
| 15358 | VkResult vkGetSemaphoreFdKHR_VkResult_return = (VkResult)0; |
| 15359 | stream->read(&vkGetSemaphoreFdKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 15360 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15361 | countingStream->clearPool(); |
| 15362 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15363 | mImpl->log("finish vkGetSemaphoreFdKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15364 | return vkGetSemaphoreFdKHR_VkResult_return; |
| 15365 | } |
| 15366 | |
| 15367 | #endif |
| 15368 | #ifdef VK_KHR_push_descriptor |
| 15369 | void VkEncoder::vkCmdPushDescriptorSetKHR( |
| 15370 | VkCommandBuffer commandBuffer, |
| 15371 | VkPipelineBindPoint pipelineBindPoint, |
| 15372 | VkPipelineLayout layout, |
| 15373 | uint32_t set, |
| 15374 | uint32_t descriptorWriteCount, |
| 15375 | const VkWriteDescriptorSet* pDescriptorWrites) |
| 15376 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 15377 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15378 | mImpl->log("start vkCmdPushDescriptorSetKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15379 | auto stream = mImpl->stream(); |
| 15380 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15381 | auto resources = mImpl->resources(); |
| 15382 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 15383 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15384 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15385 | VkPipelineBindPoint local_pipelineBindPoint; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15386 | VkPipelineLayout local_layout; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15387 | uint32_t local_set; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15388 | uint32_t local_descriptorWriteCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15389 | VkWriteDescriptorSet* local_pDescriptorWrites; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 15390 | local_commandBuffer = commandBuffer; |
| 15391 | local_pipelineBindPoint = pipelineBindPoint; |
| 15392 | local_layout = layout; |
| 15393 | local_set = set; |
| 15394 | local_descriptorWriteCount = descriptorWriteCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15395 | local_pDescriptorWrites = nullptr; |
| 15396 | if (pDescriptorWrites) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15397 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15398 | local_pDescriptorWrites = (VkWriteDescriptorSet*)pool->alloc(((descriptorWriteCount)) * sizeof(const VkWriteDescriptorSet)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15399 | for (uint32_t i = 0; i < (uint32_t)((descriptorWriteCount)); ++i) |
| 15400 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15401 | deepcopy_VkWriteDescriptorSet(pool, pDescriptorWrites + i, (VkWriteDescriptorSet*)(local_pDescriptorWrites + i)); |
| 15402 | } |
| 15403 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 15404 | if (local_pDescriptorWrites) |
| 15405 | { |
| 15406 | for (uint32_t i = 0; i < (uint32_t)((descriptorWriteCount)); ++i) |
| 15407 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 15408 | transform_tohost_VkWriteDescriptorSet(mImpl->resources(), (VkWriteDescriptorSet*)(local_pDescriptorWrites + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 15409 | } |
| 15410 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15411 | countingStream->rewind(); |
| 15412 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15413 | uint64_t cgen_var_1041; |
| 15414 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1041, 1); |
| 15415 | countingStream->write((uint64_t*)&cgen_var_1041, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15416 | countingStream->write((VkPipelineBindPoint*)&local_pipelineBindPoint, sizeof(VkPipelineBindPoint)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15417 | uint64_t cgen_var_1042; |
| 15418 | countingStream->handleMapping()->mapHandles_VkPipelineLayout_u64(&local_layout, &cgen_var_1042, 1); |
| 15419 | countingStream->write((uint64_t*)&cgen_var_1042, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15420 | countingStream->write((uint32_t*)&local_set, sizeof(uint32_t)); |
| 15421 | countingStream->write((uint32_t*)&local_descriptorWriteCount, sizeof(uint32_t)); |
| 15422 | for (uint32_t i = 0; i < (uint32_t)((descriptorWriteCount)); ++i) |
| 15423 | { |
| 15424 | marshal_VkWriteDescriptorSet(countingStream, (VkWriteDescriptorSet*)(local_pDescriptorWrites + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15425 | } |
| 15426 | } |
| 15427 | uint32_t packetSize_vkCmdPushDescriptorSetKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 15428 | countingStream->rewind(); |
| 15429 | uint32_t opcode_vkCmdPushDescriptorSetKHR = OP_vkCmdPushDescriptorSetKHR; |
| 15430 | stream->write(&opcode_vkCmdPushDescriptorSetKHR, sizeof(uint32_t)); |
| 15431 | stream->write(&packetSize_vkCmdPushDescriptorSetKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15432 | uint64_t cgen_var_1043; |
| 15433 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1043, 1); |
| 15434 | stream->write((uint64_t*)&cgen_var_1043, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15435 | stream->write((VkPipelineBindPoint*)&local_pipelineBindPoint, sizeof(VkPipelineBindPoint)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15436 | uint64_t cgen_var_1044; |
| 15437 | stream->handleMapping()->mapHandles_VkPipelineLayout_u64(&local_layout, &cgen_var_1044, 1); |
| 15438 | stream->write((uint64_t*)&cgen_var_1044, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15439 | stream->write((uint32_t*)&local_set, sizeof(uint32_t)); |
| 15440 | stream->write((uint32_t*)&local_descriptorWriteCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15441 | for (uint32_t i = 0; i < (uint32_t)((descriptorWriteCount)); ++i) |
| 15442 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15443 | marshal_VkWriteDescriptorSet(stream, (VkWriteDescriptorSet*)(local_pDescriptorWrites + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15444 | } |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 15445 | pool->freeAll(); |
| 15446 | countingStream->clearPool(); |
| 15447 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15448 | mImpl->log("finish vkCmdPushDescriptorSetKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15449 | } |
| 15450 | |
| 15451 | void VkEncoder::vkCmdPushDescriptorSetWithTemplateKHR( |
| 15452 | VkCommandBuffer commandBuffer, |
| 15453 | VkDescriptorUpdateTemplate descriptorUpdateTemplate, |
| 15454 | VkPipelineLayout layout, |
| 15455 | uint32_t set, |
| 15456 | const void* pData) |
| 15457 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 15458 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15459 | mImpl->log("start vkCmdPushDescriptorSetWithTemplateKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15460 | auto stream = mImpl->stream(); |
| 15461 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15462 | auto resources = mImpl->resources(); |
| 15463 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 15464 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15465 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15466 | VkDescriptorUpdateTemplate local_descriptorUpdateTemplate; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15467 | VkPipelineLayout local_layout; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15468 | uint32_t local_set; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15469 | void* local_pData; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 15470 | local_commandBuffer = commandBuffer; |
| 15471 | local_descriptorUpdateTemplate = descriptorUpdateTemplate; |
| 15472 | local_layout = layout; |
| 15473 | local_set = set; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15474 | local_pData = nullptr; |
| 15475 | if (pData) |
| 15476 | { |
| 15477 | local_pData = (void*)pool->dupArray(pData, sizeof(const uint8_t)); |
| 15478 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15479 | countingStream->rewind(); |
| 15480 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15481 | uint64_t cgen_var_1045; |
| 15482 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1045, 1); |
| 15483 | countingStream->write((uint64_t*)&cgen_var_1045, 1 * 8); |
| 15484 | uint64_t cgen_var_1046; |
| 15485 | countingStream->handleMapping()->mapHandles_VkDescriptorUpdateTemplate_u64(&local_descriptorUpdateTemplate, &cgen_var_1046, 1); |
| 15486 | countingStream->write((uint64_t*)&cgen_var_1046, 1 * 8); |
| 15487 | uint64_t cgen_var_1047; |
| 15488 | countingStream->handleMapping()->mapHandles_VkPipelineLayout_u64(&local_layout, &cgen_var_1047, 1); |
| 15489 | countingStream->write((uint64_t*)&cgen_var_1047, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15490 | countingStream->write((uint32_t*)&local_set, sizeof(uint32_t)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 15491 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15492 | uint64_t cgen_var_1048 = (uint64_t)(uintptr_t)local_pData; |
| 15493 | countingStream->putBe64(cgen_var_1048); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15494 | if (local_pData) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15495 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15496 | countingStream->write((void*)local_pData, sizeof(uint8_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15497 | } |
| 15498 | } |
| 15499 | uint32_t packetSize_vkCmdPushDescriptorSetWithTemplateKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 15500 | countingStream->rewind(); |
| 15501 | uint32_t opcode_vkCmdPushDescriptorSetWithTemplateKHR = OP_vkCmdPushDescriptorSetWithTemplateKHR; |
| 15502 | stream->write(&opcode_vkCmdPushDescriptorSetWithTemplateKHR, sizeof(uint32_t)); |
| 15503 | stream->write(&packetSize_vkCmdPushDescriptorSetWithTemplateKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15504 | uint64_t cgen_var_1049; |
| 15505 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1049, 1); |
| 15506 | stream->write((uint64_t*)&cgen_var_1049, 1 * 8); |
| 15507 | uint64_t cgen_var_1050; |
| 15508 | stream->handleMapping()->mapHandles_VkDescriptorUpdateTemplate_u64(&local_descriptorUpdateTemplate, &cgen_var_1050, 1); |
| 15509 | stream->write((uint64_t*)&cgen_var_1050, 1 * 8); |
| 15510 | uint64_t cgen_var_1051; |
| 15511 | stream->handleMapping()->mapHandles_VkPipelineLayout_u64(&local_layout, &cgen_var_1051, 1); |
| 15512 | stream->write((uint64_t*)&cgen_var_1051, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15513 | stream->write((uint32_t*)&local_set, sizeof(uint32_t)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 15514 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15515 | uint64_t cgen_var_1052 = (uint64_t)(uintptr_t)local_pData; |
| 15516 | stream->putBe64(cgen_var_1052); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15517 | if (local_pData) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15518 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15519 | stream->write((void*)local_pData, sizeof(uint8_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15520 | } |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 15521 | pool->freeAll(); |
| 15522 | countingStream->clearPool(); |
| 15523 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15524 | mImpl->log("finish vkCmdPushDescriptorSetWithTemplateKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15525 | } |
| 15526 | |
| 15527 | #endif |
| 15528 | #ifdef VK_KHR_16bit_storage |
| 15529 | #endif |
| 15530 | #ifdef VK_KHR_incremental_present |
| 15531 | #endif |
| 15532 | #ifdef VK_KHR_descriptor_update_template |
| 15533 | VkResult VkEncoder::vkCreateDescriptorUpdateTemplateKHR( |
| 15534 | VkDevice device, |
| 15535 | const VkDescriptorUpdateTemplateCreateInfo* pCreateInfo, |
| 15536 | const VkAllocationCallbacks* pAllocator, |
| 15537 | VkDescriptorUpdateTemplate* pDescriptorUpdateTemplate) |
| 15538 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 15539 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15540 | mImpl->log("start vkCreateDescriptorUpdateTemplateKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15541 | auto stream = mImpl->stream(); |
| 15542 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15543 | auto resources = mImpl->resources(); |
| 15544 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 15545 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15546 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15547 | VkDescriptorUpdateTemplateCreateInfo* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 15548 | VkAllocationCallbacks* local_pAllocator; |
| 15549 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15550 | local_pCreateInfo = nullptr; |
| 15551 | if (pCreateInfo) |
| 15552 | { |
| 15553 | local_pCreateInfo = (VkDescriptorUpdateTemplateCreateInfo*)pool->alloc(sizeof(const VkDescriptorUpdateTemplateCreateInfo)); |
| 15554 | deepcopy_VkDescriptorUpdateTemplateCreateInfo(pool, pCreateInfo, (VkDescriptorUpdateTemplateCreateInfo*)(local_pCreateInfo)); |
| 15555 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15556 | local_pAllocator = nullptr; |
| 15557 | if (pAllocator) |
| 15558 | { |
| 15559 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 15560 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 15561 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 15562 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 15563 | if (local_pCreateInfo) |
| 15564 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 15565 | transform_tohost_VkDescriptorUpdateTemplateCreateInfo(mImpl->resources(), (VkDescriptorUpdateTemplateCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 15566 | } |
| 15567 | if (local_pAllocator) |
| 15568 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 15569 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 15570 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15571 | countingStream->rewind(); |
| 15572 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15573 | uint64_t cgen_var_1053; |
| 15574 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1053, 1); |
| 15575 | countingStream->write((uint64_t*)&cgen_var_1053, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15576 | marshal_VkDescriptorUpdateTemplateCreateInfo(countingStream, (VkDescriptorUpdateTemplateCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 15577 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15578 | uint64_t cgen_var_1054 = (uint64_t)(uintptr_t)local_pAllocator; |
| 15579 | countingStream->putBe64(cgen_var_1054); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15580 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15581 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15582 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15583 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15584 | uint64_t cgen_var_1055; |
| 15585 | countingStream->handleMapping()->mapHandles_VkDescriptorUpdateTemplate_u64(pDescriptorUpdateTemplate, &cgen_var_1055, 1); |
| 15586 | countingStream->write((uint64_t*)&cgen_var_1055, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15587 | } |
| 15588 | uint32_t packetSize_vkCreateDescriptorUpdateTemplateKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 15589 | countingStream->rewind(); |
| 15590 | uint32_t opcode_vkCreateDescriptorUpdateTemplateKHR = OP_vkCreateDescriptorUpdateTemplateKHR; |
| 15591 | stream->write(&opcode_vkCreateDescriptorUpdateTemplateKHR, sizeof(uint32_t)); |
| 15592 | stream->write(&packetSize_vkCreateDescriptorUpdateTemplateKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15593 | uint64_t cgen_var_1056; |
| 15594 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1056, 1); |
| 15595 | stream->write((uint64_t*)&cgen_var_1056, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15596 | marshal_VkDescriptorUpdateTemplateCreateInfo(stream, (VkDescriptorUpdateTemplateCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 15597 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15598 | uint64_t cgen_var_1057 = (uint64_t)(uintptr_t)local_pAllocator; |
| 15599 | stream->putBe64(cgen_var_1057); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15600 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15601 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15602 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15603 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 15604 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15605 | uint64_t cgen_var_1058; |
| 15606 | stream->handleMapping()->mapHandles_VkDescriptorUpdateTemplate_u64(pDescriptorUpdateTemplate, &cgen_var_1058, 1); |
| 15607 | stream->write((uint64_t*)&cgen_var_1058, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 15608 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 1dafbc3 | 2019-02-23 10:52:04 -0800 | [diff] [blame] | 15609 | stream->setHandleMapping(resources->createMapping()); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15610 | uint64_t cgen_var_1059; |
| 15611 | stream->read((uint64_t*)&cgen_var_1059, 8); |
| 15612 | stream->handleMapping()->mapHandles_u64_VkDescriptorUpdateTemplate(&cgen_var_1059, (VkDescriptorUpdateTemplate*)pDescriptorUpdateTemplate, 1); |
| Lingfeng Yang | 1dafbc3 | 2019-02-23 10:52:04 -0800 | [diff] [blame] | 15613 | stream->unsetHandleMapping(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15614 | VkResult vkCreateDescriptorUpdateTemplateKHR_VkResult_return = (VkResult)0; |
| 15615 | stream->read(&vkCreateDescriptorUpdateTemplateKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 15616 | mImpl->resources()->on_vkCreateDescriptorUpdateTemplateKHR(this, vkCreateDescriptorUpdateTemplateKHR_VkResult_return, device, pCreateInfo, pAllocator, pDescriptorUpdateTemplate); |
| 15617 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15618 | countingStream->clearPool(); |
| 15619 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15620 | mImpl->log("finish vkCreateDescriptorUpdateTemplateKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15621 | return vkCreateDescriptorUpdateTemplateKHR_VkResult_return; |
| 15622 | } |
| 15623 | |
| 15624 | void VkEncoder::vkDestroyDescriptorUpdateTemplateKHR( |
| 15625 | VkDevice device, |
| 15626 | VkDescriptorUpdateTemplate descriptorUpdateTemplate, |
| 15627 | const VkAllocationCallbacks* pAllocator) |
| 15628 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 15629 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15630 | mImpl->log("start vkDestroyDescriptorUpdateTemplateKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15631 | auto stream = mImpl->stream(); |
| 15632 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15633 | auto resources = mImpl->resources(); |
| 15634 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 15635 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15636 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15637 | VkDescriptorUpdateTemplate local_descriptorUpdateTemplate; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15638 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 15639 | local_device = device; |
| 15640 | local_descriptorUpdateTemplate = descriptorUpdateTemplate; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15641 | local_pAllocator = nullptr; |
| 15642 | if (pAllocator) |
| 15643 | { |
| 15644 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 15645 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 15646 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 15647 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 15648 | if (local_pAllocator) |
| 15649 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 15650 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 15651 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15652 | countingStream->rewind(); |
| 15653 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15654 | uint64_t cgen_var_1060; |
| 15655 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1060, 1); |
| 15656 | countingStream->write((uint64_t*)&cgen_var_1060, 1 * 8); |
| 15657 | uint64_t cgen_var_1061; |
| 15658 | countingStream->handleMapping()->mapHandles_VkDescriptorUpdateTemplate_u64(&local_descriptorUpdateTemplate, &cgen_var_1061, 1); |
| 15659 | countingStream->write((uint64_t*)&cgen_var_1061, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 15660 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15661 | uint64_t cgen_var_1062 = (uint64_t)(uintptr_t)local_pAllocator; |
| 15662 | countingStream->putBe64(cgen_var_1062); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15663 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15664 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15665 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15666 | } |
| 15667 | } |
| 15668 | uint32_t packetSize_vkDestroyDescriptorUpdateTemplateKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 15669 | countingStream->rewind(); |
| 15670 | uint32_t opcode_vkDestroyDescriptorUpdateTemplateKHR = OP_vkDestroyDescriptorUpdateTemplateKHR; |
| 15671 | stream->write(&opcode_vkDestroyDescriptorUpdateTemplateKHR, sizeof(uint32_t)); |
| 15672 | stream->write(&packetSize_vkDestroyDescriptorUpdateTemplateKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15673 | uint64_t cgen_var_1063; |
| 15674 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1063, 1); |
| 15675 | stream->write((uint64_t*)&cgen_var_1063, 1 * 8); |
| 15676 | uint64_t cgen_var_1064; |
| 15677 | stream->handleMapping()->mapHandles_VkDescriptorUpdateTemplate_u64(&local_descriptorUpdateTemplate, &cgen_var_1064, 1); |
| 15678 | stream->write((uint64_t*)&cgen_var_1064, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 15679 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15680 | uint64_t cgen_var_1065 = (uint64_t)(uintptr_t)local_pAllocator; |
| 15681 | stream->putBe64(cgen_var_1065); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15682 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15683 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15684 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15685 | } |
| Lingfeng Yang | 1dafbc3 | 2019-02-23 10:52:04 -0800 | [diff] [blame] | 15686 | resources->destroyMapping()->mapHandles_VkDescriptorUpdateTemplate((VkDescriptorUpdateTemplate*)&descriptorUpdateTemplate); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 15687 | pool->freeAll(); |
| 15688 | countingStream->clearPool(); |
| 15689 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15690 | mImpl->log("finish vkDestroyDescriptorUpdateTemplateKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15691 | } |
| 15692 | |
| 15693 | void VkEncoder::vkUpdateDescriptorSetWithTemplateKHR( |
| 15694 | VkDevice device, |
| 15695 | VkDescriptorSet descriptorSet, |
| 15696 | VkDescriptorUpdateTemplate descriptorUpdateTemplate, |
| 15697 | const void* pData) |
| 15698 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 15699 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15700 | mImpl->log("start vkUpdateDescriptorSetWithTemplateKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15701 | auto stream = mImpl->stream(); |
| 15702 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15703 | auto resources = mImpl->resources(); |
| 15704 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 15705 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15706 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15707 | VkDescriptorSet local_descriptorSet; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15708 | VkDescriptorUpdateTemplate local_descriptorUpdateTemplate; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15709 | void* local_pData; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 15710 | local_device = device; |
| 15711 | local_descriptorSet = descriptorSet; |
| 15712 | local_descriptorUpdateTemplate = descriptorUpdateTemplate; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15713 | local_pData = nullptr; |
| 15714 | if (pData) |
| 15715 | { |
| 15716 | local_pData = (void*)pool->dupArray(pData, sizeof(const uint8_t)); |
| 15717 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15718 | countingStream->rewind(); |
| 15719 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15720 | uint64_t cgen_var_1066; |
| 15721 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1066, 1); |
| 15722 | countingStream->write((uint64_t*)&cgen_var_1066, 1 * 8); |
| 15723 | uint64_t cgen_var_1067; |
| 15724 | countingStream->handleMapping()->mapHandles_VkDescriptorSet_u64(&local_descriptorSet, &cgen_var_1067, 1); |
| 15725 | countingStream->write((uint64_t*)&cgen_var_1067, 1 * 8); |
| 15726 | uint64_t cgen_var_1068; |
| 15727 | countingStream->handleMapping()->mapHandles_VkDescriptorUpdateTemplate_u64(&local_descriptorUpdateTemplate, &cgen_var_1068, 1); |
| 15728 | countingStream->write((uint64_t*)&cgen_var_1068, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 15729 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15730 | uint64_t cgen_var_1069 = (uint64_t)(uintptr_t)local_pData; |
| 15731 | countingStream->putBe64(cgen_var_1069); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15732 | if (local_pData) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15733 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15734 | countingStream->write((void*)local_pData, sizeof(uint8_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15735 | } |
| 15736 | } |
| 15737 | uint32_t packetSize_vkUpdateDescriptorSetWithTemplateKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 15738 | countingStream->rewind(); |
| 15739 | uint32_t opcode_vkUpdateDescriptorSetWithTemplateKHR = OP_vkUpdateDescriptorSetWithTemplateKHR; |
| 15740 | stream->write(&opcode_vkUpdateDescriptorSetWithTemplateKHR, sizeof(uint32_t)); |
| 15741 | stream->write(&packetSize_vkUpdateDescriptorSetWithTemplateKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15742 | uint64_t cgen_var_1070; |
| 15743 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1070, 1); |
| 15744 | stream->write((uint64_t*)&cgen_var_1070, 1 * 8); |
| 15745 | uint64_t cgen_var_1071; |
| 15746 | stream->handleMapping()->mapHandles_VkDescriptorSet_u64(&local_descriptorSet, &cgen_var_1071, 1); |
| 15747 | stream->write((uint64_t*)&cgen_var_1071, 1 * 8); |
| 15748 | uint64_t cgen_var_1072; |
| 15749 | stream->handleMapping()->mapHandles_VkDescriptorUpdateTemplate_u64(&local_descriptorUpdateTemplate, &cgen_var_1072, 1); |
| 15750 | stream->write((uint64_t*)&cgen_var_1072, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 15751 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15752 | uint64_t cgen_var_1073 = (uint64_t)(uintptr_t)local_pData; |
| 15753 | stream->putBe64(cgen_var_1073); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15754 | if (local_pData) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15755 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15756 | stream->write((void*)local_pData, sizeof(uint8_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15757 | } |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 15758 | pool->freeAll(); |
| 15759 | countingStream->clearPool(); |
| 15760 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15761 | mImpl->log("finish vkUpdateDescriptorSetWithTemplateKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15762 | } |
| 15763 | |
| 15764 | #endif |
| 15765 | #ifdef VK_KHR_create_renderpass2 |
| 15766 | VkResult VkEncoder::vkCreateRenderPass2KHR( |
| 15767 | VkDevice device, |
| 15768 | const VkRenderPassCreateInfo2KHR* pCreateInfo, |
| 15769 | const VkAllocationCallbacks* pAllocator, |
| 15770 | VkRenderPass* pRenderPass) |
| 15771 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 15772 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15773 | mImpl->log("start vkCreateRenderPass2KHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15774 | auto stream = mImpl->stream(); |
| 15775 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15776 | auto resources = mImpl->resources(); |
| 15777 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 15778 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15779 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15780 | VkRenderPassCreateInfo2KHR* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 15781 | VkAllocationCallbacks* local_pAllocator; |
| 15782 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15783 | local_pCreateInfo = nullptr; |
| 15784 | if (pCreateInfo) |
| 15785 | { |
| 15786 | local_pCreateInfo = (VkRenderPassCreateInfo2KHR*)pool->alloc(sizeof(const VkRenderPassCreateInfo2KHR)); |
| 15787 | deepcopy_VkRenderPassCreateInfo2KHR(pool, pCreateInfo, (VkRenderPassCreateInfo2KHR*)(local_pCreateInfo)); |
| 15788 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15789 | local_pAllocator = nullptr; |
| 15790 | if (pAllocator) |
| 15791 | { |
| 15792 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 15793 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 15794 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 15795 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 15796 | if (local_pCreateInfo) |
| 15797 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 15798 | transform_tohost_VkRenderPassCreateInfo2KHR(mImpl->resources(), (VkRenderPassCreateInfo2KHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 15799 | } |
| 15800 | if (local_pAllocator) |
| 15801 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 15802 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 15803 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15804 | countingStream->rewind(); |
| 15805 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15806 | uint64_t cgen_var_1074; |
| 15807 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1074, 1); |
| 15808 | countingStream->write((uint64_t*)&cgen_var_1074, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15809 | marshal_VkRenderPassCreateInfo2KHR(countingStream, (VkRenderPassCreateInfo2KHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 15810 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15811 | uint64_t cgen_var_1075 = (uint64_t)(uintptr_t)local_pAllocator; |
| 15812 | countingStream->putBe64(cgen_var_1075); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15813 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15814 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15815 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15816 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15817 | uint64_t cgen_var_1076; |
| 15818 | countingStream->handleMapping()->mapHandles_VkRenderPass_u64(pRenderPass, &cgen_var_1076, 1); |
| 15819 | countingStream->write((uint64_t*)&cgen_var_1076, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15820 | } |
| 15821 | uint32_t packetSize_vkCreateRenderPass2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 15822 | countingStream->rewind(); |
| 15823 | uint32_t opcode_vkCreateRenderPass2KHR = OP_vkCreateRenderPass2KHR; |
| 15824 | stream->write(&opcode_vkCreateRenderPass2KHR, sizeof(uint32_t)); |
| 15825 | stream->write(&packetSize_vkCreateRenderPass2KHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15826 | uint64_t cgen_var_1077; |
| 15827 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1077, 1); |
| 15828 | stream->write((uint64_t*)&cgen_var_1077, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15829 | marshal_VkRenderPassCreateInfo2KHR(stream, (VkRenderPassCreateInfo2KHR*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 15830 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15831 | uint64_t cgen_var_1078 = (uint64_t)(uintptr_t)local_pAllocator; |
| 15832 | stream->putBe64(cgen_var_1078); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15833 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15834 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15835 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15836 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 15837 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15838 | uint64_t cgen_var_1079; |
| 15839 | stream->handleMapping()->mapHandles_VkRenderPass_u64(pRenderPass, &cgen_var_1079, 1); |
| 15840 | stream->write((uint64_t*)&cgen_var_1079, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 15841 | stream->setHandleMapping(resources->unwrapMapping()); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15842 | uint64_t cgen_var_1080; |
| 15843 | stream->read((uint64_t*)&cgen_var_1080, 8); |
| 15844 | stream->handleMapping()->mapHandles_u64_VkRenderPass(&cgen_var_1080, (VkRenderPass*)pRenderPass, 1); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15845 | VkResult vkCreateRenderPass2KHR_VkResult_return = (VkResult)0; |
| 15846 | stream->read(&vkCreateRenderPass2KHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 15847 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 15848 | countingStream->clearPool(); |
| 15849 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15850 | mImpl->log("finish vkCreateRenderPass2KHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15851 | return vkCreateRenderPass2KHR_VkResult_return; |
| 15852 | } |
| 15853 | |
| 15854 | void VkEncoder::vkCmdBeginRenderPass2KHR( |
| 15855 | VkCommandBuffer commandBuffer, |
| 15856 | const VkRenderPassBeginInfo* pRenderPassBegin, |
| 15857 | const VkSubpassBeginInfoKHR* pSubpassBeginInfo) |
| 15858 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 15859 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15860 | mImpl->log("start vkCmdBeginRenderPass2KHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15861 | auto stream = mImpl->stream(); |
| 15862 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15863 | auto resources = mImpl->resources(); |
| 15864 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 15865 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15866 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15867 | VkRenderPassBeginInfo* local_pRenderPassBegin; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 15868 | VkSubpassBeginInfoKHR* local_pSubpassBeginInfo; |
| 15869 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15870 | local_pRenderPassBegin = nullptr; |
| 15871 | if (pRenderPassBegin) |
| 15872 | { |
| 15873 | local_pRenderPassBegin = (VkRenderPassBeginInfo*)pool->alloc(sizeof(const VkRenderPassBeginInfo)); |
| 15874 | deepcopy_VkRenderPassBeginInfo(pool, pRenderPassBegin, (VkRenderPassBeginInfo*)(local_pRenderPassBegin)); |
| 15875 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15876 | local_pSubpassBeginInfo = nullptr; |
| 15877 | if (pSubpassBeginInfo) |
| 15878 | { |
| 15879 | local_pSubpassBeginInfo = (VkSubpassBeginInfoKHR*)pool->alloc(sizeof(const VkSubpassBeginInfoKHR)); |
| 15880 | deepcopy_VkSubpassBeginInfoKHR(pool, pSubpassBeginInfo, (VkSubpassBeginInfoKHR*)(local_pSubpassBeginInfo)); |
| 15881 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 15882 | if (local_pRenderPassBegin) |
| 15883 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 15884 | transform_tohost_VkRenderPassBeginInfo(mImpl->resources(), (VkRenderPassBeginInfo*)(local_pRenderPassBegin)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 15885 | } |
| 15886 | if (local_pSubpassBeginInfo) |
| 15887 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 15888 | transform_tohost_VkSubpassBeginInfoKHR(mImpl->resources(), (VkSubpassBeginInfoKHR*)(local_pSubpassBeginInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 15889 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15890 | countingStream->rewind(); |
| 15891 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15892 | uint64_t cgen_var_1081; |
| 15893 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1081, 1); |
| 15894 | countingStream->write((uint64_t*)&cgen_var_1081, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15895 | marshal_VkRenderPassBeginInfo(countingStream, (VkRenderPassBeginInfo*)(local_pRenderPassBegin)); |
| 15896 | marshal_VkSubpassBeginInfoKHR(countingStream, (VkSubpassBeginInfoKHR*)(local_pSubpassBeginInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15897 | } |
| 15898 | uint32_t packetSize_vkCmdBeginRenderPass2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 15899 | countingStream->rewind(); |
| 15900 | uint32_t opcode_vkCmdBeginRenderPass2KHR = OP_vkCmdBeginRenderPass2KHR; |
| 15901 | stream->write(&opcode_vkCmdBeginRenderPass2KHR, sizeof(uint32_t)); |
| 15902 | stream->write(&packetSize_vkCmdBeginRenderPass2KHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15903 | uint64_t cgen_var_1082; |
| 15904 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1082, 1); |
| 15905 | stream->write((uint64_t*)&cgen_var_1082, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15906 | marshal_VkRenderPassBeginInfo(stream, (VkRenderPassBeginInfo*)(local_pRenderPassBegin)); |
| 15907 | marshal_VkSubpassBeginInfoKHR(stream, (VkSubpassBeginInfoKHR*)(local_pSubpassBeginInfo)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 15908 | pool->freeAll(); |
| 15909 | countingStream->clearPool(); |
| 15910 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15911 | mImpl->log("finish vkCmdBeginRenderPass2KHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15912 | } |
| 15913 | |
| 15914 | void VkEncoder::vkCmdNextSubpass2KHR( |
| 15915 | VkCommandBuffer commandBuffer, |
| 15916 | const VkSubpassBeginInfoKHR* pSubpassBeginInfo, |
| 15917 | const VkSubpassEndInfoKHR* pSubpassEndInfo) |
| 15918 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 15919 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15920 | mImpl->log("start vkCmdNextSubpass2KHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15921 | auto stream = mImpl->stream(); |
| 15922 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15923 | auto resources = mImpl->resources(); |
| 15924 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 15925 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15926 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15927 | VkSubpassBeginInfoKHR* local_pSubpassBeginInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 15928 | VkSubpassEndInfoKHR* local_pSubpassEndInfo; |
| 15929 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15930 | local_pSubpassBeginInfo = nullptr; |
| 15931 | if (pSubpassBeginInfo) |
| 15932 | { |
| 15933 | local_pSubpassBeginInfo = (VkSubpassBeginInfoKHR*)pool->alloc(sizeof(const VkSubpassBeginInfoKHR)); |
| 15934 | deepcopy_VkSubpassBeginInfoKHR(pool, pSubpassBeginInfo, (VkSubpassBeginInfoKHR*)(local_pSubpassBeginInfo)); |
| 15935 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15936 | local_pSubpassEndInfo = nullptr; |
| 15937 | if (pSubpassEndInfo) |
| 15938 | { |
| 15939 | local_pSubpassEndInfo = (VkSubpassEndInfoKHR*)pool->alloc(sizeof(const VkSubpassEndInfoKHR)); |
| 15940 | deepcopy_VkSubpassEndInfoKHR(pool, pSubpassEndInfo, (VkSubpassEndInfoKHR*)(local_pSubpassEndInfo)); |
| 15941 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 15942 | if (local_pSubpassBeginInfo) |
| 15943 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 15944 | transform_tohost_VkSubpassBeginInfoKHR(mImpl->resources(), (VkSubpassBeginInfoKHR*)(local_pSubpassBeginInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 15945 | } |
| 15946 | if (local_pSubpassEndInfo) |
| 15947 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 15948 | transform_tohost_VkSubpassEndInfoKHR(mImpl->resources(), (VkSubpassEndInfoKHR*)(local_pSubpassEndInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 15949 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15950 | countingStream->rewind(); |
| 15951 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15952 | uint64_t cgen_var_1083; |
| 15953 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1083, 1); |
| 15954 | countingStream->write((uint64_t*)&cgen_var_1083, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15955 | marshal_VkSubpassBeginInfoKHR(countingStream, (VkSubpassBeginInfoKHR*)(local_pSubpassBeginInfo)); |
| 15956 | marshal_VkSubpassEndInfoKHR(countingStream, (VkSubpassEndInfoKHR*)(local_pSubpassEndInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15957 | } |
| 15958 | uint32_t packetSize_vkCmdNextSubpass2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 15959 | countingStream->rewind(); |
| 15960 | uint32_t opcode_vkCmdNextSubpass2KHR = OP_vkCmdNextSubpass2KHR; |
| 15961 | stream->write(&opcode_vkCmdNextSubpass2KHR, sizeof(uint32_t)); |
| 15962 | stream->write(&packetSize_vkCmdNextSubpass2KHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 15963 | uint64_t cgen_var_1084; |
| 15964 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1084, 1); |
| 15965 | stream->write((uint64_t*)&cgen_var_1084, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15966 | marshal_VkSubpassBeginInfoKHR(stream, (VkSubpassBeginInfoKHR*)(local_pSubpassBeginInfo)); |
| 15967 | marshal_VkSubpassEndInfoKHR(stream, (VkSubpassEndInfoKHR*)(local_pSubpassEndInfo)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 15968 | pool->freeAll(); |
| 15969 | countingStream->clearPool(); |
| 15970 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15971 | mImpl->log("finish vkCmdNextSubpass2KHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15972 | } |
| 15973 | |
| 15974 | void VkEncoder::vkCmdEndRenderPass2KHR( |
| 15975 | VkCommandBuffer commandBuffer, |
| 15976 | const VkSubpassEndInfoKHR* pSubpassEndInfo) |
| 15977 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 15978 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 15979 | mImpl->log("start vkCmdEndRenderPass2KHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15980 | auto stream = mImpl->stream(); |
| 15981 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15982 | auto resources = mImpl->resources(); |
| 15983 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 15984 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15985 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15986 | VkSubpassEndInfoKHR* local_pSubpassEndInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 15987 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 15988 | local_pSubpassEndInfo = nullptr; |
| 15989 | if (pSubpassEndInfo) |
| 15990 | { |
| 15991 | local_pSubpassEndInfo = (VkSubpassEndInfoKHR*)pool->alloc(sizeof(const VkSubpassEndInfoKHR)); |
| 15992 | deepcopy_VkSubpassEndInfoKHR(pool, pSubpassEndInfo, (VkSubpassEndInfoKHR*)(local_pSubpassEndInfo)); |
| 15993 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 15994 | if (local_pSubpassEndInfo) |
| 15995 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 15996 | transform_tohost_VkSubpassEndInfoKHR(mImpl->resources(), (VkSubpassEndInfoKHR*)(local_pSubpassEndInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 15997 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 15998 | countingStream->rewind(); |
| 15999 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16000 | uint64_t cgen_var_1085; |
| 16001 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1085, 1); |
| 16002 | countingStream->write((uint64_t*)&cgen_var_1085, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16003 | marshal_VkSubpassEndInfoKHR(countingStream, (VkSubpassEndInfoKHR*)(local_pSubpassEndInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16004 | } |
| 16005 | uint32_t packetSize_vkCmdEndRenderPass2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 16006 | countingStream->rewind(); |
| 16007 | uint32_t opcode_vkCmdEndRenderPass2KHR = OP_vkCmdEndRenderPass2KHR; |
| 16008 | stream->write(&opcode_vkCmdEndRenderPass2KHR, sizeof(uint32_t)); |
| 16009 | stream->write(&packetSize_vkCmdEndRenderPass2KHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16010 | uint64_t cgen_var_1086; |
| 16011 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1086, 1); |
| 16012 | stream->write((uint64_t*)&cgen_var_1086, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16013 | marshal_VkSubpassEndInfoKHR(stream, (VkSubpassEndInfoKHR*)(local_pSubpassEndInfo)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 16014 | pool->freeAll(); |
| 16015 | countingStream->clearPool(); |
| 16016 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16017 | mImpl->log("finish vkCmdEndRenderPass2KHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16018 | } |
| 16019 | |
| 16020 | #endif |
| 16021 | #ifdef VK_KHR_shared_presentable_image |
| 16022 | VkResult VkEncoder::vkGetSwapchainStatusKHR( |
| 16023 | VkDevice device, |
| 16024 | VkSwapchainKHR swapchain) |
| 16025 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 16026 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16027 | mImpl->log("start vkGetSwapchainStatusKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16028 | auto stream = mImpl->stream(); |
| 16029 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16030 | auto resources = mImpl->resources(); |
| 16031 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 16032 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16033 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16034 | VkSwapchainKHR local_swapchain; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 16035 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16036 | local_swapchain = swapchain; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16037 | countingStream->rewind(); |
| 16038 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16039 | uint64_t cgen_var_1087; |
| 16040 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1087, 1); |
| 16041 | countingStream->write((uint64_t*)&cgen_var_1087, 1 * 8); |
| 16042 | uint64_t cgen_var_1088; |
| 16043 | countingStream->handleMapping()->mapHandles_VkSwapchainKHR_u64(&local_swapchain, &cgen_var_1088, 1); |
| 16044 | countingStream->write((uint64_t*)&cgen_var_1088, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16045 | } |
| 16046 | uint32_t packetSize_vkGetSwapchainStatusKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 16047 | countingStream->rewind(); |
| 16048 | uint32_t opcode_vkGetSwapchainStatusKHR = OP_vkGetSwapchainStatusKHR; |
| 16049 | stream->write(&opcode_vkGetSwapchainStatusKHR, sizeof(uint32_t)); |
| 16050 | stream->write(&packetSize_vkGetSwapchainStatusKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16051 | uint64_t cgen_var_1089; |
| 16052 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1089, 1); |
| 16053 | stream->write((uint64_t*)&cgen_var_1089, 1 * 8); |
| 16054 | uint64_t cgen_var_1090; |
| 16055 | stream->handleMapping()->mapHandles_VkSwapchainKHR_u64(&local_swapchain, &cgen_var_1090, 1); |
| 16056 | stream->write((uint64_t*)&cgen_var_1090, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16057 | VkResult vkGetSwapchainStatusKHR_VkResult_return = (VkResult)0; |
| 16058 | stream->read(&vkGetSwapchainStatusKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 16059 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16060 | countingStream->clearPool(); |
| 16061 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16062 | mImpl->log("finish vkGetSwapchainStatusKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16063 | return vkGetSwapchainStatusKHR_VkResult_return; |
| 16064 | } |
| 16065 | |
| 16066 | #endif |
| 16067 | #ifdef VK_KHR_external_fence_capabilities |
| 16068 | void VkEncoder::vkGetPhysicalDeviceExternalFencePropertiesKHR( |
| 16069 | VkPhysicalDevice physicalDevice, |
| 16070 | const VkPhysicalDeviceExternalFenceInfo* pExternalFenceInfo, |
| 16071 | VkExternalFenceProperties* pExternalFenceProperties) |
| 16072 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 16073 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16074 | mImpl->log("start vkGetPhysicalDeviceExternalFencePropertiesKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16075 | auto stream = mImpl->stream(); |
| 16076 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16077 | auto resources = mImpl->resources(); |
| 16078 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 16079 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16080 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16081 | VkPhysicalDeviceExternalFenceInfo* local_pExternalFenceInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 16082 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16083 | local_pExternalFenceInfo = nullptr; |
| 16084 | if (pExternalFenceInfo) |
| 16085 | { |
| 16086 | local_pExternalFenceInfo = (VkPhysicalDeviceExternalFenceInfo*)pool->alloc(sizeof(const VkPhysicalDeviceExternalFenceInfo)); |
| 16087 | deepcopy_VkPhysicalDeviceExternalFenceInfo(pool, pExternalFenceInfo, (VkPhysicalDeviceExternalFenceInfo*)(local_pExternalFenceInfo)); |
| 16088 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 16089 | if (local_pExternalFenceInfo) |
| 16090 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 16091 | transform_tohost_VkPhysicalDeviceExternalFenceInfo(mImpl->resources(), (VkPhysicalDeviceExternalFenceInfo*)(local_pExternalFenceInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 16092 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16093 | countingStream->rewind(); |
| 16094 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16095 | uint64_t cgen_var_1091; |
| 16096 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1091, 1); |
| 16097 | countingStream->write((uint64_t*)&cgen_var_1091, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16098 | marshal_VkPhysicalDeviceExternalFenceInfo(countingStream, (VkPhysicalDeviceExternalFenceInfo*)(local_pExternalFenceInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16099 | marshal_VkExternalFenceProperties(countingStream, (VkExternalFenceProperties*)(pExternalFenceProperties)); |
| 16100 | } |
| 16101 | uint32_t packetSize_vkGetPhysicalDeviceExternalFencePropertiesKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 16102 | countingStream->rewind(); |
| 16103 | uint32_t opcode_vkGetPhysicalDeviceExternalFencePropertiesKHR = OP_vkGetPhysicalDeviceExternalFencePropertiesKHR; |
| 16104 | stream->write(&opcode_vkGetPhysicalDeviceExternalFencePropertiesKHR, sizeof(uint32_t)); |
| 16105 | stream->write(&packetSize_vkGetPhysicalDeviceExternalFencePropertiesKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16106 | uint64_t cgen_var_1092; |
| 16107 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1092, 1); |
| 16108 | stream->write((uint64_t*)&cgen_var_1092, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16109 | marshal_VkPhysicalDeviceExternalFenceInfo(stream, (VkPhysicalDeviceExternalFenceInfo*)(local_pExternalFenceInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16110 | marshal_VkExternalFenceProperties(stream, (VkExternalFenceProperties*)(pExternalFenceProperties)); |
| 16111 | unmarshal_VkExternalFenceProperties(stream, (VkExternalFenceProperties*)(pExternalFenceProperties)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 16112 | if (pExternalFenceProperties) |
| 16113 | { |
| 16114 | transform_fromhost_VkExternalFenceProperties(mImpl->resources(), (VkExternalFenceProperties*)(pExternalFenceProperties)); |
| 16115 | } |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 16116 | pool->freeAll(); |
| 16117 | countingStream->clearPool(); |
| 16118 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16119 | mImpl->log("finish vkGetPhysicalDeviceExternalFencePropertiesKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16120 | } |
| 16121 | |
| 16122 | #endif |
| 16123 | #ifdef VK_KHR_external_fence |
| 16124 | #endif |
| 16125 | #ifdef VK_KHR_external_fence_win32 |
| 16126 | VkResult VkEncoder::vkImportFenceWin32HandleKHR( |
| 16127 | VkDevice device, |
| 16128 | const VkImportFenceWin32HandleInfoKHR* pImportFenceWin32HandleInfo) |
| 16129 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 16130 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16131 | mImpl->log("start vkImportFenceWin32HandleKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16132 | auto stream = mImpl->stream(); |
| 16133 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16134 | auto resources = mImpl->resources(); |
| 16135 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 16136 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16137 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16138 | VkImportFenceWin32HandleInfoKHR* local_pImportFenceWin32HandleInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 16139 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16140 | local_pImportFenceWin32HandleInfo = nullptr; |
| 16141 | if (pImportFenceWin32HandleInfo) |
| 16142 | { |
| 16143 | local_pImportFenceWin32HandleInfo = (VkImportFenceWin32HandleInfoKHR*)pool->alloc(sizeof(const VkImportFenceWin32HandleInfoKHR)); |
| 16144 | deepcopy_VkImportFenceWin32HandleInfoKHR(pool, pImportFenceWin32HandleInfo, (VkImportFenceWin32HandleInfoKHR*)(local_pImportFenceWin32HandleInfo)); |
| 16145 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 16146 | if (local_pImportFenceWin32HandleInfo) |
| 16147 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 16148 | transform_tohost_VkImportFenceWin32HandleInfoKHR(mImpl->resources(), (VkImportFenceWin32HandleInfoKHR*)(local_pImportFenceWin32HandleInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 16149 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16150 | countingStream->rewind(); |
| 16151 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16152 | uint64_t cgen_var_1093; |
| 16153 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1093, 1); |
| 16154 | countingStream->write((uint64_t*)&cgen_var_1093, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16155 | marshal_VkImportFenceWin32HandleInfoKHR(countingStream, (VkImportFenceWin32HandleInfoKHR*)(local_pImportFenceWin32HandleInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16156 | } |
| 16157 | uint32_t packetSize_vkImportFenceWin32HandleKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 16158 | countingStream->rewind(); |
| 16159 | uint32_t opcode_vkImportFenceWin32HandleKHR = OP_vkImportFenceWin32HandleKHR; |
| 16160 | stream->write(&opcode_vkImportFenceWin32HandleKHR, sizeof(uint32_t)); |
| 16161 | stream->write(&packetSize_vkImportFenceWin32HandleKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16162 | uint64_t cgen_var_1094; |
| 16163 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1094, 1); |
| 16164 | stream->write((uint64_t*)&cgen_var_1094, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16165 | marshal_VkImportFenceWin32HandleInfoKHR(stream, (VkImportFenceWin32HandleInfoKHR*)(local_pImportFenceWin32HandleInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16166 | VkResult vkImportFenceWin32HandleKHR_VkResult_return = (VkResult)0; |
| 16167 | stream->read(&vkImportFenceWin32HandleKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 16168 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16169 | countingStream->clearPool(); |
| 16170 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16171 | mImpl->log("finish vkImportFenceWin32HandleKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16172 | return vkImportFenceWin32HandleKHR_VkResult_return; |
| 16173 | } |
| 16174 | |
| 16175 | VkResult VkEncoder::vkGetFenceWin32HandleKHR( |
| 16176 | VkDevice device, |
| 16177 | const VkFenceGetWin32HandleInfoKHR* pGetWin32HandleInfo, |
| 16178 | HANDLE* pHandle) |
| 16179 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 16180 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16181 | mImpl->log("start vkGetFenceWin32HandleKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16182 | auto stream = mImpl->stream(); |
| 16183 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16184 | auto resources = mImpl->resources(); |
| 16185 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 16186 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16187 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16188 | VkFenceGetWin32HandleInfoKHR* local_pGetWin32HandleInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 16189 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16190 | local_pGetWin32HandleInfo = nullptr; |
| 16191 | if (pGetWin32HandleInfo) |
| 16192 | { |
| 16193 | local_pGetWin32HandleInfo = (VkFenceGetWin32HandleInfoKHR*)pool->alloc(sizeof(const VkFenceGetWin32HandleInfoKHR)); |
| 16194 | deepcopy_VkFenceGetWin32HandleInfoKHR(pool, pGetWin32HandleInfo, (VkFenceGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo)); |
| 16195 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 16196 | if (local_pGetWin32HandleInfo) |
| 16197 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 16198 | transform_tohost_VkFenceGetWin32HandleInfoKHR(mImpl->resources(), (VkFenceGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo)); |
| 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_1095; |
| 16203 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1095, 1); |
| 16204 | countingStream->write((uint64_t*)&cgen_var_1095, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16205 | marshal_VkFenceGetWin32HandleInfoKHR(countingStream, (VkFenceGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16206 | countingStream->write((HANDLE*)pHandle, sizeof(HANDLE)); |
| 16207 | } |
| 16208 | uint32_t packetSize_vkGetFenceWin32HandleKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 16209 | countingStream->rewind(); |
| 16210 | uint32_t opcode_vkGetFenceWin32HandleKHR = OP_vkGetFenceWin32HandleKHR; |
| 16211 | stream->write(&opcode_vkGetFenceWin32HandleKHR, sizeof(uint32_t)); |
| 16212 | stream->write(&packetSize_vkGetFenceWin32HandleKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16213 | uint64_t cgen_var_1096; |
| 16214 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1096, 1); |
| 16215 | stream->write((uint64_t*)&cgen_var_1096, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16216 | marshal_VkFenceGetWin32HandleInfoKHR(stream, (VkFenceGetWin32HandleInfoKHR*)(local_pGetWin32HandleInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16217 | stream->write((HANDLE*)pHandle, sizeof(HANDLE)); |
| 16218 | stream->read((HANDLE*)pHandle, sizeof(HANDLE)); |
| 16219 | VkResult vkGetFenceWin32HandleKHR_VkResult_return = (VkResult)0; |
| 16220 | stream->read(&vkGetFenceWin32HandleKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 16221 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16222 | countingStream->clearPool(); |
| 16223 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16224 | mImpl->log("finish vkGetFenceWin32HandleKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16225 | return vkGetFenceWin32HandleKHR_VkResult_return; |
| 16226 | } |
| 16227 | |
| 16228 | #endif |
| 16229 | #ifdef VK_KHR_external_fence_fd |
| 16230 | VkResult VkEncoder::vkImportFenceFdKHR( |
| 16231 | VkDevice device, |
| 16232 | const VkImportFenceFdInfoKHR* pImportFenceFdInfo) |
| 16233 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 16234 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16235 | mImpl->log("start vkImportFenceFdKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16236 | auto stream = mImpl->stream(); |
| 16237 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16238 | auto resources = mImpl->resources(); |
| 16239 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 16240 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16241 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16242 | VkImportFenceFdInfoKHR* local_pImportFenceFdInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 16243 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16244 | local_pImportFenceFdInfo = nullptr; |
| 16245 | if (pImportFenceFdInfo) |
| 16246 | { |
| 16247 | local_pImportFenceFdInfo = (VkImportFenceFdInfoKHR*)pool->alloc(sizeof(const VkImportFenceFdInfoKHR)); |
| 16248 | deepcopy_VkImportFenceFdInfoKHR(pool, pImportFenceFdInfo, (VkImportFenceFdInfoKHR*)(local_pImportFenceFdInfo)); |
| 16249 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 16250 | if (local_pImportFenceFdInfo) |
| 16251 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 16252 | transform_tohost_VkImportFenceFdInfoKHR(mImpl->resources(), (VkImportFenceFdInfoKHR*)(local_pImportFenceFdInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 16253 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16254 | countingStream->rewind(); |
| 16255 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16256 | uint64_t cgen_var_1097; |
| 16257 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1097, 1); |
| 16258 | countingStream->write((uint64_t*)&cgen_var_1097, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16259 | marshal_VkImportFenceFdInfoKHR(countingStream, (VkImportFenceFdInfoKHR*)(local_pImportFenceFdInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16260 | } |
| 16261 | uint32_t packetSize_vkImportFenceFdKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 16262 | countingStream->rewind(); |
| 16263 | uint32_t opcode_vkImportFenceFdKHR = OP_vkImportFenceFdKHR; |
| 16264 | stream->write(&opcode_vkImportFenceFdKHR, sizeof(uint32_t)); |
| 16265 | stream->write(&packetSize_vkImportFenceFdKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16266 | uint64_t cgen_var_1098; |
| 16267 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1098, 1); |
| 16268 | stream->write((uint64_t*)&cgen_var_1098, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16269 | marshal_VkImportFenceFdInfoKHR(stream, (VkImportFenceFdInfoKHR*)(local_pImportFenceFdInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16270 | VkResult vkImportFenceFdKHR_VkResult_return = (VkResult)0; |
| 16271 | stream->read(&vkImportFenceFdKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 16272 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16273 | countingStream->clearPool(); |
| 16274 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16275 | mImpl->log("finish vkImportFenceFdKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16276 | return vkImportFenceFdKHR_VkResult_return; |
| 16277 | } |
| 16278 | |
| 16279 | VkResult VkEncoder::vkGetFenceFdKHR( |
| 16280 | VkDevice device, |
| 16281 | const VkFenceGetFdInfoKHR* pGetFdInfo, |
| 16282 | int* pFd) |
| 16283 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 16284 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16285 | mImpl->log("start vkGetFenceFdKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16286 | auto stream = mImpl->stream(); |
| 16287 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16288 | auto resources = mImpl->resources(); |
| 16289 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 16290 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16291 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16292 | VkFenceGetFdInfoKHR* local_pGetFdInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 16293 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16294 | local_pGetFdInfo = nullptr; |
| 16295 | if (pGetFdInfo) |
| 16296 | { |
| 16297 | local_pGetFdInfo = (VkFenceGetFdInfoKHR*)pool->alloc(sizeof(const VkFenceGetFdInfoKHR)); |
| 16298 | deepcopy_VkFenceGetFdInfoKHR(pool, pGetFdInfo, (VkFenceGetFdInfoKHR*)(local_pGetFdInfo)); |
| 16299 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 16300 | if (local_pGetFdInfo) |
| 16301 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 16302 | transform_tohost_VkFenceGetFdInfoKHR(mImpl->resources(), (VkFenceGetFdInfoKHR*)(local_pGetFdInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 16303 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16304 | countingStream->rewind(); |
| 16305 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16306 | uint64_t cgen_var_1099; |
| 16307 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1099, 1); |
| 16308 | countingStream->write((uint64_t*)&cgen_var_1099, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16309 | marshal_VkFenceGetFdInfoKHR(countingStream, (VkFenceGetFdInfoKHR*)(local_pGetFdInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16310 | countingStream->write((int*)pFd, sizeof(int)); |
| 16311 | } |
| 16312 | uint32_t packetSize_vkGetFenceFdKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 16313 | countingStream->rewind(); |
| 16314 | uint32_t opcode_vkGetFenceFdKHR = OP_vkGetFenceFdKHR; |
| 16315 | stream->write(&opcode_vkGetFenceFdKHR, sizeof(uint32_t)); |
| 16316 | stream->write(&packetSize_vkGetFenceFdKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16317 | uint64_t cgen_var_1100; |
| 16318 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1100, 1); |
| 16319 | stream->write((uint64_t*)&cgen_var_1100, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16320 | marshal_VkFenceGetFdInfoKHR(stream, (VkFenceGetFdInfoKHR*)(local_pGetFdInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16321 | stream->write((int*)pFd, sizeof(int)); |
| 16322 | stream->read((int*)pFd, sizeof(int)); |
| 16323 | VkResult vkGetFenceFdKHR_VkResult_return = (VkResult)0; |
| 16324 | stream->read(&vkGetFenceFdKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 16325 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16326 | countingStream->clearPool(); |
| 16327 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16328 | mImpl->log("finish vkGetFenceFdKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16329 | return vkGetFenceFdKHR_VkResult_return; |
| 16330 | } |
| 16331 | |
| 16332 | #endif |
| 16333 | #ifdef VK_KHR_maintenance2 |
| 16334 | #endif |
| 16335 | #ifdef VK_KHR_get_surface_capabilities2 |
| 16336 | VkResult VkEncoder::vkGetPhysicalDeviceSurfaceCapabilities2KHR( |
| 16337 | VkPhysicalDevice physicalDevice, |
| 16338 | const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, |
| 16339 | VkSurfaceCapabilities2KHR* pSurfaceCapabilities) |
| 16340 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 16341 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16342 | mImpl->log("start vkGetPhysicalDeviceSurfaceCapabilities2KHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16343 | auto stream = mImpl->stream(); |
| 16344 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16345 | auto resources = mImpl->resources(); |
| 16346 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 16347 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16348 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16349 | VkPhysicalDeviceSurfaceInfo2KHR* local_pSurfaceInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 16350 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16351 | local_pSurfaceInfo = nullptr; |
| 16352 | if (pSurfaceInfo) |
| 16353 | { |
| 16354 | local_pSurfaceInfo = (VkPhysicalDeviceSurfaceInfo2KHR*)pool->alloc(sizeof(const VkPhysicalDeviceSurfaceInfo2KHR)); |
| 16355 | deepcopy_VkPhysicalDeviceSurfaceInfo2KHR(pool, pSurfaceInfo, (VkPhysicalDeviceSurfaceInfo2KHR*)(local_pSurfaceInfo)); |
| 16356 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 16357 | if (local_pSurfaceInfo) |
| 16358 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 16359 | transform_tohost_VkPhysicalDeviceSurfaceInfo2KHR(mImpl->resources(), (VkPhysicalDeviceSurfaceInfo2KHR*)(local_pSurfaceInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 16360 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16361 | countingStream->rewind(); |
| 16362 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16363 | uint64_t cgen_var_1101; |
| 16364 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1101, 1); |
| 16365 | countingStream->write((uint64_t*)&cgen_var_1101, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16366 | marshal_VkPhysicalDeviceSurfaceInfo2KHR(countingStream, (VkPhysicalDeviceSurfaceInfo2KHR*)(local_pSurfaceInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16367 | marshal_VkSurfaceCapabilities2KHR(countingStream, (VkSurfaceCapabilities2KHR*)(pSurfaceCapabilities)); |
| 16368 | } |
| 16369 | uint32_t packetSize_vkGetPhysicalDeviceSurfaceCapabilities2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 16370 | countingStream->rewind(); |
| 16371 | uint32_t opcode_vkGetPhysicalDeviceSurfaceCapabilities2KHR = OP_vkGetPhysicalDeviceSurfaceCapabilities2KHR; |
| 16372 | stream->write(&opcode_vkGetPhysicalDeviceSurfaceCapabilities2KHR, sizeof(uint32_t)); |
| 16373 | stream->write(&packetSize_vkGetPhysicalDeviceSurfaceCapabilities2KHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16374 | uint64_t cgen_var_1102; |
| 16375 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1102, 1); |
| 16376 | stream->write((uint64_t*)&cgen_var_1102, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16377 | marshal_VkPhysicalDeviceSurfaceInfo2KHR(stream, (VkPhysicalDeviceSurfaceInfo2KHR*)(local_pSurfaceInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16378 | marshal_VkSurfaceCapabilities2KHR(stream, (VkSurfaceCapabilities2KHR*)(pSurfaceCapabilities)); |
| 16379 | unmarshal_VkSurfaceCapabilities2KHR(stream, (VkSurfaceCapabilities2KHR*)(pSurfaceCapabilities)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 16380 | if (pSurfaceCapabilities) |
| 16381 | { |
| 16382 | transform_fromhost_VkSurfaceCapabilities2KHR(mImpl->resources(), (VkSurfaceCapabilities2KHR*)(pSurfaceCapabilities)); |
| 16383 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16384 | VkResult vkGetPhysicalDeviceSurfaceCapabilities2KHR_VkResult_return = (VkResult)0; |
| 16385 | stream->read(&vkGetPhysicalDeviceSurfaceCapabilities2KHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 16386 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16387 | countingStream->clearPool(); |
| 16388 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16389 | mImpl->log("finish vkGetPhysicalDeviceSurfaceCapabilities2KHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16390 | return vkGetPhysicalDeviceSurfaceCapabilities2KHR_VkResult_return; |
| 16391 | } |
| 16392 | |
| 16393 | VkResult VkEncoder::vkGetPhysicalDeviceSurfaceFormats2KHR( |
| 16394 | VkPhysicalDevice physicalDevice, |
| 16395 | const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, |
| 16396 | uint32_t* pSurfaceFormatCount, |
| 16397 | VkSurfaceFormat2KHR* pSurfaceFormats) |
| 16398 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 16399 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16400 | mImpl->log("start vkGetPhysicalDeviceSurfaceFormats2KHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16401 | auto stream = mImpl->stream(); |
| 16402 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16403 | auto resources = mImpl->resources(); |
| 16404 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 16405 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16406 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16407 | VkPhysicalDeviceSurfaceInfo2KHR* local_pSurfaceInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 16408 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16409 | local_pSurfaceInfo = nullptr; |
| 16410 | if (pSurfaceInfo) |
| 16411 | { |
| 16412 | local_pSurfaceInfo = (VkPhysicalDeviceSurfaceInfo2KHR*)pool->alloc(sizeof(const VkPhysicalDeviceSurfaceInfo2KHR)); |
| 16413 | deepcopy_VkPhysicalDeviceSurfaceInfo2KHR(pool, pSurfaceInfo, (VkPhysicalDeviceSurfaceInfo2KHR*)(local_pSurfaceInfo)); |
| 16414 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 16415 | if (local_pSurfaceInfo) |
| 16416 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 16417 | transform_tohost_VkPhysicalDeviceSurfaceInfo2KHR(mImpl->resources(), (VkPhysicalDeviceSurfaceInfo2KHR*)(local_pSurfaceInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 16418 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16419 | countingStream->rewind(); |
| 16420 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16421 | uint64_t cgen_var_1103; |
| 16422 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1103, 1); |
| 16423 | countingStream->write((uint64_t*)&cgen_var_1103, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16424 | marshal_VkPhysicalDeviceSurfaceInfo2KHR(countingStream, (VkPhysicalDeviceSurfaceInfo2KHR*)(local_pSurfaceInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 16425 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16426 | uint64_t cgen_var_1104 = (uint64_t)(uintptr_t)pSurfaceFormatCount; |
| 16427 | countingStream->putBe64(cgen_var_1104); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16428 | if (pSurfaceFormatCount) |
| 16429 | { |
| 16430 | countingStream->write((uint32_t*)pSurfaceFormatCount, sizeof(uint32_t)); |
| 16431 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 16432 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16433 | uint64_t cgen_var_1105 = (uint64_t)(uintptr_t)pSurfaceFormats; |
| 16434 | countingStream->putBe64(cgen_var_1105); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16435 | if (pSurfaceFormats) |
| 16436 | { |
| 16437 | for (uint32_t i = 0; i < (uint32_t)(*(pSurfaceFormatCount)); ++i) |
| 16438 | { |
| 16439 | marshal_VkSurfaceFormat2KHR(countingStream, (VkSurfaceFormat2KHR*)(pSurfaceFormats + i)); |
| 16440 | } |
| 16441 | } |
| 16442 | } |
| 16443 | uint32_t packetSize_vkGetPhysicalDeviceSurfaceFormats2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 16444 | countingStream->rewind(); |
| 16445 | uint32_t opcode_vkGetPhysicalDeviceSurfaceFormats2KHR = OP_vkGetPhysicalDeviceSurfaceFormats2KHR; |
| 16446 | stream->write(&opcode_vkGetPhysicalDeviceSurfaceFormats2KHR, sizeof(uint32_t)); |
| 16447 | stream->write(&packetSize_vkGetPhysicalDeviceSurfaceFormats2KHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16448 | uint64_t cgen_var_1106; |
| 16449 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1106, 1); |
| 16450 | stream->write((uint64_t*)&cgen_var_1106, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16451 | marshal_VkPhysicalDeviceSurfaceInfo2KHR(stream, (VkPhysicalDeviceSurfaceInfo2KHR*)(local_pSurfaceInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 16452 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16453 | uint64_t cgen_var_1107 = (uint64_t)(uintptr_t)pSurfaceFormatCount; |
| 16454 | stream->putBe64(cgen_var_1107); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16455 | if (pSurfaceFormatCount) |
| 16456 | { |
| 16457 | stream->write((uint32_t*)pSurfaceFormatCount, sizeof(uint32_t)); |
| 16458 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 16459 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16460 | uint64_t cgen_var_1108 = (uint64_t)(uintptr_t)pSurfaceFormats; |
| 16461 | stream->putBe64(cgen_var_1108); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16462 | if (pSurfaceFormats) |
| 16463 | { |
| 16464 | for (uint32_t i = 0; i < (uint32_t)(*(pSurfaceFormatCount)); ++i) |
| 16465 | { |
| 16466 | marshal_VkSurfaceFormat2KHR(stream, (VkSurfaceFormat2KHR*)(pSurfaceFormats + i)); |
| 16467 | } |
| 16468 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 16469 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16470 | uint32_t* check_pSurfaceFormatCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 16471 | check_pSurfaceFormatCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16472 | if (pSurfaceFormatCount) |
| 16473 | { |
| 16474 | if (!(check_pSurfaceFormatCount)) |
| 16475 | { |
| 16476 | fprintf(stderr, "fatal: pSurfaceFormatCount inconsistent between guest and host\n"); |
| 16477 | } |
| 16478 | stream->read((uint32_t*)pSurfaceFormatCount, sizeof(uint32_t)); |
| 16479 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 16480 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16481 | VkSurfaceFormat2KHR* check_pSurfaceFormats; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 16482 | check_pSurfaceFormats = (VkSurfaceFormat2KHR*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16483 | if (pSurfaceFormats) |
| 16484 | { |
| 16485 | if (!(check_pSurfaceFormats)) |
| 16486 | { |
| 16487 | fprintf(stderr, "fatal: pSurfaceFormats inconsistent between guest and host\n"); |
| 16488 | } |
| 16489 | for (uint32_t i = 0; i < (uint32_t)(*(pSurfaceFormatCount)); ++i) |
| 16490 | { |
| 16491 | unmarshal_VkSurfaceFormat2KHR(stream, (VkSurfaceFormat2KHR*)(pSurfaceFormats + i)); |
| 16492 | } |
| 16493 | } |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 16494 | if (pSurfaceFormats) |
| 16495 | { |
| 16496 | for (uint32_t i = 0; i < (uint32_t)(*(pSurfaceFormatCount)); ++i) |
| 16497 | { |
| 16498 | transform_fromhost_VkSurfaceFormat2KHR(mImpl->resources(), (VkSurfaceFormat2KHR*)(pSurfaceFormats + i)); |
| 16499 | } |
| 16500 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16501 | VkResult vkGetPhysicalDeviceSurfaceFormats2KHR_VkResult_return = (VkResult)0; |
| 16502 | stream->read(&vkGetPhysicalDeviceSurfaceFormats2KHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 16503 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16504 | countingStream->clearPool(); |
| 16505 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16506 | mImpl->log("finish vkGetPhysicalDeviceSurfaceFormats2KHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16507 | return vkGetPhysicalDeviceSurfaceFormats2KHR_VkResult_return; |
| 16508 | } |
| 16509 | |
| 16510 | #endif |
| 16511 | #ifdef VK_KHR_variable_pointers |
| 16512 | #endif |
| 16513 | #ifdef VK_KHR_get_display_properties2 |
| 16514 | VkResult VkEncoder::vkGetPhysicalDeviceDisplayProperties2KHR( |
| 16515 | VkPhysicalDevice physicalDevice, |
| 16516 | uint32_t* pPropertyCount, |
| 16517 | VkDisplayProperties2KHR* pProperties) |
| 16518 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 16519 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16520 | mImpl->log("start vkGetPhysicalDeviceDisplayProperties2KHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16521 | auto stream = mImpl->stream(); |
| 16522 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16523 | auto resources = mImpl->resources(); |
| 16524 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 16525 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16526 | VkPhysicalDevice local_physicalDevice; |
| 16527 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16528 | countingStream->rewind(); |
| 16529 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16530 | uint64_t cgen_var_1111; |
| 16531 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1111, 1); |
| 16532 | countingStream->write((uint64_t*)&cgen_var_1111, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 16533 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16534 | uint64_t cgen_var_1112 = (uint64_t)(uintptr_t)pPropertyCount; |
| 16535 | countingStream->putBe64(cgen_var_1112); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16536 | if (pPropertyCount) |
| 16537 | { |
| 16538 | countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 16539 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 16540 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16541 | uint64_t cgen_var_1113 = (uint64_t)(uintptr_t)pProperties; |
| 16542 | countingStream->putBe64(cgen_var_1113); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16543 | if (pProperties) |
| 16544 | { |
| 16545 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 16546 | { |
| 16547 | marshal_VkDisplayProperties2KHR(countingStream, (VkDisplayProperties2KHR*)(pProperties + i)); |
| 16548 | } |
| 16549 | } |
| 16550 | } |
| 16551 | uint32_t packetSize_vkGetPhysicalDeviceDisplayProperties2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 16552 | countingStream->rewind(); |
| 16553 | uint32_t opcode_vkGetPhysicalDeviceDisplayProperties2KHR = OP_vkGetPhysicalDeviceDisplayProperties2KHR; |
| 16554 | stream->write(&opcode_vkGetPhysicalDeviceDisplayProperties2KHR, sizeof(uint32_t)); |
| 16555 | stream->write(&packetSize_vkGetPhysicalDeviceDisplayProperties2KHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16556 | uint64_t cgen_var_1114; |
| 16557 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1114, 1); |
| 16558 | stream->write((uint64_t*)&cgen_var_1114, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 16559 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16560 | uint64_t cgen_var_1115 = (uint64_t)(uintptr_t)pPropertyCount; |
| 16561 | stream->putBe64(cgen_var_1115); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16562 | if (pPropertyCount) |
| 16563 | { |
| 16564 | stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 16565 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 16566 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16567 | uint64_t cgen_var_1116 = (uint64_t)(uintptr_t)pProperties; |
| 16568 | stream->putBe64(cgen_var_1116); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16569 | if (pProperties) |
| 16570 | { |
| 16571 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 16572 | { |
| 16573 | marshal_VkDisplayProperties2KHR(stream, (VkDisplayProperties2KHR*)(pProperties + i)); |
| 16574 | } |
| 16575 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 16576 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16577 | uint32_t* check_pPropertyCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 16578 | check_pPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16579 | if (pPropertyCount) |
| 16580 | { |
| 16581 | if (!(check_pPropertyCount)) |
| 16582 | { |
| 16583 | fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n"); |
| 16584 | } |
| 16585 | stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 16586 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 16587 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16588 | VkDisplayProperties2KHR* check_pProperties; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 16589 | check_pProperties = (VkDisplayProperties2KHR*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16590 | if (pProperties) |
| 16591 | { |
| 16592 | if (!(check_pProperties)) |
| 16593 | { |
| 16594 | fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n"); |
| 16595 | } |
| 16596 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 16597 | { |
| 16598 | unmarshal_VkDisplayProperties2KHR(stream, (VkDisplayProperties2KHR*)(pProperties + i)); |
| 16599 | } |
| 16600 | } |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 16601 | if (pProperties) |
| 16602 | { |
| 16603 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 16604 | { |
| 16605 | transform_fromhost_VkDisplayProperties2KHR(mImpl->resources(), (VkDisplayProperties2KHR*)(pProperties + i)); |
| 16606 | } |
| 16607 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16608 | VkResult vkGetPhysicalDeviceDisplayProperties2KHR_VkResult_return = (VkResult)0; |
| 16609 | stream->read(&vkGetPhysicalDeviceDisplayProperties2KHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 16610 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16611 | countingStream->clearPool(); |
| 16612 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16613 | mImpl->log("finish vkGetPhysicalDeviceDisplayProperties2KHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16614 | return vkGetPhysicalDeviceDisplayProperties2KHR_VkResult_return; |
| 16615 | } |
| 16616 | |
| 16617 | VkResult VkEncoder::vkGetPhysicalDeviceDisplayPlaneProperties2KHR( |
| 16618 | VkPhysicalDevice physicalDevice, |
| 16619 | uint32_t* pPropertyCount, |
| 16620 | VkDisplayPlaneProperties2KHR* pProperties) |
| 16621 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 16622 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16623 | mImpl->log("start vkGetPhysicalDeviceDisplayPlaneProperties2KHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16624 | auto stream = mImpl->stream(); |
| 16625 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16626 | auto resources = mImpl->resources(); |
| 16627 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 16628 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16629 | VkPhysicalDevice local_physicalDevice; |
| 16630 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16631 | countingStream->rewind(); |
| 16632 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16633 | uint64_t cgen_var_1119; |
| 16634 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1119, 1); |
| 16635 | countingStream->write((uint64_t*)&cgen_var_1119, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 16636 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16637 | uint64_t cgen_var_1120 = (uint64_t)(uintptr_t)pPropertyCount; |
| 16638 | countingStream->putBe64(cgen_var_1120); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16639 | if (pPropertyCount) |
| 16640 | { |
| 16641 | countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 16642 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 16643 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16644 | uint64_t cgen_var_1121 = (uint64_t)(uintptr_t)pProperties; |
| 16645 | countingStream->putBe64(cgen_var_1121); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16646 | if (pProperties) |
| 16647 | { |
| 16648 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 16649 | { |
| 16650 | marshal_VkDisplayPlaneProperties2KHR(countingStream, (VkDisplayPlaneProperties2KHR*)(pProperties + i)); |
| 16651 | } |
| 16652 | } |
| 16653 | } |
| 16654 | uint32_t packetSize_vkGetPhysicalDeviceDisplayPlaneProperties2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 16655 | countingStream->rewind(); |
| 16656 | uint32_t opcode_vkGetPhysicalDeviceDisplayPlaneProperties2KHR = OP_vkGetPhysicalDeviceDisplayPlaneProperties2KHR; |
| 16657 | stream->write(&opcode_vkGetPhysicalDeviceDisplayPlaneProperties2KHR, sizeof(uint32_t)); |
| 16658 | stream->write(&packetSize_vkGetPhysicalDeviceDisplayPlaneProperties2KHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16659 | uint64_t cgen_var_1122; |
| 16660 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1122, 1); |
| 16661 | stream->write((uint64_t*)&cgen_var_1122, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 16662 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16663 | uint64_t cgen_var_1123 = (uint64_t)(uintptr_t)pPropertyCount; |
| 16664 | stream->putBe64(cgen_var_1123); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16665 | if (pPropertyCount) |
| 16666 | { |
| 16667 | stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 16668 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 16669 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16670 | uint64_t cgen_var_1124 = (uint64_t)(uintptr_t)pProperties; |
| 16671 | stream->putBe64(cgen_var_1124); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16672 | if (pProperties) |
| 16673 | { |
| 16674 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 16675 | { |
| 16676 | marshal_VkDisplayPlaneProperties2KHR(stream, (VkDisplayPlaneProperties2KHR*)(pProperties + i)); |
| 16677 | } |
| 16678 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 16679 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16680 | uint32_t* check_pPropertyCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 16681 | check_pPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16682 | if (pPropertyCount) |
| 16683 | { |
| 16684 | if (!(check_pPropertyCount)) |
| 16685 | { |
| 16686 | fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n"); |
| 16687 | } |
| 16688 | stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 16689 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 16690 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16691 | VkDisplayPlaneProperties2KHR* check_pProperties; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 16692 | check_pProperties = (VkDisplayPlaneProperties2KHR*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16693 | if (pProperties) |
| 16694 | { |
| 16695 | if (!(check_pProperties)) |
| 16696 | { |
| 16697 | fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n"); |
| 16698 | } |
| 16699 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 16700 | { |
| 16701 | unmarshal_VkDisplayPlaneProperties2KHR(stream, (VkDisplayPlaneProperties2KHR*)(pProperties + i)); |
| 16702 | } |
| 16703 | } |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 16704 | if (pProperties) |
| 16705 | { |
| 16706 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 16707 | { |
| 16708 | transform_fromhost_VkDisplayPlaneProperties2KHR(mImpl->resources(), (VkDisplayPlaneProperties2KHR*)(pProperties + i)); |
| 16709 | } |
| 16710 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16711 | VkResult vkGetPhysicalDeviceDisplayPlaneProperties2KHR_VkResult_return = (VkResult)0; |
| 16712 | stream->read(&vkGetPhysicalDeviceDisplayPlaneProperties2KHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 16713 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16714 | countingStream->clearPool(); |
| 16715 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16716 | mImpl->log("finish vkGetPhysicalDeviceDisplayPlaneProperties2KHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16717 | return vkGetPhysicalDeviceDisplayPlaneProperties2KHR_VkResult_return; |
| 16718 | } |
| 16719 | |
| 16720 | VkResult VkEncoder::vkGetDisplayModeProperties2KHR( |
| 16721 | VkPhysicalDevice physicalDevice, |
| 16722 | VkDisplayKHR display, |
| 16723 | uint32_t* pPropertyCount, |
| 16724 | VkDisplayModeProperties2KHR* pProperties) |
| 16725 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 16726 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16727 | mImpl->log("start vkGetDisplayModeProperties2KHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16728 | auto stream = mImpl->stream(); |
| 16729 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16730 | auto resources = mImpl->resources(); |
| 16731 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 16732 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16733 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16734 | VkDisplayKHR local_display; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 16735 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16736 | local_display = display; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16737 | countingStream->rewind(); |
| 16738 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16739 | uint64_t cgen_var_1127; |
| 16740 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1127, 1); |
| 16741 | countingStream->write((uint64_t*)&cgen_var_1127, 1 * 8); |
| 16742 | uint64_t cgen_var_1128; |
| 16743 | countingStream->handleMapping()->mapHandles_VkDisplayKHR_u64(&local_display, &cgen_var_1128, 1); |
| 16744 | countingStream->write((uint64_t*)&cgen_var_1128, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 16745 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16746 | uint64_t cgen_var_1129 = (uint64_t)(uintptr_t)pPropertyCount; |
| 16747 | countingStream->putBe64(cgen_var_1129); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16748 | if (pPropertyCount) |
| 16749 | { |
| 16750 | countingStream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 16751 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 16752 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16753 | uint64_t cgen_var_1130 = (uint64_t)(uintptr_t)pProperties; |
| 16754 | countingStream->putBe64(cgen_var_1130); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16755 | if (pProperties) |
| 16756 | { |
| 16757 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 16758 | { |
| 16759 | marshal_VkDisplayModeProperties2KHR(countingStream, (VkDisplayModeProperties2KHR*)(pProperties + i)); |
| 16760 | } |
| 16761 | } |
| 16762 | } |
| 16763 | uint32_t packetSize_vkGetDisplayModeProperties2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 16764 | countingStream->rewind(); |
| 16765 | uint32_t opcode_vkGetDisplayModeProperties2KHR = OP_vkGetDisplayModeProperties2KHR; |
| 16766 | stream->write(&opcode_vkGetDisplayModeProperties2KHR, sizeof(uint32_t)); |
| 16767 | stream->write(&packetSize_vkGetDisplayModeProperties2KHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16768 | uint64_t cgen_var_1131; |
| 16769 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1131, 1); |
| 16770 | stream->write((uint64_t*)&cgen_var_1131, 1 * 8); |
| 16771 | uint64_t cgen_var_1132; |
| 16772 | stream->handleMapping()->mapHandles_VkDisplayKHR_u64(&local_display, &cgen_var_1132, 1); |
| 16773 | stream->write((uint64_t*)&cgen_var_1132, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 16774 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16775 | uint64_t cgen_var_1133 = (uint64_t)(uintptr_t)pPropertyCount; |
| 16776 | stream->putBe64(cgen_var_1133); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16777 | if (pPropertyCount) |
| 16778 | { |
| 16779 | stream->write((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 16780 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 16781 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16782 | uint64_t cgen_var_1134 = (uint64_t)(uintptr_t)pProperties; |
| 16783 | stream->putBe64(cgen_var_1134); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16784 | if (pProperties) |
| 16785 | { |
| 16786 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 16787 | { |
| 16788 | marshal_VkDisplayModeProperties2KHR(stream, (VkDisplayModeProperties2KHR*)(pProperties + i)); |
| 16789 | } |
| 16790 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 16791 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16792 | uint32_t* check_pPropertyCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 16793 | check_pPropertyCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16794 | if (pPropertyCount) |
| 16795 | { |
| 16796 | if (!(check_pPropertyCount)) |
| 16797 | { |
| 16798 | fprintf(stderr, "fatal: pPropertyCount inconsistent between guest and host\n"); |
| 16799 | } |
| 16800 | stream->read((uint32_t*)pPropertyCount, sizeof(uint32_t)); |
| 16801 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 16802 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16803 | VkDisplayModeProperties2KHR* check_pProperties; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 16804 | check_pProperties = (VkDisplayModeProperties2KHR*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16805 | if (pProperties) |
| 16806 | { |
| 16807 | if (!(check_pProperties)) |
| 16808 | { |
| 16809 | fprintf(stderr, "fatal: pProperties inconsistent between guest and host\n"); |
| 16810 | } |
| 16811 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 16812 | { |
| 16813 | unmarshal_VkDisplayModeProperties2KHR(stream, (VkDisplayModeProperties2KHR*)(pProperties + i)); |
| 16814 | } |
| 16815 | } |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 16816 | if (pProperties) |
| 16817 | { |
| 16818 | for (uint32_t i = 0; i < (uint32_t)(*(pPropertyCount)); ++i) |
| 16819 | { |
| 16820 | transform_fromhost_VkDisplayModeProperties2KHR(mImpl->resources(), (VkDisplayModeProperties2KHR*)(pProperties + i)); |
| 16821 | } |
| 16822 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16823 | VkResult vkGetDisplayModeProperties2KHR_VkResult_return = (VkResult)0; |
| 16824 | stream->read(&vkGetDisplayModeProperties2KHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 16825 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16826 | countingStream->clearPool(); |
| 16827 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16828 | mImpl->log("finish vkGetDisplayModeProperties2KHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16829 | return vkGetDisplayModeProperties2KHR_VkResult_return; |
| 16830 | } |
| 16831 | |
| 16832 | VkResult VkEncoder::vkGetDisplayPlaneCapabilities2KHR( |
| 16833 | VkPhysicalDevice physicalDevice, |
| 16834 | const VkDisplayPlaneInfo2KHR* pDisplayPlaneInfo, |
| 16835 | VkDisplayPlaneCapabilities2KHR* pCapabilities) |
| 16836 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 16837 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16838 | mImpl->log("start vkGetDisplayPlaneCapabilities2KHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16839 | auto stream = mImpl->stream(); |
| 16840 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16841 | auto resources = mImpl->resources(); |
| 16842 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 16843 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16844 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16845 | VkDisplayPlaneInfo2KHR* local_pDisplayPlaneInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 16846 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16847 | local_pDisplayPlaneInfo = nullptr; |
| 16848 | if (pDisplayPlaneInfo) |
| 16849 | { |
| 16850 | local_pDisplayPlaneInfo = (VkDisplayPlaneInfo2KHR*)pool->alloc(sizeof(const VkDisplayPlaneInfo2KHR)); |
| 16851 | deepcopy_VkDisplayPlaneInfo2KHR(pool, pDisplayPlaneInfo, (VkDisplayPlaneInfo2KHR*)(local_pDisplayPlaneInfo)); |
| 16852 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 16853 | if (local_pDisplayPlaneInfo) |
| 16854 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 16855 | transform_tohost_VkDisplayPlaneInfo2KHR(mImpl->resources(), (VkDisplayPlaneInfo2KHR*)(local_pDisplayPlaneInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 16856 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16857 | countingStream->rewind(); |
| 16858 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16859 | uint64_t cgen_var_1137; |
| 16860 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1137, 1); |
| 16861 | countingStream->write((uint64_t*)&cgen_var_1137, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16862 | marshal_VkDisplayPlaneInfo2KHR(countingStream, (VkDisplayPlaneInfo2KHR*)(local_pDisplayPlaneInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16863 | marshal_VkDisplayPlaneCapabilities2KHR(countingStream, (VkDisplayPlaneCapabilities2KHR*)(pCapabilities)); |
| 16864 | } |
| 16865 | uint32_t packetSize_vkGetDisplayPlaneCapabilities2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 16866 | countingStream->rewind(); |
| 16867 | uint32_t opcode_vkGetDisplayPlaneCapabilities2KHR = OP_vkGetDisplayPlaneCapabilities2KHR; |
| 16868 | stream->write(&opcode_vkGetDisplayPlaneCapabilities2KHR, sizeof(uint32_t)); |
| 16869 | stream->write(&packetSize_vkGetDisplayPlaneCapabilities2KHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16870 | uint64_t cgen_var_1138; |
| 16871 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1138, 1); |
| 16872 | stream->write((uint64_t*)&cgen_var_1138, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16873 | marshal_VkDisplayPlaneInfo2KHR(stream, (VkDisplayPlaneInfo2KHR*)(local_pDisplayPlaneInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16874 | marshal_VkDisplayPlaneCapabilities2KHR(stream, (VkDisplayPlaneCapabilities2KHR*)(pCapabilities)); |
| 16875 | unmarshal_VkDisplayPlaneCapabilities2KHR(stream, (VkDisplayPlaneCapabilities2KHR*)(pCapabilities)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 16876 | if (pCapabilities) |
| 16877 | { |
| 16878 | transform_fromhost_VkDisplayPlaneCapabilities2KHR(mImpl->resources(), (VkDisplayPlaneCapabilities2KHR*)(pCapabilities)); |
| 16879 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16880 | VkResult vkGetDisplayPlaneCapabilities2KHR_VkResult_return = (VkResult)0; |
| 16881 | stream->read(&vkGetDisplayPlaneCapabilities2KHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 16882 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 16883 | countingStream->clearPool(); |
| 16884 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16885 | mImpl->log("finish vkGetDisplayPlaneCapabilities2KHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16886 | return vkGetDisplayPlaneCapabilities2KHR_VkResult_return; |
| 16887 | } |
| 16888 | |
| 16889 | #endif |
| 16890 | #ifdef VK_KHR_dedicated_allocation |
| 16891 | #endif |
| 16892 | #ifdef VK_KHR_storage_buffer_storage_class |
| 16893 | #endif |
| 16894 | #ifdef VK_KHR_relaxed_block_layout |
| 16895 | #endif |
| 16896 | #ifdef VK_KHR_get_memory_requirements2 |
| 16897 | void VkEncoder::vkGetImageMemoryRequirements2KHR( |
| 16898 | VkDevice device, |
| 16899 | const VkImageMemoryRequirementsInfo2* pInfo, |
| 16900 | VkMemoryRequirements2* pMemoryRequirements) |
| 16901 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 16902 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16903 | mImpl->log("start vkGetImageMemoryRequirements2KHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16904 | auto stream = mImpl->stream(); |
| 16905 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16906 | auto resources = mImpl->resources(); |
| 16907 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 16908 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16909 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16910 | VkImageMemoryRequirementsInfo2* local_pInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 16911 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16912 | local_pInfo = nullptr; |
| 16913 | if (pInfo) |
| 16914 | { |
| 16915 | local_pInfo = (VkImageMemoryRequirementsInfo2*)pool->alloc(sizeof(const VkImageMemoryRequirementsInfo2)); |
| 16916 | deepcopy_VkImageMemoryRequirementsInfo2(pool, pInfo, (VkImageMemoryRequirementsInfo2*)(local_pInfo)); |
| 16917 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 16918 | if (local_pInfo) |
| 16919 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 16920 | transform_tohost_VkImageMemoryRequirementsInfo2(mImpl->resources(), (VkImageMemoryRequirementsInfo2*)(local_pInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 16921 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16922 | countingStream->rewind(); |
| 16923 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16924 | uint64_t cgen_var_1139; |
| 16925 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1139, 1); |
| 16926 | countingStream->write((uint64_t*)&cgen_var_1139, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16927 | marshal_VkImageMemoryRequirementsInfo2(countingStream, (VkImageMemoryRequirementsInfo2*)(local_pInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16928 | marshal_VkMemoryRequirements2(countingStream, (VkMemoryRequirements2*)(pMemoryRequirements)); |
| 16929 | } |
| 16930 | uint32_t packetSize_vkGetImageMemoryRequirements2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 16931 | countingStream->rewind(); |
| 16932 | uint32_t opcode_vkGetImageMemoryRequirements2KHR = OP_vkGetImageMemoryRequirements2KHR; |
| 16933 | stream->write(&opcode_vkGetImageMemoryRequirements2KHR, sizeof(uint32_t)); |
| 16934 | stream->write(&packetSize_vkGetImageMemoryRequirements2KHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16935 | uint64_t cgen_var_1140; |
| 16936 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1140, 1); |
| 16937 | stream->write((uint64_t*)&cgen_var_1140, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16938 | marshal_VkImageMemoryRequirementsInfo2(stream, (VkImageMemoryRequirementsInfo2*)(local_pInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16939 | marshal_VkMemoryRequirements2(stream, (VkMemoryRequirements2*)(pMemoryRequirements)); |
| 16940 | unmarshal_VkMemoryRequirements2(stream, (VkMemoryRequirements2*)(pMemoryRequirements)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 16941 | if (pMemoryRequirements) |
| 16942 | { |
| 16943 | transform_fromhost_VkMemoryRequirements2(mImpl->resources(), (VkMemoryRequirements2*)(pMemoryRequirements)); |
| 16944 | } |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 16945 | pool->freeAll(); |
| 16946 | countingStream->clearPool(); |
| 16947 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16948 | mImpl->log("finish vkGetImageMemoryRequirements2KHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16949 | } |
| 16950 | |
| 16951 | void VkEncoder::vkGetBufferMemoryRequirements2KHR( |
| 16952 | VkDevice device, |
| 16953 | const VkBufferMemoryRequirementsInfo2* pInfo, |
| 16954 | VkMemoryRequirements2* pMemoryRequirements) |
| 16955 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 16956 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 16957 | mImpl->log("start vkGetBufferMemoryRequirements2KHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16958 | auto stream = mImpl->stream(); |
| 16959 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16960 | auto resources = mImpl->resources(); |
| 16961 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 16962 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16963 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16964 | VkBufferMemoryRequirementsInfo2* local_pInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 16965 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16966 | local_pInfo = nullptr; |
| 16967 | if (pInfo) |
| 16968 | { |
| 16969 | local_pInfo = (VkBufferMemoryRequirementsInfo2*)pool->alloc(sizeof(const VkBufferMemoryRequirementsInfo2)); |
| 16970 | deepcopy_VkBufferMemoryRequirementsInfo2(pool, pInfo, (VkBufferMemoryRequirementsInfo2*)(local_pInfo)); |
| 16971 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 16972 | if (local_pInfo) |
| 16973 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 16974 | transform_tohost_VkBufferMemoryRequirementsInfo2(mImpl->resources(), (VkBufferMemoryRequirementsInfo2*)(local_pInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 16975 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16976 | countingStream->rewind(); |
| 16977 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16978 | uint64_t cgen_var_1141; |
| 16979 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1141, 1); |
| 16980 | countingStream->write((uint64_t*)&cgen_var_1141, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16981 | marshal_VkBufferMemoryRequirementsInfo2(countingStream, (VkBufferMemoryRequirementsInfo2*)(local_pInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16982 | marshal_VkMemoryRequirements2(countingStream, (VkMemoryRequirements2*)(pMemoryRequirements)); |
| 16983 | } |
| 16984 | uint32_t packetSize_vkGetBufferMemoryRequirements2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 16985 | countingStream->rewind(); |
| 16986 | uint32_t opcode_vkGetBufferMemoryRequirements2KHR = OP_vkGetBufferMemoryRequirements2KHR; |
| 16987 | stream->write(&opcode_vkGetBufferMemoryRequirements2KHR, sizeof(uint32_t)); |
| 16988 | stream->write(&packetSize_vkGetBufferMemoryRequirements2KHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 16989 | uint64_t cgen_var_1142; |
| 16990 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1142, 1); |
| 16991 | stream->write((uint64_t*)&cgen_var_1142, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 16992 | marshal_VkBufferMemoryRequirementsInfo2(stream, (VkBufferMemoryRequirementsInfo2*)(local_pInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 16993 | marshal_VkMemoryRequirements2(stream, (VkMemoryRequirements2*)(pMemoryRequirements)); |
| 16994 | unmarshal_VkMemoryRequirements2(stream, (VkMemoryRequirements2*)(pMemoryRequirements)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 16995 | if (pMemoryRequirements) |
| 16996 | { |
| 16997 | transform_fromhost_VkMemoryRequirements2(mImpl->resources(), (VkMemoryRequirements2*)(pMemoryRequirements)); |
| 16998 | } |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 16999 | pool->freeAll(); |
| 17000 | countingStream->clearPool(); |
| 17001 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17002 | mImpl->log("finish vkGetBufferMemoryRequirements2KHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17003 | } |
| 17004 | |
| 17005 | void VkEncoder::vkGetImageSparseMemoryRequirements2KHR( |
| 17006 | VkDevice device, |
| 17007 | const VkImageSparseMemoryRequirementsInfo2* pInfo, |
| 17008 | uint32_t* pSparseMemoryRequirementCount, |
| 17009 | VkSparseImageMemoryRequirements2* pSparseMemoryRequirements) |
| 17010 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 17011 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17012 | mImpl->log("start vkGetImageSparseMemoryRequirements2KHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17013 | auto stream = mImpl->stream(); |
| 17014 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17015 | auto resources = mImpl->resources(); |
| 17016 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 17017 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17018 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17019 | VkImageSparseMemoryRequirementsInfo2* local_pInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 17020 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17021 | local_pInfo = nullptr; |
| 17022 | if (pInfo) |
| 17023 | { |
| 17024 | local_pInfo = (VkImageSparseMemoryRequirementsInfo2*)pool->alloc(sizeof(const VkImageSparseMemoryRequirementsInfo2)); |
| 17025 | deepcopy_VkImageSparseMemoryRequirementsInfo2(pool, pInfo, (VkImageSparseMemoryRequirementsInfo2*)(local_pInfo)); |
| 17026 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 17027 | if (local_pInfo) |
| 17028 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 17029 | transform_tohost_VkImageSparseMemoryRequirementsInfo2(mImpl->resources(), (VkImageSparseMemoryRequirementsInfo2*)(local_pInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 17030 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17031 | countingStream->rewind(); |
| 17032 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17033 | uint64_t cgen_var_1143; |
| 17034 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1143, 1); |
| 17035 | countingStream->write((uint64_t*)&cgen_var_1143, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17036 | marshal_VkImageSparseMemoryRequirementsInfo2(countingStream, (VkImageSparseMemoryRequirementsInfo2*)(local_pInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17037 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17038 | uint64_t cgen_var_1144 = (uint64_t)(uintptr_t)pSparseMemoryRequirementCount; |
| 17039 | countingStream->putBe64(cgen_var_1144); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17040 | if (pSparseMemoryRequirementCount) |
| 17041 | { |
| 17042 | countingStream->write((uint32_t*)pSparseMemoryRequirementCount, sizeof(uint32_t)); |
| 17043 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17044 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17045 | uint64_t cgen_var_1145 = (uint64_t)(uintptr_t)pSparseMemoryRequirements; |
| 17046 | countingStream->putBe64(cgen_var_1145); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17047 | if (pSparseMemoryRequirements) |
| 17048 | { |
| 17049 | for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i) |
| 17050 | { |
| 17051 | marshal_VkSparseImageMemoryRequirements2(countingStream, (VkSparseImageMemoryRequirements2*)(pSparseMemoryRequirements + i)); |
| 17052 | } |
| 17053 | } |
| 17054 | } |
| 17055 | uint32_t packetSize_vkGetImageSparseMemoryRequirements2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 17056 | countingStream->rewind(); |
| 17057 | uint32_t opcode_vkGetImageSparseMemoryRequirements2KHR = OP_vkGetImageSparseMemoryRequirements2KHR; |
| 17058 | stream->write(&opcode_vkGetImageSparseMemoryRequirements2KHR, sizeof(uint32_t)); |
| 17059 | stream->write(&packetSize_vkGetImageSparseMemoryRequirements2KHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17060 | uint64_t cgen_var_1146; |
| 17061 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1146, 1); |
| 17062 | stream->write((uint64_t*)&cgen_var_1146, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17063 | marshal_VkImageSparseMemoryRequirementsInfo2(stream, (VkImageSparseMemoryRequirementsInfo2*)(local_pInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17064 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17065 | uint64_t cgen_var_1147 = (uint64_t)(uintptr_t)pSparseMemoryRequirementCount; |
| 17066 | stream->putBe64(cgen_var_1147); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17067 | if (pSparseMemoryRequirementCount) |
| 17068 | { |
| 17069 | stream->write((uint32_t*)pSparseMemoryRequirementCount, sizeof(uint32_t)); |
| 17070 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17071 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17072 | uint64_t cgen_var_1148 = (uint64_t)(uintptr_t)pSparseMemoryRequirements; |
| 17073 | stream->putBe64(cgen_var_1148); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17074 | if (pSparseMemoryRequirements) |
| 17075 | { |
| 17076 | for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i) |
| 17077 | { |
| 17078 | marshal_VkSparseImageMemoryRequirements2(stream, (VkSparseImageMemoryRequirements2*)(pSparseMemoryRequirements + i)); |
| 17079 | } |
| 17080 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17081 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17082 | uint32_t* check_pSparseMemoryRequirementCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17083 | check_pSparseMemoryRequirementCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17084 | if (pSparseMemoryRequirementCount) |
| 17085 | { |
| 17086 | if (!(check_pSparseMemoryRequirementCount)) |
| 17087 | { |
| 17088 | fprintf(stderr, "fatal: pSparseMemoryRequirementCount inconsistent between guest and host\n"); |
| 17089 | } |
| 17090 | stream->read((uint32_t*)pSparseMemoryRequirementCount, sizeof(uint32_t)); |
| 17091 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17092 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17093 | VkSparseImageMemoryRequirements2* check_pSparseMemoryRequirements; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17094 | check_pSparseMemoryRequirements = (VkSparseImageMemoryRequirements2*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17095 | if (pSparseMemoryRequirements) |
| 17096 | { |
| 17097 | if (!(check_pSparseMemoryRequirements)) |
| 17098 | { |
| 17099 | fprintf(stderr, "fatal: pSparseMemoryRequirements inconsistent between guest and host\n"); |
| 17100 | } |
| 17101 | for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i) |
| 17102 | { |
| 17103 | unmarshal_VkSparseImageMemoryRequirements2(stream, (VkSparseImageMemoryRequirements2*)(pSparseMemoryRequirements + i)); |
| 17104 | } |
| 17105 | } |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 17106 | if (pSparseMemoryRequirements) |
| 17107 | { |
| 17108 | for (uint32_t i = 0; i < (uint32_t)(*(pSparseMemoryRequirementCount)); ++i) |
| 17109 | { |
| 17110 | transform_fromhost_VkSparseImageMemoryRequirements2(mImpl->resources(), (VkSparseImageMemoryRequirements2*)(pSparseMemoryRequirements + i)); |
| 17111 | } |
| 17112 | } |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 17113 | pool->freeAll(); |
| 17114 | countingStream->clearPool(); |
| 17115 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17116 | mImpl->log("finish vkGetImageSparseMemoryRequirements2KHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17117 | } |
| 17118 | |
| 17119 | #endif |
| 17120 | #ifdef VK_KHR_image_format_list |
| 17121 | #endif |
| 17122 | #ifdef VK_KHR_sampler_ycbcr_conversion |
| 17123 | VkResult VkEncoder::vkCreateSamplerYcbcrConversionKHR( |
| 17124 | VkDevice device, |
| 17125 | const VkSamplerYcbcrConversionCreateInfo* pCreateInfo, |
| 17126 | const VkAllocationCallbacks* pAllocator, |
| 17127 | VkSamplerYcbcrConversion* pYcbcrConversion) |
| 17128 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 17129 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17130 | mImpl->log("start vkCreateSamplerYcbcrConversionKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17131 | auto stream = mImpl->stream(); |
| 17132 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17133 | auto resources = mImpl->resources(); |
| 17134 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 17135 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17136 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17137 | VkSamplerYcbcrConversionCreateInfo* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 17138 | VkAllocationCallbacks* local_pAllocator; |
| 17139 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17140 | local_pCreateInfo = nullptr; |
| 17141 | if (pCreateInfo) |
| 17142 | { |
| 17143 | local_pCreateInfo = (VkSamplerYcbcrConversionCreateInfo*)pool->alloc(sizeof(const VkSamplerYcbcrConversionCreateInfo)); |
| 17144 | deepcopy_VkSamplerYcbcrConversionCreateInfo(pool, pCreateInfo, (VkSamplerYcbcrConversionCreateInfo*)(local_pCreateInfo)); |
| 17145 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17146 | local_pAllocator = nullptr; |
| 17147 | if (pAllocator) |
| 17148 | { |
| 17149 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 17150 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 17151 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 17152 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 17153 | if (local_pCreateInfo) |
| 17154 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 17155 | transform_tohost_VkSamplerYcbcrConversionCreateInfo(mImpl->resources(), (VkSamplerYcbcrConversionCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 17156 | } |
| 17157 | if (local_pAllocator) |
| 17158 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 17159 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 17160 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17161 | countingStream->rewind(); |
| 17162 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17163 | uint64_t cgen_var_1151; |
| 17164 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1151, 1); |
| 17165 | countingStream->write((uint64_t*)&cgen_var_1151, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17166 | marshal_VkSamplerYcbcrConversionCreateInfo(countingStream, (VkSamplerYcbcrConversionCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17167 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17168 | uint64_t cgen_var_1152 = (uint64_t)(uintptr_t)local_pAllocator; |
| 17169 | countingStream->putBe64(cgen_var_1152); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17170 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17171 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17172 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17173 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17174 | uint64_t cgen_var_1153; |
| 17175 | countingStream->handleMapping()->mapHandles_VkSamplerYcbcrConversion_u64(pYcbcrConversion, &cgen_var_1153, 1); |
| 17176 | countingStream->write((uint64_t*)&cgen_var_1153, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17177 | } |
| 17178 | uint32_t packetSize_vkCreateSamplerYcbcrConversionKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 17179 | countingStream->rewind(); |
| 17180 | uint32_t opcode_vkCreateSamplerYcbcrConversionKHR = OP_vkCreateSamplerYcbcrConversionKHR; |
| 17181 | stream->write(&opcode_vkCreateSamplerYcbcrConversionKHR, sizeof(uint32_t)); |
| 17182 | stream->write(&packetSize_vkCreateSamplerYcbcrConversionKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17183 | uint64_t cgen_var_1154; |
| 17184 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1154, 1); |
| 17185 | stream->write((uint64_t*)&cgen_var_1154, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17186 | marshal_VkSamplerYcbcrConversionCreateInfo(stream, (VkSamplerYcbcrConversionCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17187 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17188 | uint64_t cgen_var_1155 = (uint64_t)(uintptr_t)local_pAllocator; |
| 17189 | stream->putBe64(cgen_var_1155); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17190 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17191 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17192 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17193 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 17194 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17195 | uint64_t cgen_var_1156; |
| 17196 | stream->handleMapping()->mapHandles_VkSamplerYcbcrConversion_u64(pYcbcrConversion, &cgen_var_1156, 1); |
| 17197 | stream->write((uint64_t*)&cgen_var_1156, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 17198 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 1dafbc3 | 2019-02-23 10:52:04 -0800 | [diff] [blame] | 17199 | stream->setHandleMapping(resources->createMapping()); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17200 | uint64_t cgen_var_1157; |
| 17201 | stream->read((uint64_t*)&cgen_var_1157, 8); |
| 17202 | stream->handleMapping()->mapHandles_u64_VkSamplerYcbcrConversion(&cgen_var_1157, (VkSamplerYcbcrConversion*)pYcbcrConversion, 1); |
| Lingfeng Yang | 1dafbc3 | 2019-02-23 10:52:04 -0800 | [diff] [blame] | 17203 | stream->unsetHandleMapping(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17204 | VkResult vkCreateSamplerYcbcrConversionKHR_VkResult_return = (VkResult)0; |
| 17205 | stream->read(&vkCreateSamplerYcbcrConversionKHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 17206 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17207 | countingStream->clearPool(); |
| 17208 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17209 | mImpl->log("finish vkCreateSamplerYcbcrConversionKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17210 | return vkCreateSamplerYcbcrConversionKHR_VkResult_return; |
| 17211 | } |
| 17212 | |
| 17213 | void VkEncoder::vkDestroySamplerYcbcrConversionKHR( |
| 17214 | VkDevice device, |
| 17215 | VkSamplerYcbcrConversion ycbcrConversion, |
| 17216 | const VkAllocationCallbacks* pAllocator) |
| 17217 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 17218 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17219 | mImpl->log("start vkDestroySamplerYcbcrConversionKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17220 | auto stream = mImpl->stream(); |
| 17221 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17222 | auto resources = mImpl->resources(); |
| 17223 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 17224 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17225 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17226 | VkSamplerYcbcrConversion local_ycbcrConversion; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17227 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 17228 | local_device = device; |
| 17229 | local_ycbcrConversion = ycbcrConversion; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17230 | local_pAllocator = nullptr; |
| 17231 | if (pAllocator) |
| 17232 | { |
| 17233 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 17234 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 17235 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 17236 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 17237 | if (local_pAllocator) |
| 17238 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 17239 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 17240 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17241 | countingStream->rewind(); |
| 17242 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17243 | uint64_t cgen_var_1158; |
| 17244 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1158, 1); |
| 17245 | countingStream->write((uint64_t*)&cgen_var_1158, 1 * 8); |
| 17246 | uint64_t cgen_var_1159; |
| 17247 | countingStream->handleMapping()->mapHandles_VkSamplerYcbcrConversion_u64(&local_ycbcrConversion, &cgen_var_1159, 1); |
| 17248 | countingStream->write((uint64_t*)&cgen_var_1159, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17249 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17250 | uint64_t cgen_var_1160 = (uint64_t)(uintptr_t)local_pAllocator; |
| 17251 | countingStream->putBe64(cgen_var_1160); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17252 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17253 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17254 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17255 | } |
| 17256 | } |
| 17257 | uint32_t packetSize_vkDestroySamplerYcbcrConversionKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 17258 | countingStream->rewind(); |
| 17259 | uint32_t opcode_vkDestroySamplerYcbcrConversionKHR = OP_vkDestroySamplerYcbcrConversionKHR; |
| 17260 | stream->write(&opcode_vkDestroySamplerYcbcrConversionKHR, sizeof(uint32_t)); |
| 17261 | stream->write(&packetSize_vkDestroySamplerYcbcrConversionKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17262 | uint64_t cgen_var_1161; |
| 17263 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1161, 1); |
| 17264 | stream->write((uint64_t*)&cgen_var_1161, 1 * 8); |
| 17265 | uint64_t cgen_var_1162; |
| 17266 | stream->handleMapping()->mapHandles_VkSamplerYcbcrConversion_u64(&local_ycbcrConversion, &cgen_var_1162, 1); |
| 17267 | stream->write((uint64_t*)&cgen_var_1162, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17268 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17269 | uint64_t cgen_var_1163 = (uint64_t)(uintptr_t)local_pAllocator; |
| 17270 | stream->putBe64(cgen_var_1163); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17271 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17272 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17273 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17274 | } |
| Lingfeng Yang | 1dafbc3 | 2019-02-23 10:52:04 -0800 | [diff] [blame] | 17275 | resources->destroyMapping()->mapHandles_VkSamplerYcbcrConversion((VkSamplerYcbcrConversion*)&ycbcrConversion); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 17276 | pool->freeAll(); |
| 17277 | countingStream->clearPool(); |
| 17278 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17279 | mImpl->log("finish vkDestroySamplerYcbcrConversionKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17280 | } |
| 17281 | |
| 17282 | #endif |
| 17283 | #ifdef VK_KHR_bind_memory2 |
| 17284 | VkResult VkEncoder::vkBindBufferMemory2KHR( |
| 17285 | VkDevice device, |
| 17286 | uint32_t bindInfoCount, |
| 17287 | const VkBindBufferMemoryInfo* pBindInfos) |
| 17288 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 17289 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17290 | mImpl->log("start vkBindBufferMemory2KHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17291 | auto stream = mImpl->stream(); |
| 17292 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17293 | auto resources = mImpl->resources(); |
| 17294 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 17295 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17296 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17297 | uint32_t local_bindInfoCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17298 | VkBindBufferMemoryInfo* local_pBindInfos; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 17299 | local_device = device; |
| 17300 | local_bindInfoCount = bindInfoCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17301 | local_pBindInfos = nullptr; |
| 17302 | if (pBindInfos) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17303 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17304 | local_pBindInfos = (VkBindBufferMemoryInfo*)pool->alloc(((bindInfoCount)) * sizeof(const VkBindBufferMemoryInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17305 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 17306 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17307 | deepcopy_VkBindBufferMemoryInfo(pool, pBindInfos + i, (VkBindBufferMemoryInfo*)(local_pBindInfos + i)); |
| 17308 | } |
| 17309 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 17310 | if (local_pBindInfos) |
| 17311 | { |
| 17312 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 17313 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 17314 | transform_tohost_VkBindBufferMemoryInfo(mImpl->resources(), (VkBindBufferMemoryInfo*)(local_pBindInfos + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 17315 | } |
| 17316 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17317 | countingStream->rewind(); |
| 17318 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17319 | uint64_t cgen_var_1164; |
| 17320 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1164, 1); |
| 17321 | countingStream->write((uint64_t*)&cgen_var_1164, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17322 | countingStream->write((uint32_t*)&local_bindInfoCount, sizeof(uint32_t)); |
| 17323 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 17324 | { |
| 17325 | marshal_VkBindBufferMemoryInfo(countingStream, (VkBindBufferMemoryInfo*)(local_pBindInfos + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17326 | } |
| 17327 | } |
| 17328 | uint32_t packetSize_vkBindBufferMemory2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 17329 | countingStream->rewind(); |
| 17330 | uint32_t opcode_vkBindBufferMemory2KHR = OP_vkBindBufferMemory2KHR; |
| 17331 | stream->write(&opcode_vkBindBufferMemory2KHR, sizeof(uint32_t)); |
| 17332 | stream->write(&packetSize_vkBindBufferMemory2KHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17333 | uint64_t cgen_var_1165; |
| 17334 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1165, 1); |
| 17335 | stream->write((uint64_t*)&cgen_var_1165, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17336 | stream->write((uint32_t*)&local_bindInfoCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17337 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 17338 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17339 | marshal_VkBindBufferMemoryInfo(stream, (VkBindBufferMemoryInfo*)(local_pBindInfos + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17340 | } |
| 17341 | VkResult vkBindBufferMemory2KHR_VkResult_return = (VkResult)0; |
| 17342 | stream->read(&vkBindBufferMemory2KHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 17343 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17344 | countingStream->clearPool(); |
| 17345 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17346 | mImpl->log("finish vkBindBufferMemory2KHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17347 | return vkBindBufferMemory2KHR_VkResult_return; |
| 17348 | } |
| 17349 | |
| 17350 | VkResult VkEncoder::vkBindImageMemory2KHR( |
| 17351 | VkDevice device, |
| 17352 | uint32_t bindInfoCount, |
| 17353 | const VkBindImageMemoryInfo* pBindInfos) |
| 17354 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 17355 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17356 | mImpl->log("start vkBindImageMemory2KHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17357 | auto stream = mImpl->stream(); |
| 17358 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17359 | auto resources = mImpl->resources(); |
| 17360 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 17361 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17362 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17363 | uint32_t local_bindInfoCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17364 | VkBindImageMemoryInfo* local_pBindInfos; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 17365 | local_device = device; |
| 17366 | local_bindInfoCount = bindInfoCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17367 | local_pBindInfos = nullptr; |
| 17368 | if (pBindInfos) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17369 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17370 | local_pBindInfos = (VkBindImageMemoryInfo*)pool->alloc(((bindInfoCount)) * sizeof(const VkBindImageMemoryInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17371 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 17372 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17373 | deepcopy_VkBindImageMemoryInfo(pool, pBindInfos + i, (VkBindImageMemoryInfo*)(local_pBindInfos + i)); |
| 17374 | } |
| 17375 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 17376 | if (local_pBindInfos) |
| 17377 | { |
| 17378 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 17379 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 17380 | transform_tohost_VkBindImageMemoryInfo(mImpl->resources(), (VkBindImageMemoryInfo*)(local_pBindInfos + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 17381 | } |
| 17382 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17383 | countingStream->rewind(); |
| 17384 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17385 | uint64_t cgen_var_1166; |
| 17386 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1166, 1); |
| 17387 | countingStream->write((uint64_t*)&cgen_var_1166, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17388 | countingStream->write((uint32_t*)&local_bindInfoCount, sizeof(uint32_t)); |
| 17389 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 17390 | { |
| 17391 | marshal_VkBindImageMemoryInfo(countingStream, (VkBindImageMemoryInfo*)(local_pBindInfos + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17392 | } |
| 17393 | } |
| 17394 | uint32_t packetSize_vkBindImageMemory2KHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 17395 | countingStream->rewind(); |
| 17396 | uint32_t opcode_vkBindImageMemory2KHR = OP_vkBindImageMemory2KHR; |
| 17397 | stream->write(&opcode_vkBindImageMemory2KHR, sizeof(uint32_t)); |
| 17398 | stream->write(&packetSize_vkBindImageMemory2KHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17399 | uint64_t cgen_var_1167; |
| 17400 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1167, 1); |
| 17401 | stream->write((uint64_t*)&cgen_var_1167, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17402 | stream->write((uint32_t*)&local_bindInfoCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17403 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 17404 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17405 | marshal_VkBindImageMemoryInfo(stream, (VkBindImageMemoryInfo*)(local_pBindInfos + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17406 | } |
| 17407 | VkResult vkBindImageMemory2KHR_VkResult_return = (VkResult)0; |
| 17408 | stream->read(&vkBindImageMemory2KHR_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 17409 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17410 | countingStream->clearPool(); |
| 17411 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17412 | mImpl->log("finish vkBindImageMemory2KHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17413 | return vkBindImageMemory2KHR_VkResult_return; |
| 17414 | } |
| 17415 | |
| 17416 | #endif |
| 17417 | #ifdef VK_KHR_maintenance3 |
| 17418 | void VkEncoder::vkGetDescriptorSetLayoutSupportKHR( |
| 17419 | VkDevice device, |
| 17420 | const VkDescriptorSetLayoutCreateInfo* pCreateInfo, |
| 17421 | VkDescriptorSetLayoutSupport* pSupport) |
| 17422 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 17423 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17424 | mImpl->log("start vkGetDescriptorSetLayoutSupportKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17425 | auto stream = mImpl->stream(); |
| 17426 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17427 | auto resources = mImpl->resources(); |
| 17428 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 17429 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17430 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17431 | VkDescriptorSetLayoutCreateInfo* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 17432 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17433 | local_pCreateInfo = nullptr; |
| 17434 | if (pCreateInfo) |
| 17435 | { |
| 17436 | local_pCreateInfo = (VkDescriptorSetLayoutCreateInfo*)pool->alloc(sizeof(const VkDescriptorSetLayoutCreateInfo)); |
| 17437 | deepcopy_VkDescriptorSetLayoutCreateInfo(pool, pCreateInfo, (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo)); |
| 17438 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 17439 | if (local_pCreateInfo) |
| 17440 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 17441 | transform_tohost_VkDescriptorSetLayoutCreateInfo(mImpl->resources(), (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 17442 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17443 | countingStream->rewind(); |
| 17444 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17445 | uint64_t cgen_var_1168; |
| 17446 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1168, 1); |
| 17447 | countingStream->write((uint64_t*)&cgen_var_1168, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17448 | marshal_VkDescriptorSetLayoutCreateInfo(countingStream, (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17449 | marshal_VkDescriptorSetLayoutSupport(countingStream, (VkDescriptorSetLayoutSupport*)(pSupport)); |
| 17450 | } |
| 17451 | uint32_t packetSize_vkGetDescriptorSetLayoutSupportKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 17452 | countingStream->rewind(); |
| 17453 | uint32_t opcode_vkGetDescriptorSetLayoutSupportKHR = OP_vkGetDescriptorSetLayoutSupportKHR; |
| 17454 | stream->write(&opcode_vkGetDescriptorSetLayoutSupportKHR, sizeof(uint32_t)); |
| 17455 | stream->write(&packetSize_vkGetDescriptorSetLayoutSupportKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17456 | uint64_t cgen_var_1169; |
| 17457 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1169, 1); |
| 17458 | stream->write((uint64_t*)&cgen_var_1169, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17459 | marshal_VkDescriptorSetLayoutCreateInfo(stream, (VkDescriptorSetLayoutCreateInfo*)(local_pCreateInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17460 | marshal_VkDescriptorSetLayoutSupport(stream, (VkDescriptorSetLayoutSupport*)(pSupport)); |
| 17461 | unmarshal_VkDescriptorSetLayoutSupport(stream, (VkDescriptorSetLayoutSupport*)(pSupport)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 17462 | if (pSupport) |
| 17463 | { |
| 17464 | transform_fromhost_VkDescriptorSetLayoutSupport(mImpl->resources(), (VkDescriptorSetLayoutSupport*)(pSupport)); |
| 17465 | } |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 17466 | pool->freeAll(); |
| 17467 | countingStream->clearPool(); |
| 17468 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17469 | mImpl->log("finish vkGetDescriptorSetLayoutSupportKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17470 | } |
| 17471 | |
| 17472 | #endif |
| 17473 | #ifdef VK_KHR_draw_indirect_count |
| 17474 | void VkEncoder::vkCmdDrawIndirectCountKHR( |
| 17475 | VkCommandBuffer commandBuffer, |
| 17476 | VkBuffer buffer, |
| 17477 | VkDeviceSize offset, |
| 17478 | VkBuffer countBuffer, |
| 17479 | VkDeviceSize countBufferOffset, |
| 17480 | uint32_t maxDrawCount, |
| 17481 | uint32_t stride) |
| 17482 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 17483 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17484 | mImpl->log("start vkCmdDrawIndirectCountKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17485 | auto stream = mImpl->stream(); |
| 17486 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17487 | auto resources = mImpl->resources(); |
| 17488 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 17489 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17490 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17491 | VkBuffer local_buffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17492 | VkDeviceSize local_offset; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17493 | VkBuffer local_countBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17494 | VkDeviceSize local_countBufferOffset; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17495 | uint32_t local_maxDrawCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17496 | uint32_t local_stride; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 17497 | local_commandBuffer = commandBuffer; |
| 17498 | local_buffer = buffer; |
| 17499 | local_offset = offset; |
| 17500 | local_countBuffer = countBuffer; |
| 17501 | local_countBufferOffset = countBufferOffset; |
| 17502 | local_maxDrawCount = maxDrawCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17503 | local_stride = stride; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17504 | countingStream->rewind(); |
| 17505 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17506 | uint64_t cgen_var_1170; |
| 17507 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1170, 1); |
| 17508 | countingStream->write((uint64_t*)&cgen_var_1170, 1 * 8); |
| 17509 | uint64_t cgen_var_1171; |
| 17510 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_1171, 1); |
| 17511 | countingStream->write((uint64_t*)&cgen_var_1171, 1 * 8); |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 17512 | countingStream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17513 | uint64_t cgen_var_1172; |
| 17514 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_countBuffer, &cgen_var_1172, 1); |
| 17515 | countingStream->write((uint64_t*)&cgen_var_1172, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17516 | countingStream->write((VkDeviceSize*)&local_countBufferOffset, sizeof(VkDeviceSize)); |
| 17517 | countingStream->write((uint32_t*)&local_maxDrawCount, sizeof(uint32_t)); |
| 17518 | countingStream->write((uint32_t*)&local_stride, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17519 | } |
| 17520 | uint32_t packetSize_vkCmdDrawIndirectCountKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 17521 | countingStream->rewind(); |
| 17522 | uint32_t opcode_vkCmdDrawIndirectCountKHR = OP_vkCmdDrawIndirectCountKHR; |
| 17523 | stream->write(&opcode_vkCmdDrawIndirectCountKHR, sizeof(uint32_t)); |
| 17524 | stream->write(&packetSize_vkCmdDrawIndirectCountKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17525 | uint64_t cgen_var_1173; |
| 17526 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1173, 1); |
| 17527 | stream->write((uint64_t*)&cgen_var_1173, 1 * 8); |
| 17528 | uint64_t cgen_var_1174; |
| 17529 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_1174, 1); |
| 17530 | stream->write((uint64_t*)&cgen_var_1174, 1 * 8); |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 17531 | stream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17532 | uint64_t cgen_var_1175; |
| 17533 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_countBuffer, &cgen_var_1175, 1); |
| 17534 | stream->write((uint64_t*)&cgen_var_1175, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17535 | stream->write((VkDeviceSize*)&local_countBufferOffset, sizeof(VkDeviceSize)); |
| 17536 | stream->write((uint32_t*)&local_maxDrawCount, sizeof(uint32_t)); |
| 17537 | stream->write((uint32_t*)&local_stride, sizeof(uint32_t)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 17538 | pool->freeAll(); |
| 17539 | countingStream->clearPool(); |
| 17540 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17541 | mImpl->log("finish vkCmdDrawIndirectCountKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17542 | } |
| 17543 | |
| 17544 | void VkEncoder::vkCmdDrawIndexedIndirectCountKHR( |
| 17545 | VkCommandBuffer commandBuffer, |
| 17546 | VkBuffer buffer, |
| 17547 | VkDeviceSize offset, |
| 17548 | VkBuffer countBuffer, |
| 17549 | VkDeviceSize countBufferOffset, |
| 17550 | uint32_t maxDrawCount, |
| 17551 | uint32_t stride) |
| 17552 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 17553 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17554 | mImpl->log("start vkCmdDrawIndexedIndirectCountKHR"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17555 | auto stream = mImpl->stream(); |
| 17556 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17557 | auto resources = mImpl->resources(); |
| 17558 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 17559 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17560 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17561 | VkBuffer local_buffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17562 | VkDeviceSize local_offset; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17563 | VkBuffer local_countBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17564 | VkDeviceSize local_countBufferOffset; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17565 | uint32_t local_maxDrawCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17566 | uint32_t local_stride; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 17567 | local_commandBuffer = commandBuffer; |
| 17568 | local_buffer = buffer; |
| 17569 | local_offset = offset; |
| 17570 | local_countBuffer = countBuffer; |
| 17571 | local_countBufferOffset = countBufferOffset; |
| 17572 | local_maxDrawCount = maxDrawCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17573 | local_stride = stride; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17574 | countingStream->rewind(); |
| 17575 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17576 | uint64_t cgen_var_1176; |
| 17577 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1176, 1); |
| 17578 | countingStream->write((uint64_t*)&cgen_var_1176, 1 * 8); |
| 17579 | uint64_t cgen_var_1177; |
| 17580 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_1177, 1); |
| 17581 | countingStream->write((uint64_t*)&cgen_var_1177, 1 * 8); |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 17582 | countingStream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17583 | uint64_t cgen_var_1178; |
| 17584 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_countBuffer, &cgen_var_1178, 1); |
| 17585 | countingStream->write((uint64_t*)&cgen_var_1178, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17586 | countingStream->write((VkDeviceSize*)&local_countBufferOffset, sizeof(VkDeviceSize)); |
| 17587 | countingStream->write((uint32_t*)&local_maxDrawCount, sizeof(uint32_t)); |
| 17588 | countingStream->write((uint32_t*)&local_stride, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17589 | } |
| 17590 | uint32_t packetSize_vkCmdDrawIndexedIndirectCountKHR = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 17591 | countingStream->rewind(); |
| 17592 | uint32_t opcode_vkCmdDrawIndexedIndirectCountKHR = OP_vkCmdDrawIndexedIndirectCountKHR; |
| 17593 | stream->write(&opcode_vkCmdDrawIndexedIndirectCountKHR, sizeof(uint32_t)); |
| 17594 | stream->write(&packetSize_vkCmdDrawIndexedIndirectCountKHR, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17595 | uint64_t cgen_var_1179; |
| 17596 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1179, 1); |
| 17597 | stream->write((uint64_t*)&cgen_var_1179, 1 * 8); |
| 17598 | uint64_t cgen_var_1180; |
| 17599 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_1180, 1); |
| 17600 | stream->write((uint64_t*)&cgen_var_1180, 1 * 8); |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 17601 | stream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17602 | uint64_t cgen_var_1181; |
| 17603 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_countBuffer, &cgen_var_1181, 1); |
| 17604 | stream->write((uint64_t*)&cgen_var_1181, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17605 | stream->write((VkDeviceSize*)&local_countBufferOffset, sizeof(VkDeviceSize)); |
| 17606 | stream->write((uint32_t*)&local_maxDrawCount, sizeof(uint32_t)); |
| 17607 | stream->write((uint32_t*)&local_stride, sizeof(uint32_t)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 17608 | pool->freeAll(); |
| 17609 | countingStream->clearPool(); |
| 17610 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17611 | mImpl->log("finish vkCmdDrawIndexedIndirectCountKHR");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17612 | } |
| 17613 | |
| 17614 | #endif |
| 17615 | #ifdef VK_KHR_8bit_storage |
| 17616 | #endif |
| Lingfeng Yang | 4c056b2 | 2020-07-02 11:43:57 -0700 | [diff] [blame] | 17617 | #ifdef VK_KHR_shader_float16_int8 |
| 17618 | #endif |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 17619 | #ifdef VK_ANDROID_native_buffer |
| 17620 | VkResult VkEncoder::vkGetSwapchainGrallocUsageANDROID( |
| 17621 | VkDevice device, |
| 17622 | VkFormat format, |
| 17623 | VkImageUsageFlags imageUsage, |
| 17624 | int* grallocUsage) |
| 17625 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 17626 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17627 | mImpl->log("start vkGetSwapchainGrallocUsageANDROID"); |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 17628 | auto stream = mImpl->stream(); |
| 17629 | auto countingStream = mImpl->countingStream(); |
| 17630 | auto resources = mImpl->resources(); |
| 17631 | auto pool = mImpl->pool(); |
| 17632 | stream->setHandleMapping(resources->unwrapMapping()); |
| 17633 | VkDevice local_device; |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 17634 | VkFormat local_format; |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 17635 | VkImageUsageFlags local_imageUsage; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 17636 | local_device = device; |
| 17637 | local_format = format; |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 17638 | local_imageUsage = imageUsage; |
| 17639 | countingStream->rewind(); |
| 17640 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17641 | uint64_t cgen_var_1182; |
| 17642 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1182, 1); |
| 17643 | countingStream->write((uint64_t*)&cgen_var_1182, 1 * 8); |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 17644 | countingStream->write((VkFormat*)&local_format, sizeof(VkFormat)); |
| 17645 | countingStream->write((VkImageUsageFlags*)&local_imageUsage, sizeof(VkImageUsageFlags)); |
| 17646 | countingStream->write((int*)grallocUsage, sizeof(int)); |
| 17647 | } |
| 17648 | uint32_t packetSize_vkGetSwapchainGrallocUsageANDROID = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 17649 | countingStream->rewind(); |
| 17650 | uint32_t opcode_vkGetSwapchainGrallocUsageANDROID = OP_vkGetSwapchainGrallocUsageANDROID; |
| 17651 | stream->write(&opcode_vkGetSwapchainGrallocUsageANDROID, sizeof(uint32_t)); |
| 17652 | stream->write(&packetSize_vkGetSwapchainGrallocUsageANDROID, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17653 | uint64_t cgen_var_1183; |
| 17654 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1183, 1); |
| 17655 | stream->write((uint64_t*)&cgen_var_1183, 1 * 8); |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 17656 | stream->write((VkFormat*)&local_format, sizeof(VkFormat)); |
| 17657 | stream->write((VkImageUsageFlags*)&local_imageUsage, sizeof(VkImageUsageFlags)); |
| 17658 | stream->write((int*)grallocUsage, sizeof(int)); |
| 17659 | stream->read((int*)grallocUsage, sizeof(int)); |
| 17660 | VkResult vkGetSwapchainGrallocUsageANDROID_VkResult_return = (VkResult)0; |
| 17661 | stream->read(&vkGetSwapchainGrallocUsageANDROID_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 17662 | pool->freeAll(); |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 17663 | countingStream->clearPool(); |
| 17664 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17665 | mImpl->log("finish vkGetSwapchainGrallocUsageANDROID");; |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 17666 | return vkGetSwapchainGrallocUsageANDROID_VkResult_return; |
| 17667 | } |
| 17668 | |
| 17669 | VkResult VkEncoder::vkAcquireImageANDROID( |
| 17670 | VkDevice device, |
| 17671 | VkImage image, |
| 17672 | int nativeFenceFd, |
| 17673 | VkSemaphore semaphore, |
| 17674 | VkFence fence) |
| 17675 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 17676 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17677 | mImpl->log("start vkAcquireImageANDROID"); |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 17678 | auto stream = mImpl->stream(); |
| 17679 | auto countingStream = mImpl->countingStream(); |
| 17680 | auto resources = mImpl->resources(); |
| 17681 | auto pool = mImpl->pool(); |
| 17682 | stream->setHandleMapping(resources->unwrapMapping()); |
| 17683 | VkDevice local_device; |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 17684 | VkImage local_image; |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 17685 | int local_nativeFenceFd; |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 17686 | VkSemaphore local_semaphore; |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 17687 | VkFence local_fence; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 17688 | local_device = device; |
| 17689 | local_image = image; |
| 17690 | local_nativeFenceFd = nativeFenceFd; |
| 17691 | local_semaphore = semaphore; |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 17692 | local_fence = fence; |
| Lingfeng Yang | def88ba | 2018-12-13 12:43:17 -0800 | [diff] [blame] | 17693 | mImpl->resources()->unwrap_vkAcquireImageANDROID_nativeFenceFd(nativeFenceFd, &local_nativeFenceFd); |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 17694 | countingStream->rewind(); |
| 17695 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17696 | uint64_t cgen_var_1184; |
| 17697 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1184, 1); |
| 17698 | countingStream->write((uint64_t*)&cgen_var_1184, 1 * 8); |
| 17699 | uint64_t cgen_var_1185; |
| 17700 | countingStream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_1185, 1); |
| 17701 | countingStream->write((uint64_t*)&cgen_var_1185, 1 * 8); |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 17702 | countingStream->write((int*)&local_nativeFenceFd, sizeof(int)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17703 | uint64_t cgen_var_1186; |
| 17704 | countingStream->handleMapping()->mapHandles_VkSemaphore_u64(&local_semaphore, &cgen_var_1186, 1); |
| 17705 | countingStream->write((uint64_t*)&cgen_var_1186, 1 * 8); |
| 17706 | uint64_t cgen_var_1187; |
| 17707 | countingStream->handleMapping()->mapHandles_VkFence_u64(&local_fence, &cgen_var_1187, 1); |
| 17708 | countingStream->write((uint64_t*)&cgen_var_1187, 1 * 8); |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 17709 | } |
| 17710 | uint32_t packetSize_vkAcquireImageANDROID = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 17711 | countingStream->rewind(); |
| 17712 | uint32_t opcode_vkAcquireImageANDROID = OP_vkAcquireImageANDROID; |
| 17713 | stream->write(&opcode_vkAcquireImageANDROID, sizeof(uint32_t)); |
| 17714 | stream->write(&packetSize_vkAcquireImageANDROID, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17715 | uint64_t cgen_var_1188; |
| 17716 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1188, 1); |
| 17717 | stream->write((uint64_t*)&cgen_var_1188, 1 * 8); |
| 17718 | uint64_t cgen_var_1189; |
| 17719 | stream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_1189, 1); |
| 17720 | stream->write((uint64_t*)&cgen_var_1189, 1 * 8); |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 17721 | stream->write((int*)&local_nativeFenceFd, sizeof(int)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17722 | uint64_t cgen_var_1190; |
| 17723 | stream->handleMapping()->mapHandles_VkSemaphore_u64(&local_semaphore, &cgen_var_1190, 1); |
| 17724 | stream->write((uint64_t*)&cgen_var_1190, 1 * 8); |
| 17725 | uint64_t cgen_var_1191; |
| 17726 | stream->handleMapping()->mapHandles_VkFence_u64(&local_fence, &cgen_var_1191, 1); |
| 17727 | stream->write((uint64_t*)&cgen_var_1191, 1 * 8); |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 17728 | VkResult vkAcquireImageANDROID_VkResult_return = (VkResult)0; |
| 17729 | stream->read(&vkAcquireImageANDROID_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 17730 | pool->freeAll(); |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 17731 | countingStream->clearPool(); |
| 17732 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17733 | mImpl->log("finish vkAcquireImageANDROID");; |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 17734 | return vkAcquireImageANDROID_VkResult_return; |
| 17735 | } |
| 17736 | |
| 17737 | VkResult VkEncoder::vkQueueSignalReleaseImageANDROID( |
| 17738 | VkQueue queue, |
| 17739 | uint32_t waitSemaphoreCount, |
| 17740 | const VkSemaphore* pWaitSemaphores, |
| 17741 | VkImage image, |
| 17742 | int* pNativeFenceFd) |
| 17743 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 17744 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17745 | mImpl->log("start vkQueueSignalReleaseImageANDROID"); |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 17746 | auto stream = mImpl->stream(); |
| 17747 | auto countingStream = mImpl->countingStream(); |
| 17748 | auto resources = mImpl->resources(); |
| 17749 | auto pool = mImpl->pool(); |
| 17750 | stream->setHandleMapping(resources->unwrapMapping()); |
| 17751 | VkQueue local_queue; |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 17752 | uint32_t local_waitSemaphoreCount; |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 17753 | VkSemaphore* local_pWaitSemaphores; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 17754 | VkImage local_image; |
| 17755 | local_queue = queue; |
| 17756 | local_waitSemaphoreCount = waitSemaphoreCount; |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 17757 | local_pWaitSemaphores = nullptr; |
| 17758 | if (pWaitSemaphores) |
| 17759 | { |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame] | 17760 | local_pWaitSemaphores = (VkSemaphore*)pool->dupArray(pWaitSemaphores, ((waitSemaphoreCount)) * sizeof(const VkSemaphore)); |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 17761 | } |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 17762 | local_image = image; |
| 17763 | countingStream->rewind(); |
| 17764 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17765 | uint64_t cgen_var_1192; |
| 17766 | countingStream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_1192, 1); |
| 17767 | countingStream->write((uint64_t*)&cgen_var_1192, 1 * 8); |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 17768 | countingStream->write((uint32_t*)&local_waitSemaphoreCount, sizeof(uint32_t)); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame] | 17769 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17770 | uint64_t cgen_var_1193 = (uint64_t)(uintptr_t)local_pWaitSemaphores; |
| 17771 | countingStream->putBe64(cgen_var_1193); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame] | 17772 | if (local_pWaitSemaphores) |
| 17773 | { |
| 17774 | if (((waitSemaphoreCount))) |
| 17775 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17776 | uint64_t* cgen_var_1194; |
| 17777 | countingStream->alloc((void**)&cgen_var_1194, ((waitSemaphoreCount)) * 8); |
| 17778 | countingStream->handleMapping()->mapHandles_VkSemaphore_u64(local_pWaitSemaphores, cgen_var_1194, ((waitSemaphoreCount))); |
| 17779 | countingStream->write((uint64_t*)cgen_var_1194, ((waitSemaphoreCount)) * 8); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame] | 17780 | } |
| 17781 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17782 | uint64_t cgen_var_1195; |
| 17783 | countingStream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_1195, 1); |
| 17784 | countingStream->write((uint64_t*)&cgen_var_1195, 1 * 8); |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 17785 | countingStream->write((int*)pNativeFenceFd, sizeof(int)); |
| 17786 | } |
| 17787 | uint32_t packetSize_vkQueueSignalReleaseImageANDROID = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 17788 | countingStream->rewind(); |
| 17789 | uint32_t opcode_vkQueueSignalReleaseImageANDROID = OP_vkQueueSignalReleaseImageANDROID; |
| 17790 | stream->write(&opcode_vkQueueSignalReleaseImageANDROID, sizeof(uint32_t)); |
| 17791 | stream->write(&packetSize_vkQueueSignalReleaseImageANDROID, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17792 | uint64_t cgen_var_1196; |
| 17793 | stream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_1196, 1); |
| 17794 | stream->write((uint64_t*)&cgen_var_1196, 1 * 8); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame] | 17795 | stream->write((uint32_t*)&local_waitSemaphoreCount, sizeof(uint32_t)); |
| 17796 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17797 | uint64_t cgen_var_1197 = (uint64_t)(uintptr_t)local_pWaitSemaphores; |
| 17798 | stream->putBe64(cgen_var_1197); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame] | 17799 | if (local_pWaitSemaphores) |
| 17800 | { |
| 17801 | if (((waitSemaphoreCount))) |
| 17802 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17803 | uint64_t* cgen_var_1198; |
| 17804 | stream->alloc((void**)&cgen_var_1198, ((waitSemaphoreCount)) * 8); |
| 17805 | stream->handleMapping()->mapHandles_VkSemaphore_u64(local_pWaitSemaphores, cgen_var_1198, ((waitSemaphoreCount))); |
| 17806 | stream->write((uint64_t*)cgen_var_1198, ((waitSemaphoreCount)) * 8); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame] | 17807 | } |
| 17808 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17809 | uint64_t cgen_var_1199; |
| 17810 | stream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_1199, 1); |
| 17811 | stream->write((uint64_t*)&cgen_var_1199, 1 * 8); |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 17812 | stream->write((int*)pNativeFenceFd, sizeof(int)); |
| 17813 | stream->read((int*)pNativeFenceFd, sizeof(int)); |
| 17814 | VkResult vkQueueSignalReleaseImageANDROID_VkResult_return = (VkResult)0; |
| 17815 | stream->read(&vkQueueSignalReleaseImageANDROID_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 17816 | stream->flush(); |
| 17817 | pool->freeAll(); |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 17818 | countingStream->clearPool(); |
| 17819 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17820 | mImpl->log("finish vkQueueSignalReleaseImageANDROID");; |
| Lingfeng Yang | 808a631 | 2018-11-13 21:06:15 -0800 | [diff] [blame] | 17821 | return vkQueueSignalReleaseImageANDROID_VkResult_return; |
| 17822 | } |
| 17823 | |
| 17824 | #endif |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17825 | #ifdef VK_EXT_debug_report |
| 17826 | VkResult VkEncoder::vkCreateDebugReportCallbackEXT( |
| 17827 | VkInstance instance, |
| 17828 | const VkDebugReportCallbackCreateInfoEXT* pCreateInfo, |
| 17829 | const VkAllocationCallbacks* pAllocator, |
| 17830 | VkDebugReportCallbackEXT* pCallback) |
| 17831 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 17832 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17833 | mImpl->log("start vkCreateDebugReportCallbackEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17834 | auto stream = mImpl->stream(); |
| 17835 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17836 | auto resources = mImpl->resources(); |
| 17837 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 17838 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17839 | VkInstance local_instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17840 | VkDebugReportCallbackCreateInfoEXT* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 17841 | VkAllocationCallbacks* local_pAllocator; |
| 17842 | local_instance = instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17843 | local_pCreateInfo = nullptr; |
| 17844 | if (pCreateInfo) |
| 17845 | { |
| 17846 | local_pCreateInfo = (VkDebugReportCallbackCreateInfoEXT*)pool->alloc(sizeof(const VkDebugReportCallbackCreateInfoEXT)); |
| 17847 | deepcopy_VkDebugReportCallbackCreateInfoEXT(pool, pCreateInfo, (VkDebugReportCallbackCreateInfoEXT*)(local_pCreateInfo)); |
| 17848 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17849 | local_pAllocator = nullptr; |
| 17850 | if (pAllocator) |
| 17851 | { |
| 17852 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 17853 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 17854 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 17855 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 17856 | if (local_pCreateInfo) |
| 17857 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 17858 | transform_tohost_VkDebugReportCallbackCreateInfoEXT(mImpl->resources(), (VkDebugReportCallbackCreateInfoEXT*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 17859 | } |
| 17860 | if (local_pAllocator) |
| 17861 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 17862 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 17863 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17864 | countingStream->rewind(); |
| 17865 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17866 | uint64_t cgen_var_1200; |
| 17867 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1200, 1); |
| 17868 | countingStream->write((uint64_t*)&cgen_var_1200, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17869 | marshal_VkDebugReportCallbackCreateInfoEXT(countingStream, (VkDebugReportCallbackCreateInfoEXT*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17870 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17871 | uint64_t cgen_var_1201 = (uint64_t)(uintptr_t)local_pAllocator; |
| 17872 | countingStream->putBe64(cgen_var_1201); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17873 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17874 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17875 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17876 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17877 | uint64_t cgen_var_1202; |
| 17878 | countingStream->handleMapping()->mapHandles_VkDebugReportCallbackEXT_u64(pCallback, &cgen_var_1202, 1); |
| 17879 | countingStream->write((uint64_t*)&cgen_var_1202, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17880 | } |
| 17881 | uint32_t packetSize_vkCreateDebugReportCallbackEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 17882 | countingStream->rewind(); |
| 17883 | uint32_t opcode_vkCreateDebugReportCallbackEXT = OP_vkCreateDebugReportCallbackEXT; |
| 17884 | stream->write(&opcode_vkCreateDebugReportCallbackEXT, sizeof(uint32_t)); |
| 17885 | stream->write(&packetSize_vkCreateDebugReportCallbackEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17886 | uint64_t cgen_var_1203; |
| 17887 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1203, 1); |
| 17888 | stream->write((uint64_t*)&cgen_var_1203, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17889 | marshal_VkDebugReportCallbackCreateInfoEXT(stream, (VkDebugReportCallbackCreateInfoEXT*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17890 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17891 | uint64_t cgen_var_1204 = (uint64_t)(uintptr_t)local_pAllocator; |
| 17892 | stream->putBe64(cgen_var_1204); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17893 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17894 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17895 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17896 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 17897 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17898 | uint64_t cgen_var_1205; |
| 17899 | stream->handleMapping()->mapHandles_VkDebugReportCallbackEXT_u64(pCallback, &cgen_var_1205, 1); |
| 17900 | stream->write((uint64_t*)&cgen_var_1205, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 17901 | stream->setHandleMapping(resources->unwrapMapping()); |
| 17902 | stream->setHandleMapping(resources->createMapping()); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17903 | uint64_t cgen_var_1206; |
| 17904 | stream->read((uint64_t*)&cgen_var_1206, 8); |
| 17905 | stream->handleMapping()->mapHandles_u64_VkDebugReportCallbackEXT(&cgen_var_1206, (VkDebugReportCallbackEXT*)pCallback, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 17906 | stream->unsetHandleMapping(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17907 | VkResult vkCreateDebugReportCallbackEXT_VkResult_return = (VkResult)0; |
| 17908 | stream->read(&vkCreateDebugReportCallbackEXT_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 17909 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 17910 | countingStream->clearPool(); |
| 17911 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17912 | mImpl->log("finish vkCreateDebugReportCallbackEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17913 | return vkCreateDebugReportCallbackEXT_VkResult_return; |
| 17914 | } |
| 17915 | |
| 17916 | void VkEncoder::vkDestroyDebugReportCallbackEXT( |
| 17917 | VkInstance instance, |
| 17918 | VkDebugReportCallbackEXT callback, |
| 17919 | const VkAllocationCallbacks* pAllocator) |
| 17920 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 17921 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17922 | mImpl->log("start vkDestroyDebugReportCallbackEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17923 | auto stream = mImpl->stream(); |
| 17924 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17925 | auto resources = mImpl->resources(); |
| 17926 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 17927 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17928 | VkInstance local_instance; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 17929 | VkDebugReportCallbackEXT local_callback; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17930 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 17931 | local_instance = instance; |
| 17932 | local_callback = callback; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17933 | local_pAllocator = nullptr; |
| 17934 | if (pAllocator) |
| 17935 | { |
| 17936 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 17937 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 17938 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 17939 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 17940 | if (local_pAllocator) |
| 17941 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 17942 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 17943 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17944 | countingStream->rewind(); |
| 17945 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17946 | uint64_t cgen_var_1207; |
| 17947 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1207, 1); |
| 17948 | countingStream->write((uint64_t*)&cgen_var_1207, 1 * 8); |
| 17949 | uint64_t cgen_var_1208; |
| 17950 | countingStream->handleMapping()->mapHandles_VkDebugReportCallbackEXT_u64(&local_callback, &cgen_var_1208, 1); |
| 17951 | countingStream->write((uint64_t*)&cgen_var_1208, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17952 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17953 | uint64_t cgen_var_1209 = (uint64_t)(uintptr_t)local_pAllocator; |
| 17954 | countingStream->putBe64(cgen_var_1209); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17955 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17956 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17957 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17958 | } |
| 17959 | } |
| 17960 | uint32_t packetSize_vkDestroyDebugReportCallbackEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 17961 | countingStream->rewind(); |
| 17962 | uint32_t opcode_vkDestroyDebugReportCallbackEXT = OP_vkDestroyDebugReportCallbackEXT; |
| 17963 | stream->write(&opcode_vkDestroyDebugReportCallbackEXT, sizeof(uint32_t)); |
| 17964 | stream->write(&packetSize_vkDestroyDebugReportCallbackEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17965 | uint64_t cgen_var_1210; |
| 17966 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1210, 1); |
| 17967 | stream->write((uint64_t*)&cgen_var_1210, 1 * 8); |
| 17968 | uint64_t cgen_var_1211; |
| 17969 | stream->handleMapping()->mapHandles_VkDebugReportCallbackEXT_u64(&local_callback, &cgen_var_1211, 1); |
| 17970 | stream->write((uint64_t*)&cgen_var_1211, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 17971 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 17972 | uint64_t cgen_var_1212 = (uint64_t)(uintptr_t)local_pAllocator; |
| 17973 | stream->putBe64(cgen_var_1212); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17974 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17975 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17976 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17977 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17978 | resources->destroyMapping()->mapHandles_VkDebugReportCallbackEXT((VkDebugReportCallbackEXT*)&callback); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 17979 | pool->freeAll(); |
| 17980 | countingStream->clearPool(); |
| 17981 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17982 | mImpl->log("finish vkDestroyDebugReportCallbackEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17983 | } |
| 17984 | |
| 17985 | void VkEncoder::vkDebugReportMessageEXT( |
| 17986 | VkInstance instance, |
| 17987 | VkDebugReportFlagsEXT flags, |
| 17988 | VkDebugReportObjectTypeEXT objectType, |
| 17989 | uint64_t object, |
| 17990 | size_t location, |
| 17991 | int32_t messageCode, |
| 17992 | const char* pLayerPrefix, |
| 17993 | const char* pMessage) |
| 17994 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 17995 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 17996 | mImpl->log("start vkDebugReportMessageEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 17997 | auto stream = mImpl->stream(); |
| 17998 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 17999 | auto resources = mImpl->resources(); |
| 18000 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 18001 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18002 | VkInstance local_instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18003 | VkDebugReportFlagsEXT local_flags; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18004 | VkDebugReportObjectTypeEXT local_objectType; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18005 | uint64_t local_object; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18006 | size_t local_location; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18007 | int32_t local_messageCode; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18008 | char* local_pLayerPrefix; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 18009 | char* local_pMessage; |
| 18010 | local_instance = instance; |
| 18011 | local_flags = flags; |
| 18012 | local_objectType = objectType; |
| 18013 | local_object = object; |
| 18014 | local_location = location; |
| 18015 | local_messageCode = messageCode; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18016 | local_pLayerPrefix = nullptr; |
| 18017 | if (pLayerPrefix) |
| 18018 | { |
| 18019 | local_pLayerPrefix = pool->strDup(pLayerPrefix); |
| 18020 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18021 | local_pMessage = nullptr; |
| 18022 | if (pMessage) |
| 18023 | { |
| 18024 | local_pMessage = pool->strDup(pMessage); |
| 18025 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18026 | countingStream->rewind(); |
| 18027 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18028 | uint64_t cgen_var_1213; |
| 18029 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1213, 1); |
| 18030 | countingStream->write((uint64_t*)&cgen_var_1213, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18031 | countingStream->write((VkDebugReportFlagsEXT*)&local_flags, sizeof(VkDebugReportFlagsEXT)); |
| 18032 | countingStream->write((VkDebugReportObjectTypeEXT*)&local_objectType, sizeof(VkDebugReportObjectTypeEXT)); |
| 18033 | countingStream->write((uint64_t*)&local_object, sizeof(uint64_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18034 | uint64_t cgen_var_1214 = (uint64_t)local_location; |
| 18035 | countingStream->putBe64(cgen_var_1214); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18036 | countingStream->write((int32_t*)&local_messageCode, sizeof(int32_t)); |
| 18037 | countingStream->putString(local_pLayerPrefix); |
| 18038 | countingStream->putString(local_pMessage); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18039 | } |
| 18040 | uint32_t packetSize_vkDebugReportMessageEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 18041 | countingStream->rewind(); |
| 18042 | uint32_t opcode_vkDebugReportMessageEXT = OP_vkDebugReportMessageEXT; |
| 18043 | stream->write(&opcode_vkDebugReportMessageEXT, sizeof(uint32_t)); |
| 18044 | stream->write(&packetSize_vkDebugReportMessageEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18045 | uint64_t cgen_var_1215; |
| 18046 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1215, 1); |
| 18047 | stream->write((uint64_t*)&cgen_var_1215, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18048 | stream->write((VkDebugReportFlagsEXT*)&local_flags, sizeof(VkDebugReportFlagsEXT)); |
| 18049 | stream->write((VkDebugReportObjectTypeEXT*)&local_objectType, sizeof(VkDebugReportObjectTypeEXT)); |
| 18050 | stream->write((uint64_t*)&local_object, sizeof(uint64_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18051 | uint64_t cgen_var_1216 = (uint64_t)local_location; |
| 18052 | stream->putBe64(cgen_var_1216); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18053 | stream->write((int32_t*)&local_messageCode, sizeof(int32_t)); |
| 18054 | stream->putString(local_pLayerPrefix); |
| 18055 | stream->putString(local_pMessage); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 18056 | pool->freeAll(); |
| 18057 | countingStream->clearPool(); |
| 18058 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18059 | mImpl->log("finish vkDebugReportMessageEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18060 | } |
| 18061 | |
| 18062 | #endif |
| 18063 | #ifdef VK_NV_glsl_shader |
| 18064 | #endif |
| 18065 | #ifdef VK_EXT_depth_range_unrestricted |
| 18066 | #endif |
| 18067 | #ifdef VK_IMG_filter_cubic |
| 18068 | #endif |
| 18069 | #ifdef VK_AMD_rasterization_order |
| 18070 | #endif |
| 18071 | #ifdef VK_AMD_shader_trinary_minmax |
| 18072 | #endif |
| 18073 | #ifdef VK_AMD_shader_explicit_vertex_parameter |
| 18074 | #endif |
| 18075 | #ifdef VK_EXT_debug_marker |
| 18076 | VkResult VkEncoder::vkDebugMarkerSetObjectTagEXT( |
| 18077 | VkDevice device, |
| 18078 | const VkDebugMarkerObjectTagInfoEXT* pTagInfo) |
| 18079 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 18080 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18081 | mImpl->log("start vkDebugMarkerSetObjectTagEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18082 | auto stream = mImpl->stream(); |
| 18083 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18084 | auto resources = mImpl->resources(); |
| 18085 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 18086 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18087 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18088 | VkDebugMarkerObjectTagInfoEXT* local_pTagInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 18089 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18090 | local_pTagInfo = nullptr; |
| 18091 | if (pTagInfo) |
| 18092 | { |
| 18093 | local_pTagInfo = (VkDebugMarkerObjectTagInfoEXT*)pool->alloc(sizeof(const VkDebugMarkerObjectTagInfoEXT)); |
| 18094 | deepcopy_VkDebugMarkerObjectTagInfoEXT(pool, pTagInfo, (VkDebugMarkerObjectTagInfoEXT*)(local_pTagInfo)); |
| 18095 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 18096 | if (local_pTagInfo) |
| 18097 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 18098 | transform_tohost_VkDebugMarkerObjectTagInfoEXT(mImpl->resources(), (VkDebugMarkerObjectTagInfoEXT*)(local_pTagInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 18099 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18100 | countingStream->rewind(); |
| 18101 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18102 | uint64_t cgen_var_1217; |
| 18103 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1217, 1); |
| 18104 | countingStream->write((uint64_t*)&cgen_var_1217, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18105 | marshal_VkDebugMarkerObjectTagInfoEXT(countingStream, (VkDebugMarkerObjectTagInfoEXT*)(local_pTagInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18106 | } |
| 18107 | uint32_t packetSize_vkDebugMarkerSetObjectTagEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 18108 | countingStream->rewind(); |
| 18109 | uint32_t opcode_vkDebugMarkerSetObjectTagEXT = OP_vkDebugMarkerSetObjectTagEXT; |
| 18110 | stream->write(&opcode_vkDebugMarkerSetObjectTagEXT, sizeof(uint32_t)); |
| 18111 | stream->write(&packetSize_vkDebugMarkerSetObjectTagEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18112 | uint64_t cgen_var_1218; |
| 18113 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1218, 1); |
| 18114 | stream->write((uint64_t*)&cgen_var_1218, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18115 | marshal_VkDebugMarkerObjectTagInfoEXT(stream, (VkDebugMarkerObjectTagInfoEXT*)(local_pTagInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18116 | VkResult vkDebugMarkerSetObjectTagEXT_VkResult_return = (VkResult)0; |
| 18117 | stream->read(&vkDebugMarkerSetObjectTagEXT_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 18118 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 18119 | countingStream->clearPool(); |
| 18120 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18121 | mImpl->log("finish vkDebugMarkerSetObjectTagEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18122 | return vkDebugMarkerSetObjectTagEXT_VkResult_return; |
| 18123 | } |
| 18124 | |
| 18125 | VkResult VkEncoder::vkDebugMarkerSetObjectNameEXT( |
| 18126 | VkDevice device, |
| 18127 | const VkDebugMarkerObjectNameInfoEXT* pNameInfo) |
| 18128 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 18129 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18130 | mImpl->log("start vkDebugMarkerSetObjectNameEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18131 | auto stream = mImpl->stream(); |
| 18132 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18133 | auto resources = mImpl->resources(); |
| 18134 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 18135 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18136 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18137 | VkDebugMarkerObjectNameInfoEXT* local_pNameInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 18138 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18139 | local_pNameInfo = nullptr; |
| 18140 | if (pNameInfo) |
| 18141 | { |
| 18142 | local_pNameInfo = (VkDebugMarkerObjectNameInfoEXT*)pool->alloc(sizeof(const VkDebugMarkerObjectNameInfoEXT)); |
| 18143 | deepcopy_VkDebugMarkerObjectNameInfoEXT(pool, pNameInfo, (VkDebugMarkerObjectNameInfoEXT*)(local_pNameInfo)); |
| 18144 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 18145 | if (local_pNameInfo) |
| 18146 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 18147 | transform_tohost_VkDebugMarkerObjectNameInfoEXT(mImpl->resources(), (VkDebugMarkerObjectNameInfoEXT*)(local_pNameInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 18148 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18149 | countingStream->rewind(); |
| 18150 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18151 | uint64_t cgen_var_1219; |
| 18152 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1219, 1); |
| 18153 | countingStream->write((uint64_t*)&cgen_var_1219, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18154 | marshal_VkDebugMarkerObjectNameInfoEXT(countingStream, (VkDebugMarkerObjectNameInfoEXT*)(local_pNameInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18155 | } |
| 18156 | uint32_t packetSize_vkDebugMarkerSetObjectNameEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 18157 | countingStream->rewind(); |
| 18158 | uint32_t opcode_vkDebugMarkerSetObjectNameEXT = OP_vkDebugMarkerSetObjectNameEXT; |
| 18159 | stream->write(&opcode_vkDebugMarkerSetObjectNameEXT, sizeof(uint32_t)); |
| 18160 | stream->write(&packetSize_vkDebugMarkerSetObjectNameEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18161 | uint64_t cgen_var_1220; |
| 18162 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1220, 1); |
| 18163 | stream->write((uint64_t*)&cgen_var_1220, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18164 | marshal_VkDebugMarkerObjectNameInfoEXT(stream, (VkDebugMarkerObjectNameInfoEXT*)(local_pNameInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18165 | VkResult vkDebugMarkerSetObjectNameEXT_VkResult_return = (VkResult)0; |
| 18166 | stream->read(&vkDebugMarkerSetObjectNameEXT_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 18167 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 18168 | countingStream->clearPool(); |
| 18169 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18170 | mImpl->log("finish vkDebugMarkerSetObjectNameEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18171 | return vkDebugMarkerSetObjectNameEXT_VkResult_return; |
| 18172 | } |
| 18173 | |
| 18174 | void VkEncoder::vkCmdDebugMarkerBeginEXT( |
| 18175 | VkCommandBuffer commandBuffer, |
| 18176 | const VkDebugMarkerMarkerInfoEXT* pMarkerInfo) |
| 18177 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 18178 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18179 | mImpl->log("start vkCmdDebugMarkerBeginEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18180 | auto stream = mImpl->stream(); |
| 18181 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18182 | auto resources = mImpl->resources(); |
| 18183 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 18184 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18185 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18186 | VkDebugMarkerMarkerInfoEXT* local_pMarkerInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 18187 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18188 | local_pMarkerInfo = nullptr; |
| 18189 | if (pMarkerInfo) |
| 18190 | { |
| 18191 | local_pMarkerInfo = (VkDebugMarkerMarkerInfoEXT*)pool->alloc(sizeof(const VkDebugMarkerMarkerInfoEXT)); |
| 18192 | deepcopy_VkDebugMarkerMarkerInfoEXT(pool, pMarkerInfo, (VkDebugMarkerMarkerInfoEXT*)(local_pMarkerInfo)); |
| 18193 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 18194 | if (local_pMarkerInfo) |
| 18195 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 18196 | transform_tohost_VkDebugMarkerMarkerInfoEXT(mImpl->resources(), (VkDebugMarkerMarkerInfoEXT*)(local_pMarkerInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 18197 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18198 | countingStream->rewind(); |
| 18199 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18200 | uint64_t cgen_var_1221; |
| 18201 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1221, 1); |
| 18202 | countingStream->write((uint64_t*)&cgen_var_1221, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18203 | marshal_VkDebugMarkerMarkerInfoEXT(countingStream, (VkDebugMarkerMarkerInfoEXT*)(local_pMarkerInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18204 | } |
| 18205 | uint32_t packetSize_vkCmdDebugMarkerBeginEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 18206 | countingStream->rewind(); |
| 18207 | uint32_t opcode_vkCmdDebugMarkerBeginEXT = OP_vkCmdDebugMarkerBeginEXT; |
| 18208 | stream->write(&opcode_vkCmdDebugMarkerBeginEXT, sizeof(uint32_t)); |
| 18209 | stream->write(&packetSize_vkCmdDebugMarkerBeginEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18210 | uint64_t cgen_var_1222; |
| 18211 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1222, 1); |
| 18212 | stream->write((uint64_t*)&cgen_var_1222, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18213 | marshal_VkDebugMarkerMarkerInfoEXT(stream, (VkDebugMarkerMarkerInfoEXT*)(local_pMarkerInfo)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 18214 | pool->freeAll(); |
| 18215 | countingStream->clearPool(); |
| 18216 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18217 | mImpl->log("finish vkCmdDebugMarkerBeginEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18218 | } |
| 18219 | |
| 18220 | void VkEncoder::vkCmdDebugMarkerEndEXT( |
| 18221 | VkCommandBuffer commandBuffer) |
| 18222 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 18223 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18224 | mImpl->log("start vkCmdDebugMarkerEndEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18225 | auto stream = mImpl->stream(); |
| 18226 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18227 | auto resources = mImpl->resources(); |
| 18228 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 18229 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18230 | VkCommandBuffer local_commandBuffer; |
| 18231 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18232 | countingStream->rewind(); |
| 18233 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18234 | uint64_t cgen_var_1223; |
| 18235 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1223, 1); |
| 18236 | countingStream->write((uint64_t*)&cgen_var_1223, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18237 | } |
| 18238 | uint32_t packetSize_vkCmdDebugMarkerEndEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 18239 | countingStream->rewind(); |
| 18240 | uint32_t opcode_vkCmdDebugMarkerEndEXT = OP_vkCmdDebugMarkerEndEXT; |
| 18241 | stream->write(&opcode_vkCmdDebugMarkerEndEXT, sizeof(uint32_t)); |
| 18242 | stream->write(&packetSize_vkCmdDebugMarkerEndEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18243 | uint64_t cgen_var_1224; |
| 18244 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1224, 1); |
| 18245 | stream->write((uint64_t*)&cgen_var_1224, 1 * 8); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 18246 | pool->freeAll(); |
| 18247 | countingStream->clearPool(); |
| 18248 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18249 | mImpl->log("finish vkCmdDebugMarkerEndEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18250 | } |
| 18251 | |
| 18252 | void VkEncoder::vkCmdDebugMarkerInsertEXT( |
| 18253 | VkCommandBuffer commandBuffer, |
| 18254 | const VkDebugMarkerMarkerInfoEXT* pMarkerInfo) |
| 18255 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 18256 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18257 | mImpl->log("start vkCmdDebugMarkerInsertEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18258 | auto stream = mImpl->stream(); |
| 18259 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18260 | auto resources = mImpl->resources(); |
| 18261 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 18262 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18263 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18264 | VkDebugMarkerMarkerInfoEXT* local_pMarkerInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 18265 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18266 | local_pMarkerInfo = nullptr; |
| 18267 | if (pMarkerInfo) |
| 18268 | { |
| 18269 | local_pMarkerInfo = (VkDebugMarkerMarkerInfoEXT*)pool->alloc(sizeof(const VkDebugMarkerMarkerInfoEXT)); |
| 18270 | deepcopy_VkDebugMarkerMarkerInfoEXT(pool, pMarkerInfo, (VkDebugMarkerMarkerInfoEXT*)(local_pMarkerInfo)); |
| 18271 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 18272 | if (local_pMarkerInfo) |
| 18273 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 18274 | transform_tohost_VkDebugMarkerMarkerInfoEXT(mImpl->resources(), (VkDebugMarkerMarkerInfoEXT*)(local_pMarkerInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 18275 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18276 | countingStream->rewind(); |
| 18277 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18278 | uint64_t cgen_var_1225; |
| 18279 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1225, 1); |
| 18280 | countingStream->write((uint64_t*)&cgen_var_1225, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18281 | marshal_VkDebugMarkerMarkerInfoEXT(countingStream, (VkDebugMarkerMarkerInfoEXT*)(local_pMarkerInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18282 | } |
| 18283 | uint32_t packetSize_vkCmdDebugMarkerInsertEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 18284 | countingStream->rewind(); |
| 18285 | uint32_t opcode_vkCmdDebugMarkerInsertEXT = OP_vkCmdDebugMarkerInsertEXT; |
| 18286 | stream->write(&opcode_vkCmdDebugMarkerInsertEXT, sizeof(uint32_t)); |
| 18287 | stream->write(&packetSize_vkCmdDebugMarkerInsertEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18288 | uint64_t cgen_var_1226; |
| 18289 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1226, 1); |
| 18290 | stream->write((uint64_t*)&cgen_var_1226, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18291 | marshal_VkDebugMarkerMarkerInfoEXT(stream, (VkDebugMarkerMarkerInfoEXT*)(local_pMarkerInfo)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 18292 | pool->freeAll(); |
| 18293 | countingStream->clearPool(); |
| 18294 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18295 | mImpl->log("finish vkCmdDebugMarkerInsertEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18296 | } |
| 18297 | |
| 18298 | #endif |
| 18299 | #ifdef VK_AMD_gcn_shader |
| 18300 | #endif |
| 18301 | #ifdef VK_NV_dedicated_allocation |
| 18302 | #endif |
| 18303 | #ifdef VK_AMD_draw_indirect_count |
| 18304 | void VkEncoder::vkCmdDrawIndirectCountAMD( |
| 18305 | VkCommandBuffer commandBuffer, |
| 18306 | VkBuffer buffer, |
| 18307 | VkDeviceSize offset, |
| 18308 | VkBuffer countBuffer, |
| 18309 | VkDeviceSize countBufferOffset, |
| 18310 | uint32_t maxDrawCount, |
| 18311 | uint32_t stride) |
| 18312 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 18313 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18314 | mImpl->log("start vkCmdDrawIndirectCountAMD"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18315 | auto stream = mImpl->stream(); |
| 18316 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18317 | auto resources = mImpl->resources(); |
| 18318 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 18319 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18320 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18321 | VkBuffer local_buffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18322 | VkDeviceSize local_offset; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18323 | VkBuffer local_countBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18324 | VkDeviceSize local_countBufferOffset; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18325 | uint32_t local_maxDrawCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18326 | uint32_t local_stride; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 18327 | local_commandBuffer = commandBuffer; |
| 18328 | local_buffer = buffer; |
| 18329 | local_offset = offset; |
| 18330 | local_countBuffer = countBuffer; |
| 18331 | local_countBufferOffset = countBufferOffset; |
| 18332 | local_maxDrawCount = maxDrawCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18333 | local_stride = stride; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18334 | countingStream->rewind(); |
| 18335 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18336 | uint64_t cgen_var_1227; |
| 18337 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1227, 1); |
| 18338 | countingStream->write((uint64_t*)&cgen_var_1227, 1 * 8); |
| 18339 | uint64_t cgen_var_1228; |
| 18340 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_1228, 1); |
| 18341 | countingStream->write((uint64_t*)&cgen_var_1228, 1 * 8); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame] | 18342 | countingStream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18343 | uint64_t cgen_var_1229; |
| 18344 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_countBuffer, &cgen_var_1229, 1); |
| 18345 | countingStream->write((uint64_t*)&cgen_var_1229, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18346 | countingStream->write((VkDeviceSize*)&local_countBufferOffset, sizeof(VkDeviceSize)); |
| 18347 | countingStream->write((uint32_t*)&local_maxDrawCount, sizeof(uint32_t)); |
| 18348 | countingStream->write((uint32_t*)&local_stride, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18349 | } |
| 18350 | uint32_t packetSize_vkCmdDrawIndirectCountAMD = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 18351 | countingStream->rewind(); |
| 18352 | uint32_t opcode_vkCmdDrawIndirectCountAMD = OP_vkCmdDrawIndirectCountAMD; |
| 18353 | stream->write(&opcode_vkCmdDrawIndirectCountAMD, sizeof(uint32_t)); |
| 18354 | stream->write(&packetSize_vkCmdDrawIndirectCountAMD, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18355 | uint64_t cgen_var_1230; |
| 18356 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1230, 1); |
| 18357 | stream->write((uint64_t*)&cgen_var_1230, 1 * 8); |
| 18358 | uint64_t cgen_var_1231; |
| 18359 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_1231, 1); |
| 18360 | stream->write((uint64_t*)&cgen_var_1231, 1 * 8); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame] | 18361 | stream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18362 | uint64_t cgen_var_1232; |
| 18363 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_countBuffer, &cgen_var_1232, 1); |
| 18364 | stream->write((uint64_t*)&cgen_var_1232, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18365 | stream->write((VkDeviceSize*)&local_countBufferOffset, sizeof(VkDeviceSize)); |
| 18366 | stream->write((uint32_t*)&local_maxDrawCount, sizeof(uint32_t)); |
| 18367 | stream->write((uint32_t*)&local_stride, sizeof(uint32_t)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 18368 | pool->freeAll(); |
| 18369 | countingStream->clearPool(); |
| 18370 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18371 | mImpl->log("finish vkCmdDrawIndirectCountAMD");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18372 | } |
| 18373 | |
| 18374 | void VkEncoder::vkCmdDrawIndexedIndirectCountAMD( |
| 18375 | VkCommandBuffer commandBuffer, |
| 18376 | VkBuffer buffer, |
| 18377 | VkDeviceSize offset, |
| 18378 | VkBuffer countBuffer, |
| 18379 | VkDeviceSize countBufferOffset, |
| 18380 | uint32_t maxDrawCount, |
| 18381 | uint32_t stride) |
| 18382 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 18383 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18384 | mImpl->log("start vkCmdDrawIndexedIndirectCountAMD"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18385 | auto stream = mImpl->stream(); |
| 18386 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18387 | auto resources = mImpl->resources(); |
| 18388 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 18389 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18390 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18391 | VkBuffer local_buffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18392 | VkDeviceSize local_offset; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18393 | VkBuffer local_countBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18394 | VkDeviceSize local_countBufferOffset; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18395 | uint32_t local_maxDrawCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18396 | uint32_t local_stride; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 18397 | local_commandBuffer = commandBuffer; |
| 18398 | local_buffer = buffer; |
| 18399 | local_offset = offset; |
| 18400 | local_countBuffer = countBuffer; |
| 18401 | local_countBufferOffset = countBufferOffset; |
| 18402 | local_maxDrawCount = maxDrawCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18403 | local_stride = stride; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18404 | countingStream->rewind(); |
| 18405 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18406 | uint64_t cgen_var_1233; |
| 18407 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1233, 1); |
| 18408 | countingStream->write((uint64_t*)&cgen_var_1233, 1 * 8); |
| 18409 | uint64_t cgen_var_1234; |
| 18410 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_1234, 1); |
| 18411 | countingStream->write((uint64_t*)&cgen_var_1234, 1 * 8); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame] | 18412 | countingStream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18413 | uint64_t cgen_var_1235; |
| 18414 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_countBuffer, &cgen_var_1235, 1); |
| 18415 | countingStream->write((uint64_t*)&cgen_var_1235, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18416 | countingStream->write((VkDeviceSize*)&local_countBufferOffset, sizeof(VkDeviceSize)); |
| 18417 | countingStream->write((uint32_t*)&local_maxDrawCount, sizeof(uint32_t)); |
| 18418 | countingStream->write((uint32_t*)&local_stride, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18419 | } |
| 18420 | uint32_t packetSize_vkCmdDrawIndexedIndirectCountAMD = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 18421 | countingStream->rewind(); |
| 18422 | uint32_t opcode_vkCmdDrawIndexedIndirectCountAMD = OP_vkCmdDrawIndexedIndirectCountAMD; |
| 18423 | stream->write(&opcode_vkCmdDrawIndexedIndirectCountAMD, sizeof(uint32_t)); |
| 18424 | stream->write(&packetSize_vkCmdDrawIndexedIndirectCountAMD, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18425 | uint64_t cgen_var_1236; |
| 18426 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1236, 1); |
| 18427 | stream->write((uint64_t*)&cgen_var_1236, 1 * 8); |
| 18428 | uint64_t cgen_var_1237; |
| 18429 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_1237, 1); |
| 18430 | stream->write((uint64_t*)&cgen_var_1237, 1 * 8); |
| Lingfeng Yang | 5fda813 | 2019-01-23 09:57:27 -0800 | [diff] [blame] | 18431 | stream->write((VkDeviceSize*)&local_offset, sizeof(VkDeviceSize)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18432 | uint64_t cgen_var_1238; |
| 18433 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_countBuffer, &cgen_var_1238, 1); |
| 18434 | stream->write((uint64_t*)&cgen_var_1238, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18435 | stream->write((VkDeviceSize*)&local_countBufferOffset, sizeof(VkDeviceSize)); |
| 18436 | stream->write((uint32_t*)&local_maxDrawCount, sizeof(uint32_t)); |
| 18437 | stream->write((uint32_t*)&local_stride, sizeof(uint32_t)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 18438 | pool->freeAll(); |
| 18439 | countingStream->clearPool(); |
| 18440 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18441 | mImpl->log("finish vkCmdDrawIndexedIndirectCountAMD");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18442 | } |
| 18443 | |
| 18444 | #endif |
| 18445 | #ifdef VK_AMD_negative_viewport_height |
| 18446 | #endif |
| 18447 | #ifdef VK_AMD_gpu_shader_half_float |
| 18448 | #endif |
| 18449 | #ifdef VK_AMD_shader_ballot |
| 18450 | #endif |
| 18451 | #ifdef VK_AMD_texture_gather_bias_lod |
| 18452 | #endif |
| 18453 | #ifdef VK_AMD_shader_info |
| 18454 | VkResult VkEncoder::vkGetShaderInfoAMD( |
| 18455 | VkDevice device, |
| 18456 | VkPipeline pipeline, |
| 18457 | VkShaderStageFlagBits shaderStage, |
| 18458 | VkShaderInfoTypeAMD infoType, |
| 18459 | size_t* pInfoSize, |
| 18460 | void* pInfo) |
| 18461 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 18462 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18463 | mImpl->log("start vkGetShaderInfoAMD"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18464 | auto stream = mImpl->stream(); |
| 18465 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18466 | auto resources = mImpl->resources(); |
| 18467 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 18468 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18469 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18470 | VkPipeline local_pipeline; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18471 | VkShaderStageFlagBits local_shaderStage; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18472 | VkShaderInfoTypeAMD local_infoType; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 18473 | local_device = device; |
| 18474 | local_pipeline = pipeline; |
| 18475 | local_shaderStage = shaderStage; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18476 | local_infoType = infoType; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18477 | countingStream->rewind(); |
| 18478 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18479 | uint64_t cgen_var_1239; |
| 18480 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1239, 1); |
| 18481 | countingStream->write((uint64_t*)&cgen_var_1239, 1 * 8); |
| 18482 | uint64_t cgen_var_1240; |
| 18483 | countingStream->handleMapping()->mapHandles_VkPipeline_u64(&local_pipeline, &cgen_var_1240, 1); |
| 18484 | countingStream->write((uint64_t*)&cgen_var_1240, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18485 | countingStream->write((VkShaderStageFlagBits*)&local_shaderStage, sizeof(VkShaderStageFlagBits)); |
| 18486 | countingStream->write((VkShaderInfoTypeAMD*)&local_infoType, sizeof(VkShaderInfoTypeAMD)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 18487 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18488 | uint64_t cgen_var_1241 = (uint64_t)(uintptr_t)pInfoSize; |
| 18489 | countingStream->putBe64(cgen_var_1241); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18490 | if (pInfoSize) |
| 18491 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18492 | uint64_t cgen_var_1242 = (uint64_t)(*pInfoSize); |
| 18493 | countingStream->putBe64(cgen_var_1242); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18494 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 18495 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18496 | uint64_t cgen_var_1243 = (uint64_t)(uintptr_t)pInfo; |
| 18497 | countingStream->putBe64(cgen_var_1243); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18498 | if (pInfo) |
| 18499 | { |
| 18500 | countingStream->write((void*)pInfo, (*(pInfoSize)) * sizeof(uint8_t)); |
| 18501 | } |
| 18502 | } |
| 18503 | uint32_t packetSize_vkGetShaderInfoAMD = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 18504 | countingStream->rewind(); |
| 18505 | uint32_t opcode_vkGetShaderInfoAMD = OP_vkGetShaderInfoAMD; |
| 18506 | stream->write(&opcode_vkGetShaderInfoAMD, sizeof(uint32_t)); |
| 18507 | stream->write(&packetSize_vkGetShaderInfoAMD, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18508 | uint64_t cgen_var_1244; |
| 18509 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1244, 1); |
| 18510 | stream->write((uint64_t*)&cgen_var_1244, 1 * 8); |
| 18511 | uint64_t cgen_var_1245; |
| 18512 | stream->handleMapping()->mapHandles_VkPipeline_u64(&local_pipeline, &cgen_var_1245, 1); |
| 18513 | stream->write((uint64_t*)&cgen_var_1245, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18514 | stream->write((VkShaderStageFlagBits*)&local_shaderStage, sizeof(VkShaderStageFlagBits)); |
| 18515 | stream->write((VkShaderInfoTypeAMD*)&local_infoType, sizeof(VkShaderInfoTypeAMD)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 18516 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18517 | uint64_t cgen_var_1246 = (uint64_t)(uintptr_t)pInfoSize; |
| 18518 | stream->putBe64(cgen_var_1246); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18519 | if (pInfoSize) |
| 18520 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18521 | uint64_t cgen_var_1247 = (uint64_t)(*pInfoSize); |
| 18522 | stream->putBe64(cgen_var_1247); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18523 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 18524 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18525 | uint64_t cgen_var_1248 = (uint64_t)(uintptr_t)pInfo; |
| 18526 | stream->putBe64(cgen_var_1248); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18527 | if (pInfo) |
| 18528 | { |
| 18529 | stream->write((void*)pInfo, (*(pInfoSize)) * sizeof(uint8_t)); |
| 18530 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 18531 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18532 | size_t* check_pInfoSize; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 18533 | check_pInfoSize = (size_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18534 | if (pInfoSize) |
| 18535 | { |
| 18536 | if (!(check_pInfoSize)) |
| 18537 | { |
| 18538 | fprintf(stderr, "fatal: pInfoSize inconsistent between guest and host\n"); |
| 18539 | } |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 18540 | (*pInfoSize) = (size_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18541 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 18542 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18543 | void* check_pInfo; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 18544 | check_pInfo = (void*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18545 | if (pInfo) |
| 18546 | { |
| 18547 | if (!(check_pInfo)) |
| 18548 | { |
| 18549 | fprintf(stderr, "fatal: pInfo inconsistent between guest and host\n"); |
| 18550 | } |
| 18551 | stream->read((void*)pInfo, (*(pInfoSize)) * sizeof(uint8_t)); |
| 18552 | } |
| 18553 | VkResult vkGetShaderInfoAMD_VkResult_return = (VkResult)0; |
| 18554 | stream->read(&vkGetShaderInfoAMD_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 18555 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 18556 | countingStream->clearPool(); |
| 18557 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18558 | mImpl->log("finish vkGetShaderInfoAMD");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18559 | return vkGetShaderInfoAMD_VkResult_return; |
| 18560 | } |
| 18561 | |
| 18562 | #endif |
| 18563 | #ifdef VK_AMD_shader_image_load_store_lod |
| 18564 | #endif |
| 18565 | #ifdef VK_IMG_format_pvrtc |
| 18566 | #endif |
| 18567 | #ifdef VK_NV_external_memory_capabilities |
| 18568 | VkResult VkEncoder::vkGetPhysicalDeviceExternalImageFormatPropertiesNV( |
| 18569 | VkPhysicalDevice physicalDevice, |
| 18570 | VkFormat format, |
| 18571 | VkImageType type, |
| 18572 | VkImageTiling tiling, |
| 18573 | VkImageUsageFlags usage, |
| 18574 | VkImageCreateFlags flags, |
| 18575 | VkExternalMemoryHandleTypeFlagsNV externalHandleType, |
| 18576 | VkExternalImageFormatPropertiesNV* pExternalImageFormatProperties) |
| 18577 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 18578 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18579 | mImpl->log("start vkGetPhysicalDeviceExternalImageFormatPropertiesNV"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18580 | auto stream = mImpl->stream(); |
| 18581 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18582 | auto resources = mImpl->resources(); |
| 18583 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 18584 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18585 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18586 | VkFormat local_format; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18587 | VkImageType local_type; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18588 | VkImageTiling local_tiling; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18589 | VkImageUsageFlags local_usage; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18590 | VkImageCreateFlags local_flags; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18591 | VkExternalMemoryHandleTypeFlagsNV local_externalHandleType; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 18592 | local_physicalDevice = physicalDevice; |
| 18593 | local_format = format; |
| 18594 | local_type = type; |
| 18595 | local_tiling = tiling; |
| 18596 | local_usage = usage; |
| 18597 | local_flags = flags; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18598 | local_externalHandleType = externalHandleType; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18599 | countingStream->rewind(); |
| 18600 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18601 | uint64_t cgen_var_1252; |
| 18602 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1252, 1); |
| 18603 | countingStream->write((uint64_t*)&cgen_var_1252, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18604 | countingStream->write((VkFormat*)&local_format, sizeof(VkFormat)); |
| 18605 | countingStream->write((VkImageType*)&local_type, sizeof(VkImageType)); |
| 18606 | countingStream->write((VkImageTiling*)&local_tiling, sizeof(VkImageTiling)); |
| 18607 | countingStream->write((VkImageUsageFlags*)&local_usage, sizeof(VkImageUsageFlags)); |
| 18608 | countingStream->write((VkImageCreateFlags*)&local_flags, sizeof(VkImageCreateFlags)); |
| 18609 | countingStream->write((VkExternalMemoryHandleTypeFlagsNV*)&local_externalHandleType, sizeof(VkExternalMemoryHandleTypeFlagsNV)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18610 | marshal_VkExternalImageFormatPropertiesNV(countingStream, (VkExternalImageFormatPropertiesNV*)(pExternalImageFormatProperties)); |
| 18611 | } |
| 18612 | uint32_t packetSize_vkGetPhysicalDeviceExternalImageFormatPropertiesNV = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 18613 | countingStream->rewind(); |
| 18614 | uint32_t opcode_vkGetPhysicalDeviceExternalImageFormatPropertiesNV = OP_vkGetPhysicalDeviceExternalImageFormatPropertiesNV; |
| 18615 | stream->write(&opcode_vkGetPhysicalDeviceExternalImageFormatPropertiesNV, sizeof(uint32_t)); |
| 18616 | stream->write(&packetSize_vkGetPhysicalDeviceExternalImageFormatPropertiesNV, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18617 | uint64_t cgen_var_1253; |
| 18618 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1253, 1); |
| 18619 | stream->write((uint64_t*)&cgen_var_1253, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18620 | stream->write((VkFormat*)&local_format, sizeof(VkFormat)); |
| 18621 | stream->write((VkImageType*)&local_type, sizeof(VkImageType)); |
| 18622 | stream->write((VkImageTiling*)&local_tiling, sizeof(VkImageTiling)); |
| 18623 | stream->write((VkImageUsageFlags*)&local_usage, sizeof(VkImageUsageFlags)); |
| 18624 | stream->write((VkImageCreateFlags*)&local_flags, sizeof(VkImageCreateFlags)); |
| 18625 | stream->write((VkExternalMemoryHandleTypeFlagsNV*)&local_externalHandleType, sizeof(VkExternalMemoryHandleTypeFlagsNV)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18626 | marshal_VkExternalImageFormatPropertiesNV(stream, (VkExternalImageFormatPropertiesNV*)(pExternalImageFormatProperties)); |
| 18627 | unmarshal_VkExternalImageFormatPropertiesNV(stream, (VkExternalImageFormatPropertiesNV*)(pExternalImageFormatProperties)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 18628 | if (pExternalImageFormatProperties) |
| 18629 | { |
| 18630 | transform_fromhost_VkExternalImageFormatPropertiesNV(mImpl->resources(), (VkExternalImageFormatPropertiesNV*)(pExternalImageFormatProperties)); |
| 18631 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18632 | VkResult vkGetPhysicalDeviceExternalImageFormatPropertiesNV_VkResult_return = (VkResult)0; |
| 18633 | stream->read(&vkGetPhysicalDeviceExternalImageFormatPropertiesNV_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 18634 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 18635 | countingStream->clearPool(); |
| 18636 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18637 | mImpl->log("finish vkGetPhysicalDeviceExternalImageFormatPropertiesNV");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18638 | return vkGetPhysicalDeviceExternalImageFormatPropertiesNV_VkResult_return; |
| 18639 | } |
| 18640 | |
| 18641 | #endif |
| 18642 | #ifdef VK_NV_external_memory |
| 18643 | #endif |
| 18644 | #ifdef VK_NV_external_memory_win32 |
| 18645 | VkResult VkEncoder::vkGetMemoryWin32HandleNV( |
| 18646 | VkDevice device, |
| 18647 | VkDeviceMemory memory, |
| 18648 | VkExternalMemoryHandleTypeFlagsNV handleType, |
| 18649 | HANDLE* pHandle) |
| 18650 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 18651 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18652 | mImpl->log("start vkGetMemoryWin32HandleNV"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18653 | auto stream = mImpl->stream(); |
| 18654 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18655 | auto resources = mImpl->resources(); |
| 18656 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 18657 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18658 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18659 | VkDeviceMemory local_memory; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18660 | VkExternalMemoryHandleTypeFlagsNV local_handleType; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 18661 | local_device = device; |
| 18662 | local_memory = memory; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18663 | local_handleType = handleType; |
| Lingfeng Yang | 2b1b8cf | 2019-02-08 09:53:36 -0800 | [diff] [blame] | 18664 | 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] | 18665 | countingStream->rewind(); |
| 18666 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18667 | uint64_t cgen_var_1254; |
| 18668 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1254, 1); |
| 18669 | countingStream->write((uint64_t*)&cgen_var_1254, 1 * 8); |
| 18670 | uint64_t cgen_var_1255; |
| 18671 | countingStream->handleMapping()->mapHandles_VkDeviceMemory_u64(&local_memory, &cgen_var_1255, 1); |
| 18672 | countingStream->write((uint64_t*)&cgen_var_1255, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18673 | countingStream->write((VkExternalMemoryHandleTypeFlagsNV*)&local_handleType, sizeof(VkExternalMemoryHandleTypeFlagsNV)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18674 | countingStream->write((HANDLE*)pHandle, sizeof(HANDLE)); |
| 18675 | } |
| 18676 | uint32_t packetSize_vkGetMemoryWin32HandleNV = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 18677 | countingStream->rewind(); |
| 18678 | uint32_t opcode_vkGetMemoryWin32HandleNV = OP_vkGetMemoryWin32HandleNV; |
| 18679 | stream->write(&opcode_vkGetMemoryWin32HandleNV, sizeof(uint32_t)); |
| 18680 | stream->write(&packetSize_vkGetMemoryWin32HandleNV, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18681 | uint64_t cgen_var_1256; |
| 18682 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1256, 1); |
| 18683 | stream->write((uint64_t*)&cgen_var_1256, 1 * 8); |
| 18684 | uint64_t cgen_var_1257; |
| 18685 | stream->handleMapping()->mapHandles_VkDeviceMemory_u64(&local_memory, &cgen_var_1257, 1); |
| 18686 | stream->write((uint64_t*)&cgen_var_1257, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18687 | stream->write((VkExternalMemoryHandleTypeFlagsNV*)&local_handleType, sizeof(VkExternalMemoryHandleTypeFlagsNV)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18688 | stream->write((HANDLE*)pHandle, sizeof(HANDLE)); |
| 18689 | stream->read((HANDLE*)pHandle, sizeof(HANDLE)); |
| 18690 | VkResult vkGetMemoryWin32HandleNV_VkResult_return = (VkResult)0; |
| 18691 | stream->read(&vkGetMemoryWin32HandleNV_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 18692 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 18693 | countingStream->clearPool(); |
| 18694 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18695 | mImpl->log("finish vkGetMemoryWin32HandleNV");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18696 | return vkGetMemoryWin32HandleNV_VkResult_return; |
| 18697 | } |
| 18698 | |
| 18699 | #endif |
| 18700 | #ifdef VK_NV_win32_keyed_mutex |
| 18701 | #endif |
| 18702 | #ifdef VK_EXT_validation_flags |
| 18703 | #endif |
| 18704 | #ifdef VK_NN_vi_surface |
| 18705 | VkResult VkEncoder::vkCreateViSurfaceNN( |
| 18706 | VkInstance instance, |
| 18707 | const VkViSurfaceCreateInfoNN* pCreateInfo, |
| 18708 | const VkAllocationCallbacks* pAllocator, |
| 18709 | VkSurfaceKHR* pSurface) |
| 18710 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 18711 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18712 | mImpl->log("start vkCreateViSurfaceNN"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18713 | auto stream = mImpl->stream(); |
| 18714 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18715 | auto resources = mImpl->resources(); |
| 18716 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 18717 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18718 | VkInstance local_instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18719 | VkViSurfaceCreateInfoNN* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 18720 | VkAllocationCallbacks* local_pAllocator; |
| 18721 | local_instance = instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18722 | local_pCreateInfo = nullptr; |
| 18723 | if (pCreateInfo) |
| 18724 | { |
| 18725 | local_pCreateInfo = (VkViSurfaceCreateInfoNN*)pool->alloc(sizeof(const VkViSurfaceCreateInfoNN)); |
| 18726 | deepcopy_VkViSurfaceCreateInfoNN(pool, pCreateInfo, (VkViSurfaceCreateInfoNN*)(local_pCreateInfo)); |
| 18727 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18728 | local_pAllocator = nullptr; |
| 18729 | if (pAllocator) |
| 18730 | { |
| 18731 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 18732 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 18733 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 18734 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 18735 | if (local_pCreateInfo) |
| 18736 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 18737 | transform_tohost_VkViSurfaceCreateInfoNN(mImpl->resources(), (VkViSurfaceCreateInfoNN*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 18738 | } |
| 18739 | if (local_pAllocator) |
| 18740 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 18741 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 18742 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18743 | countingStream->rewind(); |
| 18744 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18745 | uint64_t cgen_var_1258; |
| 18746 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1258, 1); |
| 18747 | countingStream->write((uint64_t*)&cgen_var_1258, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18748 | marshal_VkViSurfaceCreateInfoNN(countingStream, (VkViSurfaceCreateInfoNN*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 18749 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18750 | uint64_t cgen_var_1259 = (uint64_t)(uintptr_t)local_pAllocator; |
| 18751 | countingStream->putBe64(cgen_var_1259); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18752 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18753 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18754 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18755 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18756 | uint64_t cgen_var_1260; |
| 18757 | countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_1260, 1); |
| 18758 | countingStream->write((uint64_t*)&cgen_var_1260, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18759 | } |
| 18760 | uint32_t packetSize_vkCreateViSurfaceNN = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 18761 | countingStream->rewind(); |
| 18762 | uint32_t opcode_vkCreateViSurfaceNN = OP_vkCreateViSurfaceNN; |
| 18763 | stream->write(&opcode_vkCreateViSurfaceNN, sizeof(uint32_t)); |
| 18764 | stream->write(&packetSize_vkCreateViSurfaceNN, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18765 | uint64_t cgen_var_1261; |
| 18766 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1261, 1); |
| 18767 | stream->write((uint64_t*)&cgen_var_1261, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18768 | marshal_VkViSurfaceCreateInfoNN(stream, (VkViSurfaceCreateInfoNN*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 18769 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18770 | uint64_t cgen_var_1262 = (uint64_t)(uintptr_t)local_pAllocator; |
| 18771 | stream->putBe64(cgen_var_1262); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18772 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18773 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18774 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18775 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 18776 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18777 | uint64_t cgen_var_1263; |
| 18778 | stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_1263, 1); |
| 18779 | stream->write((uint64_t*)&cgen_var_1263, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 18780 | stream->setHandleMapping(resources->unwrapMapping()); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18781 | uint64_t cgen_var_1264; |
| 18782 | stream->read((uint64_t*)&cgen_var_1264, 8); |
| 18783 | stream->handleMapping()->mapHandles_u64_VkSurfaceKHR(&cgen_var_1264, (VkSurfaceKHR*)pSurface, 1); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18784 | VkResult vkCreateViSurfaceNN_VkResult_return = (VkResult)0; |
| 18785 | stream->read(&vkCreateViSurfaceNN_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 18786 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 18787 | countingStream->clearPool(); |
| 18788 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18789 | mImpl->log("finish vkCreateViSurfaceNN");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18790 | return vkCreateViSurfaceNN_VkResult_return; |
| 18791 | } |
| 18792 | |
| 18793 | #endif |
| 18794 | #ifdef VK_EXT_shader_subgroup_ballot |
| 18795 | #endif |
| 18796 | #ifdef VK_EXT_shader_subgroup_vote |
| 18797 | #endif |
| 18798 | #ifdef VK_EXT_conditional_rendering |
| 18799 | void VkEncoder::vkCmdBeginConditionalRenderingEXT( |
| 18800 | VkCommandBuffer commandBuffer, |
| 18801 | const VkConditionalRenderingBeginInfoEXT* pConditionalRenderingBegin) |
| 18802 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 18803 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18804 | mImpl->log("start vkCmdBeginConditionalRenderingEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18805 | auto stream = mImpl->stream(); |
| 18806 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18807 | auto resources = mImpl->resources(); |
| 18808 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 18809 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18810 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18811 | VkConditionalRenderingBeginInfoEXT* local_pConditionalRenderingBegin; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 18812 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18813 | local_pConditionalRenderingBegin = nullptr; |
| 18814 | if (pConditionalRenderingBegin) |
| 18815 | { |
| 18816 | local_pConditionalRenderingBegin = (VkConditionalRenderingBeginInfoEXT*)pool->alloc(sizeof(const VkConditionalRenderingBeginInfoEXT)); |
| 18817 | deepcopy_VkConditionalRenderingBeginInfoEXT(pool, pConditionalRenderingBegin, (VkConditionalRenderingBeginInfoEXT*)(local_pConditionalRenderingBegin)); |
| 18818 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 18819 | if (local_pConditionalRenderingBegin) |
| 18820 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 18821 | transform_tohost_VkConditionalRenderingBeginInfoEXT(mImpl->resources(), (VkConditionalRenderingBeginInfoEXT*)(local_pConditionalRenderingBegin)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 18822 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18823 | countingStream->rewind(); |
| 18824 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18825 | uint64_t cgen_var_1265; |
| 18826 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1265, 1); |
| 18827 | countingStream->write((uint64_t*)&cgen_var_1265, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18828 | marshal_VkConditionalRenderingBeginInfoEXT(countingStream, (VkConditionalRenderingBeginInfoEXT*)(local_pConditionalRenderingBegin)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18829 | } |
| 18830 | uint32_t packetSize_vkCmdBeginConditionalRenderingEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 18831 | countingStream->rewind(); |
| 18832 | uint32_t opcode_vkCmdBeginConditionalRenderingEXT = OP_vkCmdBeginConditionalRenderingEXT; |
| 18833 | stream->write(&opcode_vkCmdBeginConditionalRenderingEXT, sizeof(uint32_t)); |
| 18834 | stream->write(&packetSize_vkCmdBeginConditionalRenderingEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18835 | uint64_t cgen_var_1266; |
| 18836 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1266, 1); |
| 18837 | stream->write((uint64_t*)&cgen_var_1266, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18838 | marshal_VkConditionalRenderingBeginInfoEXT(stream, (VkConditionalRenderingBeginInfoEXT*)(local_pConditionalRenderingBegin)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 18839 | pool->freeAll(); |
| 18840 | countingStream->clearPool(); |
| 18841 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18842 | mImpl->log("finish vkCmdBeginConditionalRenderingEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18843 | } |
| 18844 | |
| 18845 | void VkEncoder::vkCmdEndConditionalRenderingEXT( |
| 18846 | VkCommandBuffer commandBuffer) |
| 18847 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 18848 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18849 | mImpl->log("start vkCmdEndConditionalRenderingEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18850 | auto stream = mImpl->stream(); |
| 18851 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18852 | auto resources = mImpl->resources(); |
| 18853 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 18854 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18855 | VkCommandBuffer local_commandBuffer; |
| 18856 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18857 | countingStream->rewind(); |
| 18858 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18859 | uint64_t cgen_var_1267; |
| 18860 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1267, 1); |
| 18861 | countingStream->write((uint64_t*)&cgen_var_1267, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18862 | } |
| 18863 | uint32_t packetSize_vkCmdEndConditionalRenderingEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 18864 | countingStream->rewind(); |
| 18865 | uint32_t opcode_vkCmdEndConditionalRenderingEXT = OP_vkCmdEndConditionalRenderingEXT; |
| 18866 | stream->write(&opcode_vkCmdEndConditionalRenderingEXT, sizeof(uint32_t)); |
| 18867 | stream->write(&packetSize_vkCmdEndConditionalRenderingEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18868 | uint64_t cgen_var_1268; |
| 18869 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1268, 1); |
| 18870 | stream->write((uint64_t*)&cgen_var_1268, 1 * 8); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 18871 | pool->freeAll(); |
| 18872 | countingStream->clearPool(); |
| 18873 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18874 | mImpl->log("finish vkCmdEndConditionalRenderingEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18875 | } |
| 18876 | |
| 18877 | #endif |
| 18878 | #ifdef VK_NVX_device_generated_commands |
| 18879 | void VkEncoder::vkCmdProcessCommandsNVX( |
| 18880 | VkCommandBuffer commandBuffer, |
| 18881 | const VkCmdProcessCommandsInfoNVX* pProcessCommandsInfo) |
| 18882 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 18883 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18884 | mImpl->log("start vkCmdProcessCommandsNVX"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18885 | auto stream = mImpl->stream(); |
| 18886 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18887 | auto resources = mImpl->resources(); |
| 18888 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 18889 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18890 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18891 | VkCmdProcessCommandsInfoNVX* local_pProcessCommandsInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 18892 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18893 | local_pProcessCommandsInfo = nullptr; |
| 18894 | if (pProcessCommandsInfo) |
| 18895 | { |
| 18896 | local_pProcessCommandsInfo = (VkCmdProcessCommandsInfoNVX*)pool->alloc(sizeof(const VkCmdProcessCommandsInfoNVX)); |
| 18897 | deepcopy_VkCmdProcessCommandsInfoNVX(pool, pProcessCommandsInfo, (VkCmdProcessCommandsInfoNVX*)(local_pProcessCommandsInfo)); |
| 18898 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 18899 | if (local_pProcessCommandsInfo) |
| 18900 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 18901 | transform_tohost_VkCmdProcessCommandsInfoNVX(mImpl->resources(), (VkCmdProcessCommandsInfoNVX*)(local_pProcessCommandsInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 18902 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18903 | countingStream->rewind(); |
| 18904 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18905 | uint64_t cgen_var_1269; |
| 18906 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1269, 1); |
| 18907 | countingStream->write((uint64_t*)&cgen_var_1269, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18908 | marshal_VkCmdProcessCommandsInfoNVX(countingStream, (VkCmdProcessCommandsInfoNVX*)(local_pProcessCommandsInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18909 | } |
| 18910 | uint32_t packetSize_vkCmdProcessCommandsNVX = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 18911 | countingStream->rewind(); |
| 18912 | uint32_t opcode_vkCmdProcessCommandsNVX = OP_vkCmdProcessCommandsNVX; |
| 18913 | stream->write(&opcode_vkCmdProcessCommandsNVX, sizeof(uint32_t)); |
| 18914 | stream->write(&packetSize_vkCmdProcessCommandsNVX, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18915 | uint64_t cgen_var_1270; |
| 18916 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1270, 1); |
| 18917 | stream->write((uint64_t*)&cgen_var_1270, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18918 | marshal_VkCmdProcessCommandsInfoNVX(stream, (VkCmdProcessCommandsInfoNVX*)(local_pProcessCommandsInfo)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 18919 | pool->freeAll(); |
| 18920 | countingStream->clearPool(); |
| 18921 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18922 | mImpl->log("finish vkCmdProcessCommandsNVX");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18923 | } |
| 18924 | |
| 18925 | void VkEncoder::vkCmdReserveSpaceForCommandsNVX( |
| 18926 | VkCommandBuffer commandBuffer, |
| 18927 | const VkCmdReserveSpaceForCommandsInfoNVX* pReserveSpaceInfo) |
| 18928 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 18929 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18930 | mImpl->log("start vkCmdReserveSpaceForCommandsNVX"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18931 | auto stream = mImpl->stream(); |
| 18932 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18933 | auto resources = mImpl->resources(); |
| 18934 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 18935 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18936 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18937 | VkCmdReserveSpaceForCommandsInfoNVX* local_pReserveSpaceInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 18938 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18939 | local_pReserveSpaceInfo = nullptr; |
| 18940 | if (pReserveSpaceInfo) |
| 18941 | { |
| 18942 | local_pReserveSpaceInfo = (VkCmdReserveSpaceForCommandsInfoNVX*)pool->alloc(sizeof(const VkCmdReserveSpaceForCommandsInfoNVX)); |
| 18943 | deepcopy_VkCmdReserveSpaceForCommandsInfoNVX(pool, pReserveSpaceInfo, (VkCmdReserveSpaceForCommandsInfoNVX*)(local_pReserveSpaceInfo)); |
| 18944 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 18945 | if (local_pReserveSpaceInfo) |
| 18946 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 18947 | transform_tohost_VkCmdReserveSpaceForCommandsInfoNVX(mImpl->resources(), (VkCmdReserveSpaceForCommandsInfoNVX*)(local_pReserveSpaceInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 18948 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18949 | countingStream->rewind(); |
| 18950 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18951 | uint64_t cgen_var_1271; |
| 18952 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1271, 1); |
| 18953 | countingStream->write((uint64_t*)&cgen_var_1271, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18954 | marshal_VkCmdReserveSpaceForCommandsInfoNVX(countingStream, (VkCmdReserveSpaceForCommandsInfoNVX*)(local_pReserveSpaceInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18955 | } |
| 18956 | uint32_t packetSize_vkCmdReserveSpaceForCommandsNVX = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 18957 | countingStream->rewind(); |
| 18958 | uint32_t opcode_vkCmdReserveSpaceForCommandsNVX = OP_vkCmdReserveSpaceForCommandsNVX; |
| 18959 | stream->write(&opcode_vkCmdReserveSpaceForCommandsNVX, sizeof(uint32_t)); |
| 18960 | stream->write(&packetSize_vkCmdReserveSpaceForCommandsNVX, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 18961 | uint64_t cgen_var_1272; |
| 18962 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1272, 1); |
| 18963 | stream->write((uint64_t*)&cgen_var_1272, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18964 | marshal_VkCmdReserveSpaceForCommandsInfoNVX(stream, (VkCmdReserveSpaceForCommandsInfoNVX*)(local_pReserveSpaceInfo)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 18965 | pool->freeAll(); |
| 18966 | countingStream->clearPool(); |
| 18967 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18968 | mImpl->log("finish vkCmdReserveSpaceForCommandsNVX");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18969 | } |
| 18970 | |
| 18971 | VkResult VkEncoder::vkCreateIndirectCommandsLayoutNVX( |
| 18972 | VkDevice device, |
| 18973 | const VkIndirectCommandsLayoutCreateInfoNVX* pCreateInfo, |
| 18974 | const VkAllocationCallbacks* pAllocator, |
| 18975 | VkIndirectCommandsLayoutNVX* pIndirectCommandsLayout) |
| 18976 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 18977 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 18978 | mImpl->log("start vkCreateIndirectCommandsLayoutNVX"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 18979 | auto stream = mImpl->stream(); |
| 18980 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18981 | auto resources = mImpl->resources(); |
| 18982 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 18983 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18984 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18985 | VkIndirectCommandsLayoutCreateInfoNVX* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 18986 | VkAllocationCallbacks* local_pAllocator; |
| 18987 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18988 | local_pCreateInfo = nullptr; |
| 18989 | if (pCreateInfo) |
| 18990 | { |
| 18991 | local_pCreateInfo = (VkIndirectCommandsLayoutCreateInfoNVX*)pool->alloc(sizeof(const VkIndirectCommandsLayoutCreateInfoNVX)); |
| 18992 | deepcopy_VkIndirectCommandsLayoutCreateInfoNVX(pool, pCreateInfo, (VkIndirectCommandsLayoutCreateInfoNVX*)(local_pCreateInfo)); |
| 18993 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 18994 | local_pAllocator = nullptr; |
| 18995 | if (pAllocator) |
| 18996 | { |
| 18997 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 18998 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 18999 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 19000 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 19001 | if (local_pCreateInfo) |
| 19002 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 19003 | transform_tohost_VkIndirectCommandsLayoutCreateInfoNVX(mImpl->resources(), (VkIndirectCommandsLayoutCreateInfoNVX*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 19004 | } |
| 19005 | if (local_pAllocator) |
| 19006 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 19007 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 19008 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19009 | countingStream->rewind(); |
| 19010 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19011 | uint64_t cgen_var_1273; |
| 19012 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1273, 1); |
| 19013 | countingStream->write((uint64_t*)&cgen_var_1273, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19014 | marshal_VkIndirectCommandsLayoutCreateInfoNVX(countingStream, (VkIndirectCommandsLayoutCreateInfoNVX*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 19015 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19016 | uint64_t cgen_var_1274 = (uint64_t)(uintptr_t)local_pAllocator; |
| 19017 | countingStream->putBe64(cgen_var_1274); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19018 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19019 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19020 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19021 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19022 | uint64_t cgen_var_1275; |
| 19023 | countingStream->handleMapping()->mapHandles_VkIndirectCommandsLayoutNVX_u64(pIndirectCommandsLayout, &cgen_var_1275, 1); |
| 19024 | countingStream->write((uint64_t*)&cgen_var_1275, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19025 | } |
| 19026 | uint32_t packetSize_vkCreateIndirectCommandsLayoutNVX = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 19027 | countingStream->rewind(); |
| 19028 | uint32_t opcode_vkCreateIndirectCommandsLayoutNVX = OP_vkCreateIndirectCommandsLayoutNVX; |
| 19029 | stream->write(&opcode_vkCreateIndirectCommandsLayoutNVX, sizeof(uint32_t)); |
| 19030 | stream->write(&packetSize_vkCreateIndirectCommandsLayoutNVX, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19031 | uint64_t cgen_var_1276; |
| 19032 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1276, 1); |
| 19033 | stream->write((uint64_t*)&cgen_var_1276, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19034 | marshal_VkIndirectCommandsLayoutCreateInfoNVX(stream, (VkIndirectCommandsLayoutCreateInfoNVX*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 19035 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19036 | uint64_t cgen_var_1277 = (uint64_t)(uintptr_t)local_pAllocator; |
| 19037 | stream->putBe64(cgen_var_1277); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19038 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19039 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19040 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19041 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19042 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19043 | uint64_t cgen_var_1278; |
| 19044 | stream->handleMapping()->mapHandles_VkIndirectCommandsLayoutNVX_u64(pIndirectCommandsLayout, &cgen_var_1278, 1); |
| 19045 | stream->write((uint64_t*)&cgen_var_1278, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19046 | stream->setHandleMapping(resources->unwrapMapping()); |
| 19047 | stream->setHandleMapping(resources->createMapping()); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19048 | uint64_t cgen_var_1279; |
| 19049 | stream->read((uint64_t*)&cgen_var_1279, 8); |
| 19050 | stream->handleMapping()->mapHandles_u64_VkIndirectCommandsLayoutNVX(&cgen_var_1279, (VkIndirectCommandsLayoutNVX*)pIndirectCommandsLayout, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19051 | stream->unsetHandleMapping(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19052 | VkResult vkCreateIndirectCommandsLayoutNVX_VkResult_return = (VkResult)0; |
| 19053 | stream->read(&vkCreateIndirectCommandsLayoutNVX_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 19054 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 19055 | countingStream->clearPool(); |
| 19056 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19057 | mImpl->log("finish vkCreateIndirectCommandsLayoutNVX");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19058 | return vkCreateIndirectCommandsLayoutNVX_VkResult_return; |
| 19059 | } |
| 19060 | |
| 19061 | void VkEncoder::vkDestroyIndirectCommandsLayoutNVX( |
| 19062 | VkDevice device, |
| 19063 | VkIndirectCommandsLayoutNVX indirectCommandsLayout, |
| 19064 | const VkAllocationCallbacks* pAllocator) |
| 19065 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 19066 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19067 | mImpl->log("start vkDestroyIndirectCommandsLayoutNVX"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19068 | auto stream = mImpl->stream(); |
| 19069 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19070 | auto resources = mImpl->resources(); |
| 19071 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19072 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19073 | VkDevice local_device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 19074 | VkIndirectCommandsLayoutNVX local_indirectCommandsLayout; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19075 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 19076 | local_device = device; |
| 19077 | local_indirectCommandsLayout = indirectCommandsLayout; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19078 | local_pAllocator = nullptr; |
| 19079 | if (pAllocator) |
| 19080 | { |
| 19081 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 19082 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 19083 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 19084 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 19085 | if (local_pAllocator) |
| 19086 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 19087 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 19088 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19089 | countingStream->rewind(); |
| 19090 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19091 | uint64_t cgen_var_1280; |
| 19092 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1280, 1); |
| 19093 | countingStream->write((uint64_t*)&cgen_var_1280, 1 * 8); |
| 19094 | uint64_t cgen_var_1281; |
| 19095 | countingStream->handleMapping()->mapHandles_VkIndirectCommandsLayoutNVX_u64(&local_indirectCommandsLayout, &cgen_var_1281, 1); |
| 19096 | countingStream->write((uint64_t*)&cgen_var_1281, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 19097 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19098 | uint64_t cgen_var_1282 = (uint64_t)(uintptr_t)local_pAllocator; |
| 19099 | countingStream->putBe64(cgen_var_1282); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19100 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19101 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19102 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19103 | } |
| 19104 | } |
| 19105 | uint32_t packetSize_vkDestroyIndirectCommandsLayoutNVX = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 19106 | countingStream->rewind(); |
| 19107 | uint32_t opcode_vkDestroyIndirectCommandsLayoutNVX = OP_vkDestroyIndirectCommandsLayoutNVX; |
| 19108 | stream->write(&opcode_vkDestroyIndirectCommandsLayoutNVX, sizeof(uint32_t)); |
| 19109 | stream->write(&packetSize_vkDestroyIndirectCommandsLayoutNVX, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19110 | uint64_t cgen_var_1283; |
| 19111 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1283, 1); |
| 19112 | stream->write((uint64_t*)&cgen_var_1283, 1 * 8); |
| 19113 | uint64_t cgen_var_1284; |
| 19114 | stream->handleMapping()->mapHandles_VkIndirectCommandsLayoutNVX_u64(&local_indirectCommandsLayout, &cgen_var_1284, 1); |
| 19115 | stream->write((uint64_t*)&cgen_var_1284, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 19116 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19117 | uint64_t cgen_var_1285 = (uint64_t)(uintptr_t)local_pAllocator; |
| 19118 | stream->putBe64(cgen_var_1285); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19119 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19120 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19121 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19122 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19123 | resources->destroyMapping()->mapHandles_VkIndirectCommandsLayoutNVX((VkIndirectCommandsLayoutNVX*)&indirectCommandsLayout); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 19124 | pool->freeAll(); |
| 19125 | countingStream->clearPool(); |
| 19126 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19127 | mImpl->log("finish vkDestroyIndirectCommandsLayoutNVX");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19128 | } |
| 19129 | |
| 19130 | VkResult VkEncoder::vkCreateObjectTableNVX( |
| 19131 | VkDevice device, |
| 19132 | const VkObjectTableCreateInfoNVX* pCreateInfo, |
| 19133 | const VkAllocationCallbacks* pAllocator, |
| 19134 | VkObjectTableNVX* pObjectTable) |
| 19135 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 19136 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19137 | mImpl->log("start vkCreateObjectTableNVX"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19138 | auto stream = mImpl->stream(); |
| 19139 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19140 | auto resources = mImpl->resources(); |
| 19141 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19142 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19143 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19144 | VkObjectTableCreateInfoNVX* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 19145 | VkAllocationCallbacks* local_pAllocator; |
| 19146 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19147 | local_pCreateInfo = nullptr; |
| 19148 | if (pCreateInfo) |
| 19149 | { |
| 19150 | local_pCreateInfo = (VkObjectTableCreateInfoNVX*)pool->alloc(sizeof(const VkObjectTableCreateInfoNVX)); |
| 19151 | deepcopy_VkObjectTableCreateInfoNVX(pool, pCreateInfo, (VkObjectTableCreateInfoNVX*)(local_pCreateInfo)); |
| 19152 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19153 | local_pAllocator = nullptr; |
| 19154 | if (pAllocator) |
| 19155 | { |
| 19156 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 19157 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 19158 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 19159 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 19160 | if (local_pCreateInfo) |
| 19161 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 19162 | transform_tohost_VkObjectTableCreateInfoNVX(mImpl->resources(), (VkObjectTableCreateInfoNVX*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 19163 | } |
| 19164 | if (local_pAllocator) |
| 19165 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 19166 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 19167 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19168 | countingStream->rewind(); |
| 19169 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19170 | uint64_t cgen_var_1286; |
| 19171 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1286, 1); |
| 19172 | countingStream->write((uint64_t*)&cgen_var_1286, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19173 | marshal_VkObjectTableCreateInfoNVX(countingStream, (VkObjectTableCreateInfoNVX*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 19174 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19175 | uint64_t cgen_var_1287 = (uint64_t)(uintptr_t)local_pAllocator; |
| 19176 | countingStream->putBe64(cgen_var_1287); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19177 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19178 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19179 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19180 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19181 | uint64_t cgen_var_1288; |
| 19182 | countingStream->handleMapping()->mapHandles_VkObjectTableNVX_u64(pObjectTable, &cgen_var_1288, 1); |
| 19183 | countingStream->write((uint64_t*)&cgen_var_1288, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19184 | } |
| 19185 | uint32_t packetSize_vkCreateObjectTableNVX = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 19186 | countingStream->rewind(); |
| 19187 | uint32_t opcode_vkCreateObjectTableNVX = OP_vkCreateObjectTableNVX; |
| 19188 | stream->write(&opcode_vkCreateObjectTableNVX, sizeof(uint32_t)); |
| 19189 | stream->write(&packetSize_vkCreateObjectTableNVX, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19190 | uint64_t cgen_var_1289; |
| 19191 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1289, 1); |
| 19192 | stream->write((uint64_t*)&cgen_var_1289, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19193 | marshal_VkObjectTableCreateInfoNVX(stream, (VkObjectTableCreateInfoNVX*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 19194 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19195 | uint64_t cgen_var_1290 = (uint64_t)(uintptr_t)local_pAllocator; |
| 19196 | stream->putBe64(cgen_var_1290); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19197 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19198 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19199 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19200 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19201 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19202 | uint64_t cgen_var_1291; |
| 19203 | stream->handleMapping()->mapHandles_VkObjectTableNVX_u64(pObjectTable, &cgen_var_1291, 1); |
| 19204 | stream->write((uint64_t*)&cgen_var_1291, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19205 | stream->setHandleMapping(resources->unwrapMapping()); |
| 19206 | stream->setHandleMapping(resources->createMapping()); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19207 | uint64_t cgen_var_1292; |
| 19208 | stream->read((uint64_t*)&cgen_var_1292, 8); |
| 19209 | stream->handleMapping()->mapHandles_u64_VkObjectTableNVX(&cgen_var_1292, (VkObjectTableNVX*)pObjectTable, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19210 | stream->unsetHandleMapping(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19211 | VkResult vkCreateObjectTableNVX_VkResult_return = (VkResult)0; |
| 19212 | stream->read(&vkCreateObjectTableNVX_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 19213 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 19214 | countingStream->clearPool(); |
| 19215 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19216 | mImpl->log("finish vkCreateObjectTableNVX");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19217 | return vkCreateObjectTableNVX_VkResult_return; |
| 19218 | } |
| 19219 | |
| 19220 | void VkEncoder::vkDestroyObjectTableNVX( |
| 19221 | VkDevice device, |
| 19222 | VkObjectTableNVX objectTable, |
| 19223 | const VkAllocationCallbacks* pAllocator) |
| 19224 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 19225 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19226 | mImpl->log("start vkDestroyObjectTableNVX"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19227 | auto stream = mImpl->stream(); |
| 19228 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19229 | auto resources = mImpl->resources(); |
| 19230 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19231 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19232 | VkDevice local_device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 19233 | VkObjectTableNVX local_objectTable; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19234 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 19235 | local_device = device; |
| 19236 | local_objectTable = objectTable; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19237 | local_pAllocator = nullptr; |
| 19238 | if (pAllocator) |
| 19239 | { |
| 19240 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 19241 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 19242 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 19243 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 19244 | if (local_pAllocator) |
| 19245 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 19246 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 19247 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19248 | countingStream->rewind(); |
| 19249 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19250 | uint64_t cgen_var_1293; |
| 19251 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1293, 1); |
| 19252 | countingStream->write((uint64_t*)&cgen_var_1293, 1 * 8); |
| 19253 | uint64_t cgen_var_1294; |
| 19254 | countingStream->handleMapping()->mapHandles_VkObjectTableNVX_u64(&local_objectTable, &cgen_var_1294, 1); |
| 19255 | countingStream->write((uint64_t*)&cgen_var_1294, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 19256 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19257 | uint64_t cgen_var_1295 = (uint64_t)(uintptr_t)local_pAllocator; |
| 19258 | countingStream->putBe64(cgen_var_1295); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19259 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19260 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19261 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19262 | } |
| 19263 | } |
| 19264 | uint32_t packetSize_vkDestroyObjectTableNVX = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 19265 | countingStream->rewind(); |
| 19266 | uint32_t opcode_vkDestroyObjectTableNVX = OP_vkDestroyObjectTableNVX; |
| 19267 | stream->write(&opcode_vkDestroyObjectTableNVX, sizeof(uint32_t)); |
| 19268 | stream->write(&packetSize_vkDestroyObjectTableNVX, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19269 | uint64_t cgen_var_1296; |
| 19270 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1296, 1); |
| 19271 | stream->write((uint64_t*)&cgen_var_1296, 1 * 8); |
| 19272 | uint64_t cgen_var_1297; |
| 19273 | stream->handleMapping()->mapHandles_VkObjectTableNVX_u64(&local_objectTable, &cgen_var_1297, 1); |
| 19274 | stream->write((uint64_t*)&cgen_var_1297, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 19275 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19276 | uint64_t cgen_var_1298 = (uint64_t)(uintptr_t)local_pAllocator; |
| 19277 | stream->putBe64(cgen_var_1298); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19278 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19279 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19280 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19281 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19282 | resources->destroyMapping()->mapHandles_VkObjectTableNVX((VkObjectTableNVX*)&objectTable); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 19283 | pool->freeAll(); |
| 19284 | countingStream->clearPool(); |
| 19285 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19286 | mImpl->log("finish vkDestroyObjectTableNVX");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19287 | } |
| 19288 | |
| 19289 | VkResult VkEncoder::vkRegisterObjectsNVX( |
| 19290 | VkDevice device, |
| 19291 | VkObjectTableNVX objectTable, |
| 19292 | uint32_t objectCount, |
| 19293 | const VkObjectTableEntryNVX* const* ppObjectTableEntries, |
| 19294 | const uint32_t* pObjectIndices) |
| 19295 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 19296 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19297 | mImpl->log("start vkRegisterObjectsNVX"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19298 | auto stream = mImpl->stream(); |
| 19299 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19300 | auto resources = mImpl->resources(); |
| 19301 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19302 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19303 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19304 | VkObjectTableNVX local_objectTable; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19305 | uint32_t local_objectCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19306 | VkObjectTableEntryNVX** local_ppObjectTableEntries; |
| 19307 | uint32_t* local_pObjectIndices; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 19308 | local_device = device; |
| 19309 | local_objectTable = objectTable; |
| 19310 | local_objectCount = objectCount; |
| 19311 | (void)ppObjectTableEntries; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19312 | local_pObjectIndices = nullptr; |
| 19313 | if (pObjectIndices) |
| 19314 | { |
| 19315 | local_pObjectIndices = (uint32_t*)pool->dupArray(pObjectIndices, ((objectCount)) * sizeof(const uint32_t)); |
| 19316 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 19317 | (void)local_ppObjectTableEntries; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19318 | countingStream->rewind(); |
| 19319 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19320 | uint64_t cgen_var_1299; |
| 19321 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1299, 1); |
| 19322 | countingStream->write((uint64_t*)&cgen_var_1299, 1 * 8); |
| 19323 | uint64_t cgen_var_1300; |
| 19324 | countingStream->handleMapping()->mapHandles_VkObjectTableNVX_u64(&local_objectTable, &cgen_var_1300, 1); |
| 19325 | countingStream->write((uint64_t*)&cgen_var_1300, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19326 | countingStream->write((uint32_t*)&local_objectCount, sizeof(uint32_t)); |
| Lingfeng Yang | 36891c5 | 2018-11-09 14:18:35 -0800 | [diff] [blame] | 19327 | (void)local_ppObjectTableEntries; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19328 | countingStream->write((uint32_t*)local_pObjectIndices, ((objectCount)) * sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19329 | } |
| 19330 | uint32_t packetSize_vkRegisterObjectsNVX = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 19331 | countingStream->rewind(); |
| 19332 | uint32_t opcode_vkRegisterObjectsNVX = OP_vkRegisterObjectsNVX; |
| 19333 | stream->write(&opcode_vkRegisterObjectsNVX, sizeof(uint32_t)); |
| 19334 | stream->write(&packetSize_vkRegisterObjectsNVX, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19335 | uint64_t cgen_var_1301; |
| 19336 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1301, 1); |
| 19337 | stream->write((uint64_t*)&cgen_var_1301, 1 * 8); |
| 19338 | uint64_t cgen_var_1302; |
| 19339 | stream->handleMapping()->mapHandles_VkObjectTableNVX_u64(&local_objectTable, &cgen_var_1302, 1); |
| 19340 | stream->write((uint64_t*)&cgen_var_1302, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19341 | stream->write((uint32_t*)&local_objectCount, sizeof(uint32_t)); |
| Lingfeng Yang | 36891c5 | 2018-11-09 14:18:35 -0800 | [diff] [blame] | 19342 | (void)local_ppObjectTableEntries; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19343 | stream->write((uint32_t*)local_pObjectIndices, ((objectCount)) * sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19344 | VkResult vkRegisterObjectsNVX_VkResult_return = (VkResult)0; |
| 19345 | stream->read(&vkRegisterObjectsNVX_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 19346 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 19347 | countingStream->clearPool(); |
| 19348 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19349 | mImpl->log("finish vkRegisterObjectsNVX");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19350 | return vkRegisterObjectsNVX_VkResult_return; |
| 19351 | } |
| 19352 | |
| 19353 | VkResult VkEncoder::vkUnregisterObjectsNVX( |
| 19354 | VkDevice device, |
| 19355 | VkObjectTableNVX objectTable, |
| 19356 | uint32_t objectCount, |
| 19357 | const VkObjectEntryTypeNVX* pObjectEntryTypes, |
| 19358 | const uint32_t* pObjectIndices) |
| 19359 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 19360 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19361 | mImpl->log("start vkUnregisterObjectsNVX"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19362 | auto stream = mImpl->stream(); |
| 19363 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19364 | auto resources = mImpl->resources(); |
| 19365 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19366 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19367 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19368 | VkObjectTableNVX local_objectTable; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19369 | uint32_t local_objectCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19370 | VkObjectEntryTypeNVX* local_pObjectEntryTypes; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 19371 | uint32_t* local_pObjectIndices; |
| 19372 | local_device = device; |
| 19373 | local_objectTable = objectTable; |
| 19374 | local_objectCount = objectCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19375 | local_pObjectEntryTypes = nullptr; |
| 19376 | if (pObjectEntryTypes) |
| 19377 | { |
| 19378 | local_pObjectEntryTypes = (VkObjectEntryTypeNVX*)pool->dupArray(pObjectEntryTypes, ((objectCount)) * sizeof(const VkObjectEntryTypeNVX)); |
| 19379 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19380 | local_pObjectIndices = nullptr; |
| 19381 | if (pObjectIndices) |
| 19382 | { |
| 19383 | local_pObjectIndices = (uint32_t*)pool->dupArray(pObjectIndices, ((objectCount)) * sizeof(const uint32_t)); |
| 19384 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19385 | countingStream->rewind(); |
| 19386 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19387 | uint64_t cgen_var_1303; |
| 19388 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1303, 1); |
| 19389 | countingStream->write((uint64_t*)&cgen_var_1303, 1 * 8); |
| 19390 | uint64_t cgen_var_1304; |
| 19391 | countingStream->handleMapping()->mapHandles_VkObjectTableNVX_u64(&local_objectTable, &cgen_var_1304, 1); |
| 19392 | countingStream->write((uint64_t*)&cgen_var_1304, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19393 | countingStream->write((uint32_t*)&local_objectCount, sizeof(uint32_t)); |
| 19394 | countingStream->write((VkObjectEntryTypeNVX*)local_pObjectEntryTypes, ((objectCount)) * sizeof(VkObjectEntryTypeNVX)); |
| 19395 | countingStream->write((uint32_t*)local_pObjectIndices, ((objectCount)) * sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19396 | } |
| 19397 | uint32_t packetSize_vkUnregisterObjectsNVX = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 19398 | countingStream->rewind(); |
| 19399 | uint32_t opcode_vkUnregisterObjectsNVX = OP_vkUnregisterObjectsNVX; |
| 19400 | stream->write(&opcode_vkUnregisterObjectsNVX, sizeof(uint32_t)); |
| 19401 | stream->write(&packetSize_vkUnregisterObjectsNVX, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19402 | uint64_t cgen_var_1305; |
| 19403 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1305, 1); |
| 19404 | stream->write((uint64_t*)&cgen_var_1305, 1 * 8); |
| 19405 | uint64_t cgen_var_1306; |
| 19406 | stream->handleMapping()->mapHandles_VkObjectTableNVX_u64(&local_objectTable, &cgen_var_1306, 1); |
| 19407 | stream->write((uint64_t*)&cgen_var_1306, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19408 | stream->write((uint32_t*)&local_objectCount, sizeof(uint32_t)); |
| 19409 | stream->write((VkObjectEntryTypeNVX*)local_pObjectEntryTypes, ((objectCount)) * sizeof(VkObjectEntryTypeNVX)); |
| 19410 | stream->write((uint32_t*)local_pObjectIndices, ((objectCount)) * sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19411 | VkResult vkUnregisterObjectsNVX_VkResult_return = (VkResult)0; |
| 19412 | stream->read(&vkUnregisterObjectsNVX_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 19413 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 19414 | countingStream->clearPool(); |
| 19415 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19416 | mImpl->log("finish vkUnregisterObjectsNVX");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19417 | return vkUnregisterObjectsNVX_VkResult_return; |
| 19418 | } |
| 19419 | |
| 19420 | void VkEncoder::vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX( |
| 19421 | VkPhysicalDevice physicalDevice, |
| 19422 | VkDeviceGeneratedCommandsFeaturesNVX* pFeatures, |
| 19423 | VkDeviceGeneratedCommandsLimitsNVX* pLimits) |
| 19424 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 19425 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19426 | mImpl->log("start vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19427 | auto stream = mImpl->stream(); |
| 19428 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19429 | auto resources = mImpl->resources(); |
| 19430 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19431 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19432 | VkPhysicalDevice local_physicalDevice; |
| 19433 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19434 | countingStream->rewind(); |
| 19435 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19436 | uint64_t cgen_var_1307; |
| 19437 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1307, 1); |
| 19438 | countingStream->write((uint64_t*)&cgen_var_1307, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19439 | marshal_VkDeviceGeneratedCommandsFeaturesNVX(countingStream, (VkDeviceGeneratedCommandsFeaturesNVX*)(pFeatures)); |
| 19440 | marshal_VkDeviceGeneratedCommandsLimitsNVX(countingStream, (VkDeviceGeneratedCommandsLimitsNVX*)(pLimits)); |
| 19441 | } |
| 19442 | uint32_t packetSize_vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 19443 | countingStream->rewind(); |
| 19444 | uint32_t opcode_vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX = OP_vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX; |
| 19445 | stream->write(&opcode_vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX, sizeof(uint32_t)); |
| 19446 | stream->write(&packetSize_vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19447 | uint64_t cgen_var_1308; |
| 19448 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1308, 1); |
| 19449 | stream->write((uint64_t*)&cgen_var_1308, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19450 | marshal_VkDeviceGeneratedCommandsFeaturesNVX(stream, (VkDeviceGeneratedCommandsFeaturesNVX*)(pFeatures)); |
| 19451 | marshal_VkDeviceGeneratedCommandsLimitsNVX(stream, (VkDeviceGeneratedCommandsLimitsNVX*)(pLimits)); |
| 19452 | unmarshal_VkDeviceGeneratedCommandsFeaturesNVX(stream, (VkDeviceGeneratedCommandsFeaturesNVX*)(pFeatures)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 19453 | if (pFeatures) |
| 19454 | { |
| 19455 | transform_fromhost_VkDeviceGeneratedCommandsFeaturesNVX(mImpl->resources(), (VkDeviceGeneratedCommandsFeaturesNVX*)(pFeatures)); |
| 19456 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19457 | unmarshal_VkDeviceGeneratedCommandsLimitsNVX(stream, (VkDeviceGeneratedCommandsLimitsNVX*)(pLimits)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 19458 | if (pLimits) |
| 19459 | { |
| 19460 | transform_fromhost_VkDeviceGeneratedCommandsLimitsNVX(mImpl->resources(), (VkDeviceGeneratedCommandsLimitsNVX*)(pLimits)); |
| 19461 | } |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 19462 | pool->freeAll(); |
| 19463 | countingStream->clearPool(); |
| 19464 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19465 | mImpl->log("finish vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19466 | } |
| 19467 | |
| 19468 | #endif |
| 19469 | #ifdef VK_NV_clip_space_w_scaling |
| 19470 | void VkEncoder::vkCmdSetViewportWScalingNV( |
| 19471 | VkCommandBuffer commandBuffer, |
| 19472 | uint32_t firstViewport, |
| 19473 | uint32_t viewportCount, |
| 19474 | const VkViewportWScalingNV* pViewportWScalings) |
| 19475 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 19476 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19477 | mImpl->log("start vkCmdSetViewportWScalingNV"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19478 | auto stream = mImpl->stream(); |
| 19479 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19480 | auto resources = mImpl->resources(); |
| 19481 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19482 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19483 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19484 | uint32_t local_firstViewport; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19485 | uint32_t local_viewportCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19486 | VkViewportWScalingNV* local_pViewportWScalings; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 19487 | local_commandBuffer = commandBuffer; |
| 19488 | local_firstViewport = firstViewport; |
| 19489 | local_viewportCount = viewportCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19490 | local_pViewportWScalings = nullptr; |
| 19491 | if (pViewportWScalings) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19492 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19493 | local_pViewportWScalings = (VkViewportWScalingNV*)pool->alloc(((viewportCount)) * sizeof(const VkViewportWScalingNV)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19494 | for (uint32_t i = 0; i < (uint32_t)((viewportCount)); ++i) |
| 19495 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19496 | deepcopy_VkViewportWScalingNV(pool, pViewportWScalings + i, (VkViewportWScalingNV*)(local_pViewportWScalings + i)); |
| 19497 | } |
| 19498 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 19499 | if (local_pViewportWScalings) |
| 19500 | { |
| 19501 | for (uint32_t i = 0; i < (uint32_t)((viewportCount)); ++i) |
| 19502 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 19503 | transform_tohost_VkViewportWScalingNV(mImpl->resources(), (VkViewportWScalingNV*)(local_pViewportWScalings + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 19504 | } |
| 19505 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19506 | countingStream->rewind(); |
| 19507 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19508 | uint64_t cgen_var_1309; |
| 19509 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1309, 1); |
| 19510 | countingStream->write((uint64_t*)&cgen_var_1309, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19511 | countingStream->write((uint32_t*)&local_firstViewport, sizeof(uint32_t)); |
| 19512 | countingStream->write((uint32_t*)&local_viewportCount, sizeof(uint32_t)); |
| 19513 | for (uint32_t i = 0; i < (uint32_t)((viewportCount)); ++i) |
| 19514 | { |
| 19515 | marshal_VkViewportWScalingNV(countingStream, (VkViewportWScalingNV*)(local_pViewportWScalings + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19516 | } |
| 19517 | } |
| 19518 | uint32_t packetSize_vkCmdSetViewportWScalingNV = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 19519 | countingStream->rewind(); |
| 19520 | uint32_t opcode_vkCmdSetViewportWScalingNV = OP_vkCmdSetViewportWScalingNV; |
| 19521 | stream->write(&opcode_vkCmdSetViewportWScalingNV, sizeof(uint32_t)); |
| 19522 | stream->write(&packetSize_vkCmdSetViewportWScalingNV, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19523 | uint64_t cgen_var_1310; |
| 19524 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1310, 1); |
| 19525 | stream->write((uint64_t*)&cgen_var_1310, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19526 | stream->write((uint32_t*)&local_firstViewport, sizeof(uint32_t)); |
| 19527 | stream->write((uint32_t*)&local_viewportCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19528 | for (uint32_t i = 0; i < (uint32_t)((viewportCount)); ++i) |
| 19529 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19530 | marshal_VkViewportWScalingNV(stream, (VkViewportWScalingNV*)(local_pViewportWScalings + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19531 | } |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 19532 | pool->freeAll(); |
| 19533 | countingStream->clearPool(); |
| 19534 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19535 | mImpl->log("finish vkCmdSetViewportWScalingNV");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19536 | } |
| 19537 | |
| 19538 | #endif |
| 19539 | #ifdef VK_EXT_direct_mode_display |
| 19540 | VkResult VkEncoder::vkReleaseDisplayEXT( |
| 19541 | VkPhysicalDevice physicalDevice, |
| 19542 | VkDisplayKHR display) |
| 19543 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 19544 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19545 | mImpl->log("start vkReleaseDisplayEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19546 | auto stream = mImpl->stream(); |
| 19547 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19548 | auto resources = mImpl->resources(); |
| 19549 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19550 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19551 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19552 | VkDisplayKHR local_display; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 19553 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19554 | local_display = display; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19555 | countingStream->rewind(); |
| 19556 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19557 | uint64_t cgen_var_1311; |
| 19558 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1311, 1); |
| 19559 | countingStream->write((uint64_t*)&cgen_var_1311, 1 * 8); |
| 19560 | uint64_t cgen_var_1312; |
| 19561 | countingStream->handleMapping()->mapHandles_VkDisplayKHR_u64(&local_display, &cgen_var_1312, 1); |
| 19562 | countingStream->write((uint64_t*)&cgen_var_1312, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19563 | } |
| 19564 | uint32_t packetSize_vkReleaseDisplayEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 19565 | countingStream->rewind(); |
| 19566 | uint32_t opcode_vkReleaseDisplayEXT = OP_vkReleaseDisplayEXT; |
| 19567 | stream->write(&opcode_vkReleaseDisplayEXT, sizeof(uint32_t)); |
| 19568 | stream->write(&packetSize_vkReleaseDisplayEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19569 | uint64_t cgen_var_1313; |
| 19570 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1313, 1); |
| 19571 | stream->write((uint64_t*)&cgen_var_1313, 1 * 8); |
| 19572 | uint64_t cgen_var_1314; |
| 19573 | stream->handleMapping()->mapHandles_VkDisplayKHR_u64(&local_display, &cgen_var_1314, 1); |
| 19574 | stream->write((uint64_t*)&cgen_var_1314, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19575 | VkResult vkReleaseDisplayEXT_VkResult_return = (VkResult)0; |
| 19576 | stream->read(&vkReleaseDisplayEXT_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 19577 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 19578 | countingStream->clearPool(); |
| 19579 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19580 | mImpl->log("finish vkReleaseDisplayEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19581 | return vkReleaseDisplayEXT_VkResult_return; |
| 19582 | } |
| 19583 | |
| 19584 | #endif |
| 19585 | #ifdef VK_EXT_acquire_xlib_display |
| 19586 | VkResult VkEncoder::vkAcquireXlibDisplayEXT( |
| 19587 | VkPhysicalDevice physicalDevice, |
| 19588 | Display* dpy, |
| 19589 | VkDisplayKHR display) |
| 19590 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 19591 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19592 | mImpl->log("start vkAcquireXlibDisplayEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19593 | auto stream = mImpl->stream(); |
| 19594 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19595 | auto resources = mImpl->resources(); |
| 19596 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19597 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19598 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19599 | VkDisplayKHR local_display; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 19600 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19601 | local_display = display; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19602 | countingStream->rewind(); |
| 19603 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19604 | uint64_t cgen_var_1315; |
| 19605 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1315, 1); |
| 19606 | countingStream->write((uint64_t*)&cgen_var_1315, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19607 | countingStream->write((Display*)dpy, sizeof(Display)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19608 | uint64_t cgen_var_1316; |
| 19609 | countingStream->handleMapping()->mapHandles_VkDisplayKHR_u64(&local_display, &cgen_var_1316, 1); |
| 19610 | countingStream->write((uint64_t*)&cgen_var_1316, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19611 | } |
| 19612 | uint32_t packetSize_vkAcquireXlibDisplayEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 19613 | countingStream->rewind(); |
| 19614 | uint32_t opcode_vkAcquireXlibDisplayEXT = OP_vkAcquireXlibDisplayEXT; |
| 19615 | stream->write(&opcode_vkAcquireXlibDisplayEXT, sizeof(uint32_t)); |
| 19616 | stream->write(&packetSize_vkAcquireXlibDisplayEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19617 | uint64_t cgen_var_1317; |
| 19618 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1317, 1); |
| 19619 | stream->write((uint64_t*)&cgen_var_1317, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19620 | stream->write((Display*)dpy, sizeof(Display)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19621 | uint64_t cgen_var_1318; |
| 19622 | stream->handleMapping()->mapHandles_VkDisplayKHR_u64(&local_display, &cgen_var_1318, 1); |
| 19623 | stream->write((uint64_t*)&cgen_var_1318, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19624 | stream->read((Display*)dpy, sizeof(Display)); |
| 19625 | VkResult vkAcquireXlibDisplayEXT_VkResult_return = (VkResult)0; |
| 19626 | stream->read(&vkAcquireXlibDisplayEXT_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 19627 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 19628 | countingStream->clearPool(); |
| 19629 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19630 | mImpl->log("finish vkAcquireXlibDisplayEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19631 | return vkAcquireXlibDisplayEXT_VkResult_return; |
| 19632 | } |
| 19633 | |
| 19634 | VkResult VkEncoder::vkGetRandROutputDisplayEXT( |
| 19635 | VkPhysicalDevice physicalDevice, |
| 19636 | Display* dpy, |
| 19637 | RROutput rrOutput, |
| 19638 | VkDisplayKHR* pDisplay) |
| 19639 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 19640 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19641 | mImpl->log("start vkGetRandROutputDisplayEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19642 | auto stream = mImpl->stream(); |
| 19643 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19644 | auto resources = mImpl->resources(); |
| 19645 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19646 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19647 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19648 | RROutput local_rrOutput; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 19649 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19650 | local_rrOutput = rrOutput; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19651 | countingStream->rewind(); |
| 19652 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19653 | uint64_t cgen_var_1319; |
| 19654 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1319, 1); |
| 19655 | countingStream->write((uint64_t*)&cgen_var_1319, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19656 | countingStream->write((Display*)dpy, sizeof(Display)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19657 | countingStream->write((RROutput*)&local_rrOutput, sizeof(RROutput)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19658 | uint64_t cgen_var_1320; |
| 19659 | countingStream->handleMapping()->mapHandles_VkDisplayKHR_u64(pDisplay, &cgen_var_1320, 1); |
| 19660 | countingStream->write((uint64_t*)&cgen_var_1320, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19661 | } |
| 19662 | uint32_t packetSize_vkGetRandROutputDisplayEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 19663 | countingStream->rewind(); |
| 19664 | uint32_t opcode_vkGetRandROutputDisplayEXT = OP_vkGetRandROutputDisplayEXT; |
| 19665 | stream->write(&opcode_vkGetRandROutputDisplayEXT, sizeof(uint32_t)); |
| 19666 | stream->write(&packetSize_vkGetRandROutputDisplayEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19667 | uint64_t cgen_var_1321; |
| 19668 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1321, 1); |
| 19669 | stream->write((uint64_t*)&cgen_var_1321, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19670 | stream->write((Display*)dpy, sizeof(Display)); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19671 | stream->write((RROutput*)&local_rrOutput, sizeof(RROutput)); |
| 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_1322; |
| 19674 | stream->handleMapping()->mapHandles_VkDisplayKHR_u64(pDisplay, &cgen_var_1322, 1); |
| 19675 | stream->write((uint64_t*)&cgen_var_1322, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19676 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19677 | stream->read((Display*)dpy, sizeof(Display)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19678 | uint64_t cgen_var_1323; |
| 19679 | stream->read((uint64_t*)&cgen_var_1323, 8); |
| 19680 | stream->handleMapping()->mapHandles_u64_VkDisplayKHR(&cgen_var_1323, (VkDisplayKHR*)pDisplay, 1); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19681 | VkResult vkGetRandROutputDisplayEXT_VkResult_return = (VkResult)0; |
| 19682 | stream->read(&vkGetRandROutputDisplayEXT_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 19683 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 19684 | countingStream->clearPool(); |
| 19685 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19686 | mImpl->log("finish vkGetRandROutputDisplayEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19687 | return vkGetRandROutputDisplayEXT_VkResult_return; |
| 19688 | } |
| 19689 | |
| 19690 | #endif |
| 19691 | #ifdef VK_EXT_display_surface_counter |
| 19692 | VkResult VkEncoder::vkGetPhysicalDeviceSurfaceCapabilities2EXT( |
| 19693 | VkPhysicalDevice physicalDevice, |
| 19694 | VkSurfaceKHR surface, |
| 19695 | VkSurfaceCapabilities2EXT* pSurfaceCapabilities) |
| 19696 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 19697 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19698 | mImpl->log("start vkGetPhysicalDeviceSurfaceCapabilities2EXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19699 | auto stream = mImpl->stream(); |
| 19700 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19701 | auto resources = mImpl->resources(); |
| 19702 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19703 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19704 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19705 | VkSurfaceKHR local_surface; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 19706 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19707 | local_surface = surface; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19708 | countingStream->rewind(); |
| 19709 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19710 | uint64_t cgen_var_1324; |
| 19711 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1324, 1); |
| 19712 | countingStream->write((uint64_t*)&cgen_var_1324, 1 * 8); |
| 19713 | uint64_t cgen_var_1325; |
| 19714 | countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(&local_surface, &cgen_var_1325, 1); |
| 19715 | countingStream->write((uint64_t*)&cgen_var_1325, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19716 | marshal_VkSurfaceCapabilities2EXT(countingStream, (VkSurfaceCapabilities2EXT*)(pSurfaceCapabilities)); |
| 19717 | } |
| 19718 | uint32_t packetSize_vkGetPhysicalDeviceSurfaceCapabilities2EXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 19719 | countingStream->rewind(); |
| 19720 | uint32_t opcode_vkGetPhysicalDeviceSurfaceCapabilities2EXT = OP_vkGetPhysicalDeviceSurfaceCapabilities2EXT; |
| 19721 | stream->write(&opcode_vkGetPhysicalDeviceSurfaceCapabilities2EXT, sizeof(uint32_t)); |
| 19722 | stream->write(&packetSize_vkGetPhysicalDeviceSurfaceCapabilities2EXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19723 | uint64_t cgen_var_1326; |
| 19724 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1326, 1); |
| 19725 | stream->write((uint64_t*)&cgen_var_1326, 1 * 8); |
| 19726 | uint64_t cgen_var_1327; |
| 19727 | stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(&local_surface, &cgen_var_1327, 1); |
| 19728 | stream->write((uint64_t*)&cgen_var_1327, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19729 | marshal_VkSurfaceCapabilities2EXT(stream, (VkSurfaceCapabilities2EXT*)(pSurfaceCapabilities)); |
| 19730 | unmarshal_VkSurfaceCapabilities2EXT(stream, (VkSurfaceCapabilities2EXT*)(pSurfaceCapabilities)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 19731 | if (pSurfaceCapabilities) |
| 19732 | { |
| 19733 | transform_fromhost_VkSurfaceCapabilities2EXT(mImpl->resources(), (VkSurfaceCapabilities2EXT*)(pSurfaceCapabilities)); |
| 19734 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19735 | VkResult vkGetPhysicalDeviceSurfaceCapabilities2EXT_VkResult_return = (VkResult)0; |
| 19736 | stream->read(&vkGetPhysicalDeviceSurfaceCapabilities2EXT_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 19737 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 19738 | countingStream->clearPool(); |
| 19739 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19740 | mImpl->log("finish vkGetPhysicalDeviceSurfaceCapabilities2EXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19741 | return vkGetPhysicalDeviceSurfaceCapabilities2EXT_VkResult_return; |
| 19742 | } |
| 19743 | |
| 19744 | #endif |
| 19745 | #ifdef VK_EXT_display_control |
| 19746 | VkResult VkEncoder::vkDisplayPowerControlEXT( |
| 19747 | VkDevice device, |
| 19748 | VkDisplayKHR display, |
| 19749 | const VkDisplayPowerInfoEXT* pDisplayPowerInfo) |
| 19750 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 19751 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19752 | mImpl->log("start vkDisplayPowerControlEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19753 | auto stream = mImpl->stream(); |
| 19754 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19755 | auto resources = mImpl->resources(); |
| 19756 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19757 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19758 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19759 | VkDisplayKHR local_display; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19760 | VkDisplayPowerInfoEXT* local_pDisplayPowerInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 19761 | local_device = device; |
| 19762 | local_display = display; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19763 | local_pDisplayPowerInfo = nullptr; |
| 19764 | if (pDisplayPowerInfo) |
| 19765 | { |
| 19766 | local_pDisplayPowerInfo = (VkDisplayPowerInfoEXT*)pool->alloc(sizeof(const VkDisplayPowerInfoEXT)); |
| 19767 | deepcopy_VkDisplayPowerInfoEXT(pool, pDisplayPowerInfo, (VkDisplayPowerInfoEXT*)(local_pDisplayPowerInfo)); |
| 19768 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 19769 | if (local_pDisplayPowerInfo) |
| 19770 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 19771 | transform_tohost_VkDisplayPowerInfoEXT(mImpl->resources(), (VkDisplayPowerInfoEXT*)(local_pDisplayPowerInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 19772 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19773 | countingStream->rewind(); |
| 19774 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19775 | uint64_t cgen_var_1328; |
| 19776 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1328, 1); |
| 19777 | countingStream->write((uint64_t*)&cgen_var_1328, 1 * 8); |
| 19778 | uint64_t cgen_var_1329; |
| 19779 | countingStream->handleMapping()->mapHandles_VkDisplayKHR_u64(&local_display, &cgen_var_1329, 1); |
| 19780 | countingStream->write((uint64_t*)&cgen_var_1329, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19781 | marshal_VkDisplayPowerInfoEXT(countingStream, (VkDisplayPowerInfoEXT*)(local_pDisplayPowerInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19782 | } |
| 19783 | uint32_t packetSize_vkDisplayPowerControlEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 19784 | countingStream->rewind(); |
| 19785 | uint32_t opcode_vkDisplayPowerControlEXT = OP_vkDisplayPowerControlEXT; |
| 19786 | stream->write(&opcode_vkDisplayPowerControlEXT, sizeof(uint32_t)); |
| 19787 | stream->write(&packetSize_vkDisplayPowerControlEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19788 | uint64_t cgen_var_1330; |
| 19789 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1330, 1); |
| 19790 | stream->write((uint64_t*)&cgen_var_1330, 1 * 8); |
| 19791 | uint64_t cgen_var_1331; |
| 19792 | stream->handleMapping()->mapHandles_VkDisplayKHR_u64(&local_display, &cgen_var_1331, 1); |
| 19793 | stream->write((uint64_t*)&cgen_var_1331, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19794 | marshal_VkDisplayPowerInfoEXT(stream, (VkDisplayPowerInfoEXT*)(local_pDisplayPowerInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19795 | VkResult vkDisplayPowerControlEXT_VkResult_return = (VkResult)0; |
| 19796 | stream->read(&vkDisplayPowerControlEXT_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 19797 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 19798 | countingStream->clearPool(); |
| 19799 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19800 | mImpl->log("finish vkDisplayPowerControlEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19801 | return vkDisplayPowerControlEXT_VkResult_return; |
| 19802 | } |
| 19803 | |
| 19804 | VkResult VkEncoder::vkRegisterDeviceEventEXT( |
| 19805 | VkDevice device, |
| 19806 | const VkDeviceEventInfoEXT* pDeviceEventInfo, |
| 19807 | const VkAllocationCallbacks* pAllocator, |
| 19808 | VkFence* pFence) |
| 19809 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 19810 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19811 | mImpl->log("start vkRegisterDeviceEventEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19812 | auto stream = mImpl->stream(); |
| 19813 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19814 | auto resources = mImpl->resources(); |
| 19815 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19816 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19817 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19818 | VkDeviceEventInfoEXT* local_pDeviceEventInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 19819 | VkAllocationCallbacks* local_pAllocator; |
| 19820 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19821 | local_pDeviceEventInfo = nullptr; |
| 19822 | if (pDeviceEventInfo) |
| 19823 | { |
| 19824 | local_pDeviceEventInfo = (VkDeviceEventInfoEXT*)pool->alloc(sizeof(const VkDeviceEventInfoEXT)); |
| 19825 | deepcopy_VkDeviceEventInfoEXT(pool, pDeviceEventInfo, (VkDeviceEventInfoEXT*)(local_pDeviceEventInfo)); |
| 19826 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19827 | local_pAllocator = nullptr; |
| 19828 | if (pAllocator) |
| 19829 | { |
| 19830 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 19831 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 19832 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 19833 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 19834 | if (local_pDeviceEventInfo) |
| 19835 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 19836 | transform_tohost_VkDeviceEventInfoEXT(mImpl->resources(), (VkDeviceEventInfoEXT*)(local_pDeviceEventInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 19837 | } |
| 19838 | if (local_pAllocator) |
| 19839 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 19840 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 19841 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19842 | countingStream->rewind(); |
| 19843 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19844 | uint64_t cgen_var_1332; |
| 19845 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1332, 1); |
| 19846 | countingStream->write((uint64_t*)&cgen_var_1332, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19847 | marshal_VkDeviceEventInfoEXT(countingStream, (VkDeviceEventInfoEXT*)(local_pDeviceEventInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 19848 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19849 | uint64_t cgen_var_1333 = (uint64_t)(uintptr_t)local_pAllocator; |
| 19850 | countingStream->putBe64(cgen_var_1333); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19851 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19852 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19853 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19854 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19855 | uint64_t cgen_var_1334; |
| 19856 | countingStream->handleMapping()->mapHandles_VkFence_u64(pFence, &cgen_var_1334, 1); |
| 19857 | countingStream->write((uint64_t*)&cgen_var_1334, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19858 | } |
| 19859 | uint32_t packetSize_vkRegisterDeviceEventEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 19860 | countingStream->rewind(); |
| 19861 | uint32_t opcode_vkRegisterDeviceEventEXT = OP_vkRegisterDeviceEventEXT; |
| 19862 | stream->write(&opcode_vkRegisterDeviceEventEXT, sizeof(uint32_t)); |
| 19863 | stream->write(&packetSize_vkRegisterDeviceEventEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19864 | uint64_t cgen_var_1335; |
| 19865 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1335, 1); |
| 19866 | stream->write((uint64_t*)&cgen_var_1335, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19867 | marshal_VkDeviceEventInfoEXT(stream, (VkDeviceEventInfoEXT*)(local_pDeviceEventInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 19868 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19869 | uint64_t cgen_var_1336 = (uint64_t)(uintptr_t)local_pAllocator; |
| 19870 | stream->putBe64(cgen_var_1336); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19871 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19872 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19873 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19874 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19875 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19876 | uint64_t cgen_var_1337; |
| 19877 | stream->handleMapping()->mapHandles_VkFence_u64(pFence, &cgen_var_1337, 1); |
| 19878 | stream->write((uint64_t*)&cgen_var_1337, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19879 | stream->setHandleMapping(resources->unwrapMapping()); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19880 | uint64_t cgen_var_1338; |
| 19881 | stream->read((uint64_t*)&cgen_var_1338, 8); |
| 19882 | stream->handleMapping()->mapHandles_u64_VkFence(&cgen_var_1338, (VkFence*)pFence, 1); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19883 | VkResult vkRegisterDeviceEventEXT_VkResult_return = (VkResult)0; |
| 19884 | stream->read(&vkRegisterDeviceEventEXT_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 19885 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 19886 | countingStream->clearPool(); |
| 19887 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19888 | mImpl->log("finish vkRegisterDeviceEventEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19889 | return vkRegisterDeviceEventEXT_VkResult_return; |
| 19890 | } |
| 19891 | |
| 19892 | VkResult VkEncoder::vkRegisterDisplayEventEXT( |
| 19893 | VkDevice device, |
| 19894 | VkDisplayKHR display, |
| 19895 | const VkDisplayEventInfoEXT* pDisplayEventInfo, |
| 19896 | const VkAllocationCallbacks* pAllocator, |
| 19897 | VkFence* pFence) |
| 19898 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 19899 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19900 | mImpl->log("start vkRegisterDisplayEventEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19901 | auto stream = mImpl->stream(); |
| 19902 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19903 | auto resources = mImpl->resources(); |
| 19904 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19905 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19906 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19907 | VkDisplayKHR local_display; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19908 | VkDisplayEventInfoEXT* local_pDisplayEventInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 19909 | VkAllocationCallbacks* local_pAllocator; |
| 19910 | local_device = device; |
| 19911 | local_display = display; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19912 | local_pDisplayEventInfo = nullptr; |
| 19913 | if (pDisplayEventInfo) |
| 19914 | { |
| 19915 | local_pDisplayEventInfo = (VkDisplayEventInfoEXT*)pool->alloc(sizeof(const VkDisplayEventInfoEXT)); |
| 19916 | deepcopy_VkDisplayEventInfoEXT(pool, pDisplayEventInfo, (VkDisplayEventInfoEXT*)(local_pDisplayEventInfo)); |
| 19917 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19918 | local_pAllocator = nullptr; |
| 19919 | if (pAllocator) |
| 19920 | { |
| 19921 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 19922 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 19923 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 19924 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 19925 | if (local_pDisplayEventInfo) |
| 19926 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 19927 | transform_tohost_VkDisplayEventInfoEXT(mImpl->resources(), (VkDisplayEventInfoEXT*)(local_pDisplayEventInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 19928 | } |
| 19929 | if (local_pAllocator) |
| 19930 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 19931 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 19932 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19933 | countingStream->rewind(); |
| 19934 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19935 | uint64_t cgen_var_1339; |
| 19936 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1339, 1); |
| 19937 | countingStream->write((uint64_t*)&cgen_var_1339, 1 * 8); |
| 19938 | uint64_t cgen_var_1340; |
| 19939 | countingStream->handleMapping()->mapHandles_VkDisplayKHR_u64(&local_display, &cgen_var_1340, 1); |
| 19940 | countingStream->write((uint64_t*)&cgen_var_1340, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19941 | marshal_VkDisplayEventInfoEXT(countingStream, (VkDisplayEventInfoEXT*)(local_pDisplayEventInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 19942 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19943 | uint64_t cgen_var_1341 = (uint64_t)(uintptr_t)local_pAllocator; |
| 19944 | countingStream->putBe64(cgen_var_1341); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19945 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19946 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19947 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19948 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19949 | uint64_t cgen_var_1342; |
| 19950 | countingStream->handleMapping()->mapHandles_VkFence_u64(pFence, &cgen_var_1342, 1); |
| 19951 | countingStream->write((uint64_t*)&cgen_var_1342, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19952 | } |
| 19953 | uint32_t packetSize_vkRegisterDisplayEventEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 19954 | countingStream->rewind(); |
| 19955 | uint32_t opcode_vkRegisterDisplayEventEXT = OP_vkRegisterDisplayEventEXT; |
| 19956 | stream->write(&opcode_vkRegisterDisplayEventEXT, sizeof(uint32_t)); |
| 19957 | stream->write(&packetSize_vkRegisterDisplayEventEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19958 | uint64_t cgen_var_1343; |
| 19959 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1343, 1); |
| 19960 | stream->write((uint64_t*)&cgen_var_1343, 1 * 8); |
| 19961 | uint64_t cgen_var_1344; |
| 19962 | stream->handleMapping()->mapHandles_VkDisplayKHR_u64(&local_display, &cgen_var_1344, 1); |
| 19963 | stream->write((uint64_t*)&cgen_var_1344, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19964 | marshal_VkDisplayEventInfoEXT(stream, (VkDisplayEventInfoEXT*)(local_pDisplayEventInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 19965 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19966 | uint64_t cgen_var_1345 = (uint64_t)(uintptr_t)local_pAllocator; |
| 19967 | stream->putBe64(cgen_var_1345); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19968 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19969 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19970 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19971 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19972 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19973 | uint64_t cgen_var_1346; |
| 19974 | stream->handleMapping()->mapHandles_VkFence_u64(pFence, &cgen_var_1346, 1); |
| 19975 | stream->write((uint64_t*)&cgen_var_1346, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 19976 | stream->setHandleMapping(resources->unwrapMapping()); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 19977 | uint64_t cgen_var_1347; |
| 19978 | stream->read((uint64_t*)&cgen_var_1347, 8); |
| 19979 | stream->handleMapping()->mapHandles_u64_VkFence(&cgen_var_1347, (VkFence*)pFence, 1); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19980 | VkResult vkRegisterDisplayEventEXT_VkResult_return = (VkResult)0; |
| 19981 | stream->read(&vkRegisterDisplayEventEXT_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 19982 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 19983 | countingStream->clearPool(); |
| 19984 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19985 | mImpl->log("finish vkRegisterDisplayEventEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19986 | return vkRegisterDisplayEventEXT_VkResult_return; |
| 19987 | } |
| 19988 | |
| 19989 | VkResult VkEncoder::vkGetSwapchainCounterEXT( |
| 19990 | VkDevice device, |
| 19991 | VkSwapchainKHR swapchain, |
| 19992 | VkSurfaceCounterFlagBitsEXT counter, |
| 19993 | uint64_t* pCounterValue) |
| 19994 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 19995 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 19996 | mImpl->log("start vkGetSwapchainCounterEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 19997 | auto stream = mImpl->stream(); |
| 19998 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 19999 | auto resources = mImpl->resources(); |
| 20000 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20001 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20002 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20003 | VkSwapchainKHR local_swapchain; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20004 | VkSurfaceCounterFlagBitsEXT local_counter; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 20005 | local_device = device; |
| 20006 | local_swapchain = swapchain; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20007 | local_counter = counter; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20008 | countingStream->rewind(); |
| 20009 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20010 | uint64_t cgen_var_1348; |
| 20011 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1348, 1); |
| 20012 | countingStream->write((uint64_t*)&cgen_var_1348, 1 * 8); |
| 20013 | uint64_t cgen_var_1349; |
| 20014 | countingStream->handleMapping()->mapHandles_VkSwapchainKHR_u64(&local_swapchain, &cgen_var_1349, 1); |
| 20015 | countingStream->write((uint64_t*)&cgen_var_1349, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20016 | countingStream->write((VkSurfaceCounterFlagBitsEXT*)&local_counter, sizeof(VkSurfaceCounterFlagBitsEXT)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20017 | countingStream->write((uint64_t*)pCounterValue, sizeof(uint64_t)); |
| 20018 | } |
| 20019 | uint32_t packetSize_vkGetSwapchainCounterEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 20020 | countingStream->rewind(); |
| 20021 | uint32_t opcode_vkGetSwapchainCounterEXT = OP_vkGetSwapchainCounterEXT; |
| 20022 | stream->write(&opcode_vkGetSwapchainCounterEXT, sizeof(uint32_t)); |
| 20023 | stream->write(&packetSize_vkGetSwapchainCounterEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20024 | uint64_t cgen_var_1350; |
| 20025 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1350, 1); |
| 20026 | stream->write((uint64_t*)&cgen_var_1350, 1 * 8); |
| 20027 | uint64_t cgen_var_1351; |
| 20028 | stream->handleMapping()->mapHandles_VkSwapchainKHR_u64(&local_swapchain, &cgen_var_1351, 1); |
| 20029 | stream->write((uint64_t*)&cgen_var_1351, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20030 | stream->write((VkSurfaceCounterFlagBitsEXT*)&local_counter, sizeof(VkSurfaceCounterFlagBitsEXT)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20031 | stream->write((uint64_t*)pCounterValue, sizeof(uint64_t)); |
| 20032 | stream->read((uint64_t*)pCounterValue, sizeof(uint64_t)); |
| 20033 | VkResult vkGetSwapchainCounterEXT_VkResult_return = (VkResult)0; |
| 20034 | stream->read(&vkGetSwapchainCounterEXT_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 20035 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 20036 | countingStream->clearPool(); |
| 20037 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20038 | mImpl->log("finish vkGetSwapchainCounterEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20039 | return vkGetSwapchainCounterEXT_VkResult_return; |
| 20040 | } |
| 20041 | |
| 20042 | #endif |
| 20043 | #ifdef VK_GOOGLE_display_timing |
| 20044 | VkResult VkEncoder::vkGetRefreshCycleDurationGOOGLE( |
| 20045 | VkDevice device, |
| 20046 | VkSwapchainKHR swapchain, |
| 20047 | VkRefreshCycleDurationGOOGLE* pDisplayTimingProperties) |
| 20048 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 20049 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20050 | mImpl->log("start vkGetRefreshCycleDurationGOOGLE"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20051 | auto stream = mImpl->stream(); |
| 20052 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20053 | auto resources = mImpl->resources(); |
| 20054 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20055 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20056 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20057 | VkSwapchainKHR local_swapchain; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 20058 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20059 | local_swapchain = swapchain; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20060 | countingStream->rewind(); |
| 20061 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20062 | uint64_t cgen_var_1352; |
| 20063 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1352, 1); |
| 20064 | countingStream->write((uint64_t*)&cgen_var_1352, 1 * 8); |
| 20065 | uint64_t cgen_var_1353; |
| 20066 | countingStream->handleMapping()->mapHandles_VkSwapchainKHR_u64(&local_swapchain, &cgen_var_1353, 1); |
| 20067 | countingStream->write((uint64_t*)&cgen_var_1353, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20068 | marshal_VkRefreshCycleDurationGOOGLE(countingStream, (VkRefreshCycleDurationGOOGLE*)(pDisplayTimingProperties)); |
| 20069 | } |
| 20070 | uint32_t packetSize_vkGetRefreshCycleDurationGOOGLE = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 20071 | countingStream->rewind(); |
| 20072 | uint32_t opcode_vkGetRefreshCycleDurationGOOGLE = OP_vkGetRefreshCycleDurationGOOGLE; |
| 20073 | stream->write(&opcode_vkGetRefreshCycleDurationGOOGLE, sizeof(uint32_t)); |
| 20074 | stream->write(&packetSize_vkGetRefreshCycleDurationGOOGLE, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20075 | uint64_t cgen_var_1354; |
| 20076 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1354, 1); |
| 20077 | stream->write((uint64_t*)&cgen_var_1354, 1 * 8); |
| 20078 | uint64_t cgen_var_1355; |
| 20079 | stream->handleMapping()->mapHandles_VkSwapchainKHR_u64(&local_swapchain, &cgen_var_1355, 1); |
| 20080 | stream->write((uint64_t*)&cgen_var_1355, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20081 | marshal_VkRefreshCycleDurationGOOGLE(stream, (VkRefreshCycleDurationGOOGLE*)(pDisplayTimingProperties)); |
| 20082 | unmarshal_VkRefreshCycleDurationGOOGLE(stream, (VkRefreshCycleDurationGOOGLE*)(pDisplayTimingProperties)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 20083 | if (pDisplayTimingProperties) |
| 20084 | { |
| 20085 | transform_fromhost_VkRefreshCycleDurationGOOGLE(mImpl->resources(), (VkRefreshCycleDurationGOOGLE*)(pDisplayTimingProperties)); |
| 20086 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20087 | VkResult vkGetRefreshCycleDurationGOOGLE_VkResult_return = (VkResult)0; |
| 20088 | stream->read(&vkGetRefreshCycleDurationGOOGLE_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 20089 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 20090 | countingStream->clearPool(); |
| 20091 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20092 | mImpl->log("finish vkGetRefreshCycleDurationGOOGLE");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20093 | return vkGetRefreshCycleDurationGOOGLE_VkResult_return; |
| 20094 | } |
| 20095 | |
| 20096 | VkResult VkEncoder::vkGetPastPresentationTimingGOOGLE( |
| 20097 | VkDevice device, |
| 20098 | VkSwapchainKHR swapchain, |
| 20099 | uint32_t* pPresentationTimingCount, |
| 20100 | VkPastPresentationTimingGOOGLE* pPresentationTimings) |
| 20101 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 20102 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20103 | mImpl->log("start vkGetPastPresentationTimingGOOGLE"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20104 | auto stream = mImpl->stream(); |
| 20105 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20106 | auto resources = mImpl->resources(); |
| 20107 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20108 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20109 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20110 | VkSwapchainKHR local_swapchain; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 20111 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20112 | local_swapchain = swapchain; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20113 | countingStream->rewind(); |
| 20114 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20115 | uint64_t cgen_var_1356; |
| 20116 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1356, 1); |
| 20117 | countingStream->write((uint64_t*)&cgen_var_1356, 1 * 8); |
| 20118 | uint64_t cgen_var_1357; |
| 20119 | countingStream->handleMapping()->mapHandles_VkSwapchainKHR_u64(&local_swapchain, &cgen_var_1357, 1); |
| 20120 | countingStream->write((uint64_t*)&cgen_var_1357, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 20121 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20122 | uint64_t cgen_var_1358 = (uint64_t)(uintptr_t)pPresentationTimingCount; |
| 20123 | countingStream->putBe64(cgen_var_1358); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20124 | if (pPresentationTimingCount) |
| 20125 | { |
| 20126 | countingStream->write((uint32_t*)pPresentationTimingCount, sizeof(uint32_t)); |
| 20127 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 20128 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20129 | uint64_t cgen_var_1359 = (uint64_t)(uintptr_t)pPresentationTimings; |
| 20130 | countingStream->putBe64(cgen_var_1359); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20131 | if (pPresentationTimings) |
| 20132 | { |
| 20133 | for (uint32_t i = 0; i < (uint32_t)(*(pPresentationTimingCount)); ++i) |
| 20134 | { |
| 20135 | marshal_VkPastPresentationTimingGOOGLE(countingStream, (VkPastPresentationTimingGOOGLE*)(pPresentationTimings + i)); |
| 20136 | } |
| 20137 | } |
| 20138 | } |
| 20139 | uint32_t packetSize_vkGetPastPresentationTimingGOOGLE = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 20140 | countingStream->rewind(); |
| 20141 | uint32_t opcode_vkGetPastPresentationTimingGOOGLE = OP_vkGetPastPresentationTimingGOOGLE; |
| 20142 | stream->write(&opcode_vkGetPastPresentationTimingGOOGLE, sizeof(uint32_t)); |
| 20143 | stream->write(&packetSize_vkGetPastPresentationTimingGOOGLE, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20144 | uint64_t cgen_var_1360; |
| 20145 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1360, 1); |
| 20146 | stream->write((uint64_t*)&cgen_var_1360, 1 * 8); |
| 20147 | uint64_t cgen_var_1361; |
| 20148 | stream->handleMapping()->mapHandles_VkSwapchainKHR_u64(&local_swapchain, &cgen_var_1361, 1); |
| 20149 | stream->write((uint64_t*)&cgen_var_1361, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 20150 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20151 | uint64_t cgen_var_1362 = (uint64_t)(uintptr_t)pPresentationTimingCount; |
| 20152 | stream->putBe64(cgen_var_1362); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20153 | if (pPresentationTimingCount) |
| 20154 | { |
| 20155 | stream->write((uint32_t*)pPresentationTimingCount, sizeof(uint32_t)); |
| 20156 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 20157 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20158 | uint64_t cgen_var_1363 = (uint64_t)(uintptr_t)pPresentationTimings; |
| 20159 | stream->putBe64(cgen_var_1363); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20160 | if (pPresentationTimings) |
| 20161 | { |
| 20162 | for (uint32_t i = 0; i < (uint32_t)(*(pPresentationTimingCount)); ++i) |
| 20163 | { |
| 20164 | marshal_VkPastPresentationTimingGOOGLE(stream, (VkPastPresentationTimingGOOGLE*)(pPresentationTimings + i)); |
| 20165 | } |
| 20166 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 20167 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20168 | uint32_t* check_pPresentationTimingCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 20169 | check_pPresentationTimingCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20170 | if (pPresentationTimingCount) |
| 20171 | { |
| 20172 | if (!(check_pPresentationTimingCount)) |
| 20173 | { |
| 20174 | fprintf(stderr, "fatal: pPresentationTimingCount inconsistent between guest and host\n"); |
| 20175 | } |
| 20176 | stream->read((uint32_t*)pPresentationTimingCount, sizeof(uint32_t)); |
| 20177 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 20178 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20179 | VkPastPresentationTimingGOOGLE* check_pPresentationTimings; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 20180 | check_pPresentationTimings = (VkPastPresentationTimingGOOGLE*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20181 | if (pPresentationTimings) |
| 20182 | { |
| 20183 | if (!(check_pPresentationTimings)) |
| 20184 | { |
| 20185 | fprintf(stderr, "fatal: pPresentationTimings inconsistent between guest and host\n"); |
| 20186 | } |
| 20187 | for (uint32_t i = 0; i < (uint32_t)(*(pPresentationTimingCount)); ++i) |
| 20188 | { |
| 20189 | unmarshal_VkPastPresentationTimingGOOGLE(stream, (VkPastPresentationTimingGOOGLE*)(pPresentationTimings + i)); |
| 20190 | } |
| 20191 | } |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 20192 | if (pPresentationTimings) |
| 20193 | { |
| 20194 | for (uint32_t i = 0; i < (uint32_t)(*(pPresentationTimingCount)); ++i) |
| 20195 | { |
| 20196 | transform_fromhost_VkPastPresentationTimingGOOGLE(mImpl->resources(), (VkPastPresentationTimingGOOGLE*)(pPresentationTimings + i)); |
| 20197 | } |
| 20198 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20199 | VkResult vkGetPastPresentationTimingGOOGLE_VkResult_return = (VkResult)0; |
| 20200 | stream->read(&vkGetPastPresentationTimingGOOGLE_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 20201 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 20202 | countingStream->clearPool(); |
| 20203 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20204 | mImpl->log("finish vkGetPastPresentationTimingGOOGLE");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20205 | return vkGetPastPresentationTimingGOOGLE_VkResult_return; |
| 20206 | } |
| 20207 | |
| 20208 | #endif |
| 20209 | #ifdef VK_NV_sample_mask_override_coverage |
| 20210 | #endif |
| 20211 | #ifdef VK_NV_geometry_shader_passthrough |
| 20212 | #endif |
| 20213 | #ifdef VK_NV_viewport_array2 |
| 20214 | #endif |
| 20215 | #ifdef VK_NVX_multiview_per_view_attributes |
| 20216 | #endif |
| 20217 | #ifdef VK_NV_viewport_swizzle |
| 20218 | #endif |
| 20219 | #ifdef VK_EXT_discard_rectangles |
| 20220 | void VkEncoder::vkCmdSetDiscardRectangleEXT( |
| 20221 | VkCommandBuffer commandBuffer, |
| 20222 | uint32_t firstDiscardRectangle, |
| 20223 | uint32_t discardRectangleCount, |
| 20224 | const VkRect2D* pDiscardRectangles) |
| 20225 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 20226 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20227 | mImpl->log("start vkCmdSetDiscardRectangleEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20228 | auto stream = mImpl->stream(); |
| 20229 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20230 | auto resources = mImpl->resources(); |
| 20231 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20232 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20233 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20234 | uint32_t local_firstDiscardRectangle; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20235 | uint32_t local_discardRectangleCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20236 | VkRect2D* local_pDiscardRectangles; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 20237 | local_commandBuffer = commandBuffer; |
| 20238 | local_firstDiscardRectangle = firstDiscardRectangle; |
| 20239 | local_discardRectangleCount = discardRectangleCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20240 | local_pDiscardRectangles = nullptr; |
| 20241 | if (pDiscardRectangles) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20242 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20243 | local_pDiscardRectangles = (VkRect2D*)pool->alloc(((discardRectangleCount)) * sizeof(const VkRect2D)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20244 | for (uint32_t i = 0; i < (uint32_t)((discardRectangleCount)); ++i) |
| 20245 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20246 | deepcopy_VkRect2D(pool, pDiscardRectangles + i, (VkRect2D*)(local_pDiscardRectangles + i)); |
| 20247 | } |
| 20248 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 20249 | if (local_pDiscardRectangles) |
| 20250 | { |
| 20251 | for (uint32_t i = 0; i < (uint32_t)((discardRectangleCount)); ++i) |
| 20252 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 20253 | transform_tohost_VkRect2D(mImpl->resources(), (VkRect2D*)(local_pDiscardRectangles + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 20254 | } |
| 20255 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20256 | countingStream->rewind(); |
| 20257 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20258 | uint64_t cgen_var_1366; |
| 20259 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1366, 1); |
| 20260 | countingStream->write((uint64_t*)&cgen_var_1366, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20261 | countingStream->write((uint32_t*)&local_firstDiscardRectangle, sizeof(uint32_t)); |
| 20262 | countingStream->write((uint32_t*)&local_discardRectangleCount, sizeof(uint32_t)); |
| 20263 | for (uint32_t i = 0; i < (uint32_t)((discardRectangleCount)); ++i) |
| 20264 | { |
| 20265 | marshal_VkRect2D(countingStream, (VkRect2D*)(local_pDiscardRectangles + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20266 | } |
| 20267 | } |
| 20268 | uint32_t packetSize_vkCmdSetDiscardRectangleEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 20269 | countingStream->rewind(); |
| 20270 | uint32_t opcode_vkCmdSetDiscardRectangleEXT = OP_vkCmdSetDiscardRectangleEXT; |
| 20271 | stream->write(&opcode_vkCmdSetDiscardRectangleEXT, sizeof(uint32_t)); |
| 20272 | stream->write(&packetSize_vkCmdSetDiscardRectangleEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20273 | uint64_t cgen_var_1367; |
| 20274 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1367, 1); |
| 20275 | stream->write((uint64_t*)&cgen_var_1367, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20276 | stream->write((uint32_t*)&local_firstDiscardRectangle, sizeof(uint32_t)); |
| 20277 | stream->write((uint32_t*)&local_discardRectangleCount, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20278 | for (uint32_t i = 0; i < (uint32_t)((discardRectangleCount)); ++i) |
| 20279 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20280 | marshal_VkRect2D(stream, (VkRect2D*)(local_pDiscardRectangles + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20281 | } |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 20282 | pool->freeAll(); |
| 20283 | countingStream->clearPool(); |
| 20284 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20285 | mImpl->log("finish vkCmdSetDiscardRectangleEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20286 | } |
| 20287 | |
| 20288 | #endif |
| 20289 | #ifdef VK_EXT_conservative_rasterization |
| 20290 | #endif |
| 20291 | #ifdef VK_EXT_swapchain_colorspace |
| 20292 | #endif |
| 20293 | #ifdef VK_EXT_hdr_metadata |
| 20294 | void VkEncoder::vkSetHdrMetadataEXT( |
| 20295 | VkDevice device, |
| 20296 | uint32_t swapchainCount, |
| 20297 | const VkSwapchainKHR* pSwapchains, |
| 20298 | const VkHdrMetadataEXT* pMetadata) |
| 20299 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 20300 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20301 | mImpl->log("start vkSetHdrMetadataEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20302 | auto stream = mImpl->stream(); |
| 20303 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20304 | auto resources = mImpl->resources(); |
| 20305 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20306 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20307 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20308 | uint32_t local_swapchainCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20309 | VkSwapchainKHR* local_pSwapchains; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 20310 | VkHdrMetadataEXT* local_pMetadata; |
| 20311 | local_device = device; |
| 20312 | local_swapchainCount = swapchainCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20313 | local_pSwapchains = nullptr; |
| 20314 | if (pSwapchains) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20315 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20316 | local_pSwapchains = (VkSwapchainKHR*)pool->dupArray(pSwapchains, ((swapchainCount)) * sizeof(const VkSwapchainKHR)); |
| 20317 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20318 | local_pMetadata = nullptr; |
| 20319 | if (pMetadata) |
| 20320 | { |
| 20321 | local_pMetadata = (VkHdrMetadataEXT*)pool->alloc(((swapchainCount)) * sizeof(const VkHdrMetadataEXT)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20322 | for (uint32_t i = 0; i < (uint32_t)((swapchainCount)); ++i) |
| 20323 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20324 | deepcopy_VkHdrMetadataEXT(pool, pMetadata + i, (VkHdrMetadataEXT*)(local_pMetadata + i)); |
| 20325 | } |
| 20326 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 20327 | if (local_pMetadata) |
| 20328 | { |
| 20329 | for (uint32_t i = 0; i < (uint32_t)((swapchainCount)); ++i) |
| 20330 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 20331 | transform_tohost_VkHdrMetadataEXT(mImpl->resources(), (VkHdrMetadataEXT*)(local_pMetadata + i)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 20332 | } |
| 20333 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20334 | countingStream->rewind(); |
| 20335 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20336 | uint64_t cgen_var_1368; |
| 20337 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1368, 1); |
| 20338 | countingStream->write((uint64_t*)&cgen_var_1368, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20339 | countingStream->write((uint32_t*)&local_swapchainCount, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 20340 | if (((swapchainCount))) |
| 20341 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20342 | uint64_t* cgen_var_1369; |
| 20343 | countingStream->alloc((void**)&cgen_var_1369, ((swapchainCount)) * 8); |
| 20344 | countingStream->handleMapping()->mapHandles_VkSwapchainKHR_u64(local_pSwapchains, cgen_var_1369, ((swapchainCount))); |
| 20345 | countingStream->write((uint64_t*)cgen_var_1369, ((swapchainCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 20346 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20347 | for (uint32_t i = 0; i < (uint32_t)((swapchainCount)); ++i) |
| 20348 | { |
| 20349 | marshal_VkHdrMetadataEXT(countingStream, (VkHdrMetadataEXT*)(local_pMetadata + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20350 | } |
| 20351 | } |
| 20352 | uint32_t packetSize_vkSetHdrMetadataEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 20353 | countingStream->rewind(); |
| 20354 | uint32_t opcode_vkSetHdrMetadataEXT = OP_vkSetHdrMetadataEXT; |
| 20355 | stream->write(&opcode_vkSetHdrMetadataEXT, sizeof(uint32_t)); |
| 20356 | stream->write(&packetSize_vkSetHdrMetadataEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20357 | uint64_t cgen_var_1370; |
| 20358 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1370, 1); |
| 20359 | stream->write((uint64_t*)&cgen_var_1370, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20360 | stream->write((uint32_t*)&local_swapchainCount, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 20361 | if (((swapchainCount))) |
| 20362 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20363 | uint64_t* cgen_var_1371; |
| 20364 | stream->alloc((void**)&cgen_var_1371, ((swapchainCount)) * 8); |
| 20365 | stream->handleMapping()->mapHandles_VkSwapchainKHR_u64(local_pSwapchains, cgen_var_1371, ((swapchainCount))); |
| 20366 | stream->write((uint64_t*)cgen_var_1371, ((swapchainCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 20367 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20368 | for (uint32_t i = 0; i < (uint32_t)((swapchainCount)); ++i) |
| 20369 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20370 | marshal_VkHdrMetadataEXT(stream, (VkHdrMetadataEXT*)(local_pMetadata + i)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20371 | } |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 20372 | pool->freeAll(); |
| 20373 | countingStream->clearPool(); |
| 20374 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20375 | mImpl->log("finish vkSetHdrMetadataEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20376 | } |
| 20377 | |
| 20378 | #endif |
| 20379 | #ifdef VK_MVK_ios_surface |
| 20380 | VkResult VkEncoder::vkCreateIOSSurfaceMVK( |
| 20381 | VkInstance instance, |
| 20382 | const VkIOSSurfaceCreateInfoMVK* pCreateInfo, |
| 20383 | const VkAllocationCallbacks* pAllocator, |
| 20384 | VkSurfaceKHR* pSurface) |
| 20385 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 20386 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20387 | mImpl->log("start vkCreateIOSSurfaceMVK"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20388 | auto stream = mImpl->stream(); |
| 20389 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20390 | auto resources = mImpl->resources(); |
| 20391 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20392 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20393 | VkInstance local_instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20394 | VkIOSSurfaceCreateInfoMVK* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 20395 | VkAllocationCallbacks* local_pAllocator; |
| 20396 | local_instance = instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20397 | local_pCreateInfo = nullptr; |
| 20398 | if (pCreateInfo) |
| 20399 | { |
| 20400 | local_pCreateInfo = (VkIOSSurfaceCreateInfoMVK*)pool->alloc(sizeof(const VkIOSSurfaceCreateInfoMVK)); |
| 20401 | deepcopy_VkIOSSurfaceCreateInfoMVK(pool, pCreateInfo, (VkIOSSurfaceCreateInfoMVK*)(local_pCreateInfo)); |
| 20402 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20403 | local_pAllocator = nullptr; |
| 20404 | if (pAllocator) |
| 20405 | { |
| 20406 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 20407 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 20408 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 20409 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 20410 | if (local_pCreateInfo) |
| 20411 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 20412 | transform_tohost_VkIOSSurfaceCreateInfoMVK(mImpl->resources(), (VkIOSSurfaceCreateInfoMVK*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 20413 | } |
| 20414 | if (local_pAllocator) |
| 20415 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 20416 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 20417 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20418 | countingStream->rewind(); |
| 20419 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20420 | uint64_t cgen_var_1372; |
| 20421 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1372, 1); |
| 20422 | countingStream->write((uint64_t*)&cgen_var_1372, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20423 | marshal_VkIOSSurfaceCreateInfoMVK(countingStream, (VkIOSSurfaceCreateInfoMVK*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 20424 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20425 | uint64_t cgen_var_1373 = (uint64_t)(uintptr_t)local_pAllocator; |
| 20426 | countingStream->putBe64(cgen_var_1373); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20427 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20428 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20429 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20430 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20431 | uint64_t cgen_var_1374; |
| 20432 | countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_1374, 1); |
| 20433 | countingStream->write((uint64_t*)&cgen_var_1374, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20434 | } |
| 20435 | uint32_t packetSize_vkCreateIOSSurfaceMVK = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 20436 | countingStream->rewind(); |
| 20437 | uint32_t opcode_vkCreateIOSSurfaceMVK = OP_vkCreateIOSSurfaceMVK; |
| 20438 | stream->write(&opcode_vkCreateIOSSurfaceMVK, sizeof(uint32_t)); |
| 20439 | stream->write(&packetSize_vkCreateIOSSurfaceMVK, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20440 | uint64_t cgen_var_1375; |
| 20441 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1375, 1); |
| 20442 | stream->write((uint64_t*)&cgen_var_1375, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20443 | marshal_VkIOSSurfaceCreateInfoMVK(stream, (VkIOSSurfaceCreateInfoMVK*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 20444 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20445 | uint64_t cgen_var_1376 = (uint64_t)(uintptr_t)local_pAllocator; |
| 20446 | stream->putBe64(cgen_var_1376); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20447 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20448 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20449 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20450 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20451 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20452 | uint64_t cgen_var_1377; |
| 20453 | stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_1377, 1); |
| 20454 | stream->write((uint64_t*)&cgen_var_1377, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20455 | stream->setHandleMapping(resources->unwrapMapping()); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20456 | uint64_t cgen_var_1378; |
| 20457 | stream->read((uint64_t*)&cgen_var_1378, 8); |
| 20458 | stream->handleMapping()->mapHandles_u64_VkSurfaceKHR(&cgen_var_1378, (VkSurfaceKHR*)pSurface, 1); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20459 | VkResult vkCreateIOSSurfaceMVK_VkResult_return = (VkResult)0; |
| 20460 | stream->read(&vkCreateIOSSurfaceMVK_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 20461 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 20462 | countingStream->clearPool(); |
| 20463 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20464 | mImpl->log("finish vkCreateIOSSurfaceMVK");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20465 | return vkCreateIOSSurfaceMVK_VkResult_return; |
| 20466 | } |
| 20467 | |
| 20468 | #endif |
| 20469 | #ifdef VK_MVK_macos_surface |
| 20470 | VkResult VkEncoder::vkCreateMacOSSurfaceMVK( |
| 20471 | VkInstance instance, |
| 20472 | const VkMacOSSurfaceCreateInfoMVK* pCreateInfo, |
| 20473 | const VkAllocationCallbacks* pAllocator, |
| 20474 | VkSurfaceKHR* pSurface) |
| 20475 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 20476 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20477 | mImpl->log("start vkCreateMacOSSurfaceMVK"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20478 | auto stream = mImpl->stream(); |
| 20479 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20480 | auto resources = mImpl->resources(); |
| 20481 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20482 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20483 | VkInstance local_instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20484 | VkMacOSSurfaceCreateInfoMVK* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 20485 | VkAllocationCallbacks* local_pAllocator; |
| 20486 | local_instance = instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20487 | local_pCreateInfo = nullptr; |
| 20488 | if (pCreateInfo) |
| 20489 | { |
| 20490 | local_pCreateInfo = (VkMacOSSurfaceCreateInfoMVK*)pool->alloc(sizeof(const VkMacOSSurfaceCreateInfoMVK)); |
| 20491 | deepcopy_VkMacOSSurfaceCreateInfoMVK(pool, pCreateInfo, (VkMacOSSurfaceCreateInfoMVK*)(local_pCreateInfo)); |
| 20492 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20493 | local_pAllocator = nullptr; |
| 20494 | if (pAllocator) |
| 20495 | { |
| 20496 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 20497 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 20498 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 20499 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 20500 | if (local_pCreateInfo) |
| 20501 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 20502 | transform_tohost_VkMacOSSurfaceCreateInfoMVK(mImpl->resources(), (VkMacOSSurfaceCreateInfoMVK*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 20503 | } |
| 20504 | if (local_pAllocator) |
| 20505 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 20506 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 20507 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20508 | countingStream->rewind(); |
| 20509 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20510 | uint64_t cgen_var_1379; |
| 20511 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1379, 1); |
| 20512 | countingStream->write((uint64_t*)&cgen_var_1379, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20513 | marshal_VkMacOSSurfaceCreateInfoMVK(countingStream, (VkMacOSSurfaceCreateInfoMVK*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 20514 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20515 | uint64_t cgen_var_1380 = (uint64_t)(uintptr_t)local_pAllocator; |
| 20516 | countingStream->putBe64(cgen_var_1380); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20517 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20518 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20519 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20520 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20521 | uint64_t cgen_var_1381; |
| 20522 | countingStream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_1381, 1); |
| 20523 | countingStream->write((uint64_t*)&cgen_var_1381, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20524 | } |
| 20525 | uint32_t packetSize_vkCreateMacOSSurfaceMVK = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 20526 | countingStream->rewind(); |
| 20527 | uint32_t opcode_vkCreateMacOSSurfaceMVK = OP_vkCreateMacOSSurfaceMVK; |
| 20528 | stream->write(&opcode_vkCreateMacOSSurfaceMVK, sizeof(uint32_t)); |
| 20529 | stream->write(&packetSize_vkCreateMacOSSurfaceMVK, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20530 | uint64_t cgen_var_1382; |
| 20531 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1382, 1); |
| 20532 | stream->write((uint64_t*)&cgen_var_1382, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20533 | marshal_VkMacOSSurfaceCreateInfoMVK(stream, (VkMacOSSurfaceCreateInfoMVK*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 20534 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20535 | uint64_t cgen_var_1383 = (uint64_t)(uintptr_t)local_pAllocator; |
| 20536 | stream->putBe64(cgen_var_1383); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20537 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20538 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20539 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20540 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20541 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20542 | uint64_t cgen_var_1384; |
| 20543 | stream->handleMapping()->mapHandles_VkSurfaceKHR_u64(pSurface, &cgen_var_1384, 1); |
| 20544 | stream->write((uint64_t*)&cgen_var_1384, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20545 | stream->setHandleMapping(resources->unwrapMapping()); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20546 | uint64_t cgen_var_1385; |
| 20547 | stream->read((uint64_t*)&cgen_var_1385, 8); |
| 20548 | stream->handleMapping()->mapHandles_u64_VkSurfaceKHR(&cgen_var_1385, (VkSurfaceKHR*)pSurface, 1); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20549 | VkResult vkCreateMacOSSurfaceMVK_VkResult_return = (VkResult)0; |
| 20550 | stream->read(&vkCreateMacOSSurfaceMVK_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 20551 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 20552 | countingStream->clearPool(); |
| 20553 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20554 | mImpl->log("finish vkCreateMacOSSurfaceMVK");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20555 | return vkCreateMacOSSurfaceMVK_VkResult_return; |
| 20556 | } |
| 20557 | |
| 20558 | #endif |
| 20559 | #ifdef VK_EXT_external_memory_dma_buf |
| 20560 | #endif |
| 20561 | #ifdef VK_EXT_queue_family_foreign |
| 20562 | #endif |
| 20563 | #ifdef VK_EXT_debug_utils |
| 20564 | VkResult VkEncoder::vkSetDebugUtilsObjectNameEXT( |
| 20565 | VkDevice device, |
| 20566 | const VkDebugUtilsObjectNameInfoEXT* pNameInfo) |
| 20567 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 20568 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20569 | mImpl->log("start vkSetDebugUtilsObjectNameEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20570 | auto stream = mImpl->stream(); |
| 20571 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20572 | auto resources = mImpl->resources(); |
| 20573 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20574 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20575 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20576 | VkDebugUtilsObjectNameInfoEXT* local_pNameInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 20577 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20578 | local_pNameInfo = nullptr; |
| 20579 | if (pNameInfo) |
| 20580 | { |
| 20581 | local_pNameInfo = (VkDebugUtilsObjectNameInfoEXT*)pool->alloc(sizeof(const VkDebugUtilsObjectNameInfoEXT)); |
| 20582 | deepcopy_VkDebugUtilsObjectNameInfoEXT(pool, pNameInfo, (VkDebugUtilsObjectNameInfoEXT*)(local_pNameInfo)); |
| 20583 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 20584 | if (local_pNameInfo) |
| 20585 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 20586 | transform_tohost_VkDebugUtilsObjectNameInfoEXT(mImpl->resources(), (VkDebugUtilsObjectNameInfoEXT*)(local_pNameInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 20587 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20588 | countingStream->rewind(); |
| 20589 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20590 | uint64_t cgen_var_1386; |
| 20591 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1386, 1); |
| 20592 | countingStream->write((uint64_t*)&cgen_var_1386, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20593 | marshal_VkDebugUtilsObjectNameInfoEXT(countingStream, (VkDebugUtilsObjectNameInfoEXT*)(local_pNameInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20594 | } |
| 20595 | uint32_t packetSize_vkSetDebugUtilsObjectNameEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 20596 | countingStream->rewind(); |
| 20597 | uint32_t opcode_vkSetDebugUtilsObjectNameEXT = OP_vkSetDebugUtilsObjectNameEXT; |
| 20598 | stream->write(&opcode_vkSetDebugUtilsObjectNameEXT, sizeof(uint32_t)); |
| 20599 | stream->write(&packetSize_vkSetDebugUtilsObjectNameEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20600 | uint64_t cgen_var_1387; |
| 20601 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1387, 1); |
| 20602 | stream->write((uint64_t*)&cgen_var_1387, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20603 | marshal_VkDebugUtilsObjectNameInfoEXT(stream, (VkDebugUtilsObjectNameInfoEXT*)(local_pNameInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20604 | VkResult vkSetDebugUtilsObjectNameEXT_VkResult_return = (VkResult)0; |
| 20605 | stream->read(&vkSetDebugUtilsObjectNameEXT_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 20606 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 20607 | countingStream->clearPool(); |
| 20608 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20609 | mImpl->log("finish vkSetDebugUtilsObjectNameEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20610 | return vkSetDebugUtilsObjectNameEXT_VkResult_return; |
| 20611 | } |
| 20612 | |
| 20613 | VkResult VkEncoder::vkSetDebugUtilsObjectTagEXT( |
| 20614 | VkDevice device, |
| 20615 | const VkDebugUtilsObjectTagInfoEXT* pTagInfo) |
| 20616 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 20617 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20618 | mImpl->log("start vkSetDebugUtilsObjectTagEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20619 | auto stream = mImpl->stream(); |
| 20620 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20621 | auto resources = mImpl->resources(); |
| 20622 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20623 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20624 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20625 | VkDebugUtilsObjectTagInfoEXT* local_pTagInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 20626 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20627 | local_pTagInfo = nullptr; |
| 20628 | if (pTagInfo) |
| 20629 | { |
| 20630 | local_pTagInfo = (VkDebugUtilsObjectTagInfoEXT*)pool->alloc(sizeof(const VkDebugUtilsObjectTagInfoEXT)); |
| 20631 | deepcopy_VkDebugUtilsObjectTagInfoEXT(pool, pTagInfo, (VkDebugUtilsObjectTagInfoEXT*)(local_pTagInfo)); |
| 20632 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 20633 | if (local_pTagInfo) |
| 20634 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 20635 | transform_tohost_VkDebugUtilsObjectTagInfoEXT(mImpl->resources(), (VkDebugUtilsObjectTagInfoEXT*)(local_pTagInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 20636 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20637 | countingStream->rewind(); |
| 20638 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20639 | uint64_t cgen_var_1388; |
| 20640 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1388, 1); |
| 20641 | countingStream->write((uint64_t*)&cgen_var_1388, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20642 | marshal_VkDebugUtilsObjectTagInfoEXT(countingStream, (VkDebugUtilsObjectTagInfoEXT*)(local_pTagInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20643 | } |
| 20644 | uint32_t packetSize_vkSetDebugUtilsObjectTagEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 20645 | countingStream->rewind(); |
| 20646 | uint32_t opcode_vkSetDebugUtilsObjectTagEXT = OP_vkSetDebugUtilsObjectTagEXT; |
| 20647 | stream->write(&opcode_vkSetDebugUtilsObjectTagEXT, sizeof(uint32_t)); |
| 20648 | stream->write(&packetSize_vkSetDebugUtilsObjectTagEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20649 | uint64_t cgen_var_1389; |
| 20650 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1389, 1); |
| 20651 | stream->write((uint64_t*)&cgen_var_1389, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20652 | marshal_VkDebugUtilsObjectTagInfoEXT(stream, (VkDebugUtilsObjectTagInfoEXT*)(local_pTagInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20653 | VkResult vkSetDebugUtilsObjectTagEXT_VkResult_return = (VkResult)0; |
| 20654 | stream->read(&vkSetDebugUtilsObjectTagEXT_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 20655 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 20656 | countingStream->clearPool(); |
| 20657 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20658 | mImpl->log("finish vkSetDebugUtilsObjectTagEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20659 | return vkSetDebugUtilsObjectTagEXT_VkResult_return; |
| 20660 | } |
| 20661 | |
| 20662 | void VkEncoder::vkQueueBeginDebugUtilsLabelEXT( |
| 20663 | VkQueue queue, |
| 20664 | const VkDebugUtilsLabelEXT* pLabelInfo) |
| 20665 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 20666 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20667 | mImpl->log("start vkQueueBeginDebugUtilsLabelEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20668 | auto stream = mImpl->stream(); |
| 20669 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20670 | auto resources = mImpl->resources(); |
| 20671 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20672 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20673 | VkQueue local_queue; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20674 | VkDebugUtilsLabelEXT* local_pLabelInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 20675 | local_queue = queue; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20676 | local_pLabelInfo = nullptr; |
| 20677 | if (pLabelInfo) |
| 20678 | { |
| 20679 | local_pLabelInfo = (VkDebugUtilsLabelEXT*)pool->alloc(sizeof(const VkDebugUtilsLabelEXT)); |
| 20680 | deepcopy_VkDebugUtilsLabelEXT(pool, pLabelInfo, (VkDebugUtilsLabelEXT*)(local_pLabelInfo)); |
| 20681 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 20682 | if (local_pLabelInfo) |
| 20683 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 20684 | transform_tohost_VkDebugUtilsLabelEXT(mImpl->resources(), (VkDebugUtilsLabelEXT*)(local_pLabelInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 20685 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20686 | countingStream->rewind(); |
| 20687 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20688 | uint64_t cgen_var_1390; |
| 20689 | countingStream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_1390, 1); |
| 20690 | countingStream->write((uint64_t*)&cgen_var_1390, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20691 | marshal_VkDebugUtilsLabelEXT(countingStream, (VkDebugUtilsLabelEXT*)(local_pLabelInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20692 | } |
| 20693 | uint32_t packetSize_vkQueueBeginDebugUtilsLabelEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 20694 | countingStream->rewind(); |
| 20695 | uint32_t opcode_vkQueueBeginDebugUtilsLabelEXT = OP_vkQueueBeginDebugUtilsLabelEXT; |
| 20696 | stream->write(&opcode_vkQueueBeginDebugUtilsLabelEXT, sizeof(uint32_t)); |
| 20697 | stream->write(&packetSize_vkQueueBeginDebugUtilsLabelEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20698 | uint64_t cgen_var_1391; |
| 20699 | stream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_1391, 1); |
| 20700 | stream->write((uint64_t*)&cgen_var_1391, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20701 | marshal_VkDebugUtilsLabelEXT(stream, (VkDebugUtilsLabelEXT*)(local_pLabelInfo)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 20702 | pool->freeAll(); |
| 20703 | countingStream->clearPool(); |
| 20704 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20705 | mImpl->log("finish vkQueueBeginDebugUtilsLabelEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20706 | } |
| 20707 | |
| 20708 | void VkEncoder::vkQueueEndDebugUtilsLabelEXT( |
| 20709 | VkQueue queue) |
| 20710 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 20711 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20712 | mImpl->log("start vkQueueEndDebugUtilsLabelEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20713 | auto stream = mImpl->stream(); |
| 20714 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20715 | auto resources = mImpl->resources(); |
| 20716 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20717 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20718 | VkQueue local_queue; |
| 20719 | local_queue = queue; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20720 | countingStream->rewind(); |
| 20721 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20722 | uint64_t cgen_var_1392; |
| 20723 | countingStream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_1392, 1); |
| 20724 | countingStream->write((uint64_t*)&cgen_var_1392, 1 * 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20725 | } |
| 20726 | uint32_t packetSize_vkQueueEndDebugUtilsLabelEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 20727 | countingStream->rewind(); |
| 20728 | uint32_t opcode_vkQueueEndDebugUtilsLabelEXT = OP_vkQueueEndDebugUtilsLabelEXT; |
| 20729 | stream->write(&opcode_vkQueueEndDebugUtilsLabelEXT, sizeof(uint32_t)); |
| 20730 | stream->write(&packetSize_vkQueueEndDebugUtilsLabelEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20731 | uint64_t cgen_var_1393; |
| 20732 | stream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_1393, 1); |
| 20733 | stream->write((uint64_t*)&cgen_var_1393, 1 * 8); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 20734 | pool->freeAll(); |
| 20735 | countingStream->clearPool(); |
| 20736 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20737 | mImpl->log("finish vkQueueEndDebugUtilsLabelEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20738 | } |
| 20739 | |
| 20740 | void VkEncoder::vkQueueInsertDebugUtilsLabelEXT( |
| 20741 | VkQueue queue, |
| 20742 | const VkDebugUtilsLabelEXT* pLabelInfo) |
| 20743 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 20744 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20745 | mImpl->log("start vkQueueInsertDebugUtilsLabelEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20746 | auto stream = mImpl->stream(); |
| 20747 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20748 | auto resources = mImpl->resources(); |
| 20749 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20750 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20751 | VkQueue local_queue; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20752 | VkDebugUtilsLabelEXT* local_pLabelInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 20753 | local_queue = queue; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20754 | local_pLabelInfo = nullptr; |
| 20755 | if (pLabelInfo) |
| 20756 | { |
| 20757 | local_pLabelInfo = (VkDebugUtilsLabelEXT*)pool->alloc(sizeof(const VkDebugUtilsLabelEXT)); |
| 20758 | deepcopy_VkDebugUtilsLabelEXT(pool, pLabelInfo, (VkDebugUtilsLabelEXT*)(local_pLabelInfo)); |
| 20759 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 20760 | if (local_pLabelInfo) |
| 20761 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 20762 | transform_tohost_VkDebugUtilsLabelEXT(mImpl->resources(), (VkDebugUtilsLabelEXT*)(local_pLabelInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 20763 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20764 | countingStream->rewind(); |
| 20765 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20766 | uint64_t cgen_var_1394; |
| 20767 | countingStream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_1394, 1); |
| 20768 | countingStream->write((uint64_t*)&cgen_var_1394, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20769 | marshal_VkDebugUtilsLabelEXT(countingStream, (VkDebugUtilsLabelEXT*)(local_pLabelInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20770 | } |
| 20771 | uint32_t packetSize_vkQueueInsertDebugUtilsLabelEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 20772 | countingStream->rewind(); |
| 20773 | uint32_t opcode_vkQueueInsertDebugUtilsLabelEXT = OP_vkQueueInsertDebugUtilsLabelEXT; |
| 20774 | stream->write(&opcode_vkQueueInsertDebugUtilsLabelEXT, sizeof(uint32_t)); |
| 20775 | stream->write(&packetSize_vkQueueInsertDebugUtilsLabelEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20776 | uint64_t cgen_var_1395; |
| 20777 | stream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_1395, 1); |
| 20778 | stream->write((uint64_t*)&cgen_var_1395, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20779 | marshal_VkDebugUtilsLabelEXT(stream, (VkDebugUtilsLabelEXT*)(local_pLabelInfo)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 20780 | pool->freeAll(); |
| 20781 | countingStream->clearPool(); |
| 20782 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20783 | mImpl->log("finish vkQueueInsertDebugUtilsLabelEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20784 | } |
| 20785 | |
| 20786 | void VkEncoder::vkCmdBeginDebugUtilsLabelEXT( |
| 20787 | VkCommandBuffer commandBuffer, |
| 20788 | const VkDebugUtilsLabelEXT* pLabelInfo) |
| 20789 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 20790 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20791 | mImpl->log("start vkCmdBeginDebugUtilsLabelEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20792 | auto stream = mImpl->stream(); |
| 20793 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20794 | auto resources = mImpl->resources(); |
| 20795 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20796 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20797 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20798 | VkDebugUtilsLabelEXT* local_pLabelInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 20799 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20800 | local_pLabelInfo = nullptr; |
| 20801 | if (pLabelInfo) |
| 20802 | { |
| 20803 | local_pLabelInfo = (VkDebugUtilsLabelEXT*)pool->alloc(sizeof(const VkDebugUtilsLabelEXT)); |
| 20804 | deepcopy_VkDebugUtilsLabelEXT(pool, pLabelInfo, (VkDebugUtilsLabelEXT*)(local_pLabelInfo)); |
| 20805 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 20806 | if (local_pLabelInfo) |
| 20807 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 20808 | transform_tohost_VkDebugUtilsLabelEXT(mImpl->resources(), (VkDebugUtilsLabelEXT*)(local_pLabelInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 20809 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20810 | countingStream->rewind(); |
| 20811 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20812 | uint64_t cgen_var_1396; |
| 20813 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1396, 1); |
| 20814 | countingStream->write((uint64_t*)&cgen_var_1396, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20815 | marshal_VkDebugUtilsLabelEXT(countingStream, (VkDebugUtilsLabelEXT*)(local_pLabelInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20816 | } |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 20817 | uint32_t packetSize_vkCmdBeginDebugUtilsLabelEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 20818 | countingStream->rewind(); |
| 20819 | uint32_t opcode_vkCmdBeginDebugUtilsLabelEXT = OP_vkCmdBeginDebugUtilsLabelEXT; |
| 20820 | stream->write(&opcode_vkCmdBeginDebugUtilsLabelEXT, sizeof(uint32_t)); |
| 20821 | stream->write(&packetSize_vkCmdBeginDebugUtilsLabelEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20822 | uint64_t cgen_var_1397; |
| 20823 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1397, 1); |
| 20824 | stream->write((uint64_t*)&cgen_var_1397, 1 * 8); |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 20825 | marshal_VkDebugUtilsLabelEXT(stream, (VkDebugUtilsLabelEXT*)(local_pLabelInfo)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 20826 | pool->freeAll(); |
| 20827 | countingStream->clearPool(); |
| 20828 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20829 | mImpl->log("finish vkCmdBeginDebugUtilsLabelEXT");; |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 20830 | } |
| 20831 | |
| 20832 | void VkEncoder::vkCmdEndDebugUtilsLabelEXT( |
| 20833 | VkCommandBuffer commandBuffer) |
| 20834 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 20835 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20836 | mImpl->log("start vkCmdEndDebugUtilsLabelEXT"); |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 20837 | auto stream = mImpl->stream(); |
| 20838 | auto countingStream = mImpl->countingStream(); |
| 20839 | auto resources = mImpl->resources(); |
| 20840 | auto pool = mImpl->pool(); |
| 20841 | stream->setHandleMapping(resources->unwrapMapping()); |
| 20842 | VkCommandBuffer local_commandBuffer; |
| 20843 | local_commandBuffer = commandBuffer; |
| 20844 | countingStream->rewind(); |
| 20845 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20846 | uint64_t cgen_var_1398; |
| 20847 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1398, 1); |
| 20848 | countingStream->write((uint64_t*)&cgen_var_1398, 1 * 8); |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 20849 | } |
| 20850 | uint32_t packetSize_vkCmdEndDebugUtilsLabelEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 20851 | countingStream->rewind(); |
| 20852 | uint32_t opcode_vkCmdEndDebugUtilsLabelEXT = OP_vkCmdEndDebugUtilsLabelEXT; |
| 20853 | stream->write(&opcode_vkCmdEndDebugUtilsLabelEXT, sizeof(uint32_t)); |
| 20854 | stream->write(&packetSize_vkCmdEndDebugUtilsLabelEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20855 | uint64_t cgen_var_1399; |
| 20856 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1399, 1); |
| 20857 | stream->write((uint64_t*)&cgen_var_1399, 1 * 8); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 20858 | pool->freeAll(); |
| 20859 | countingStream->clearPool(); |
| 20860 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20861 | mImpl->log("finish vkCmdEndDebugUtilsLabelEXT");; |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 20862 | } |
| 20863 | |
| 20864 | void VkEncoder::vkCmdInsertDebugUtilsLabelEXT( |
| 20865 | VkCommandBuffer commandBuffer, |
| 20866 | const VkDebugUtilsLabelEXT* pLabelInfo) |
| 20867 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 20868 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20869 | mImpl->log("start vkCmdInsertDebugUtilsLabelEXT"); |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 20870 | auto stream = mImpl->stream(); |
| 20871 | auto countingStream = mImpl->countingStream(); |
| 20872 | auto resources = mImpl->resources(); |
| 20873 | auto pool = mImpl->pool(); |
| 20874 | stream->setHandleMapping(resources->unwrapMapping()); |
| 20875 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 20876 | VkDebugUtilsLabelEXT* local_pLabelInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 20877 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 20878 | local_pLabelInfo = nullptr; |
| 20879 | if (pLabelInfo) |
| 20880 | { |
| 20881 | local_pLabelInfo = (VkDebugUtilsLabelEXT*)pool->alloc(sizeof(const VkDebugUtilsLabelEXT)); |
| 20882 | deepcopy_VkDebugUtilsLabelEXT(pool, pLabelInfo, (VkDebugUtilsLabelEXT*)(local_pLabelInfo)); |
| 20883 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 20884 | if (local_pLabelInfo) |
| 20885 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 20886 | transform_tohost_VkDebugUtilsLabelEXT(mImpl->resources(), (VkDebugUtilsLabelEXT*)(local_pLabelInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 20887 | } |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 20888 | countingStream->rewind(); |
| 20889 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20890 | uint64_t cgen_var_1400; |
| 20891 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1400, 1); |
| 20892 | countingStream->write((uint64_t*)&cgen_var_1400, 1 * 8); |
| Lingfeng Yang | b92df0c | 2018-11-19 01:57:25 -0800 | [diff] [blame] | 20893 | marshal_VkDebugUtilsLabelEXT(countingStream, (VkDebugUtilsLabelEXT*)(local_pLabelInfo)); |
| 20894 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20895 | uint32_t packetSize_vkCmdInsertDebugUtilsLabelEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 20896 | countingStream->rewind(); |
| 20897 | uint32_t opcode_vkCmdInsertDebugUtilsLabelEXT = OP_vkCmdInsertDebugUtilsLabelEXT; |
| 20898 | stream->write(&opcode_vkCmdInsertDebugUtilsLabelEXT, sizeof(uint32_t)); |
| 20899 | stream->write(&packetSize_vkCmdInsertDebugUtilsLabelEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20900 | uint64_t cgen_var_1401; |
| 20901 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1401, 1); |
| 20902 | stream->write((uint64_t*)&cgen_var_1401, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20903 | marshal_VkDebugUtilsLabelEXT(stream, (VkDebugUtilsLabelEXT*)(local_pLabelInfo)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 20904 | pool->freeAll(); |
| 20905 | countingStream->clearPool(); |
| 20906 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20907 | mImpl->log("finish vkCmdInsertDebugUtilsLabelEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20908 | } |
| 20909 | |
| 20910 | VkResult VkEncoder::vkCreateDebugUtilsMessengerEXT( |
| 20911 | VkInstance instance, |
| 20912 | const VkDebugUtilsMessengerCreateInfoEXT* pCreateInfo, |
| 20913 | const VkAllocationCallbacks* pAllocator, |
| 20914 | VkDebugUtilsMessengerEXT* pMessenger) |
| 20915 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 20916 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20917 | mImpl->log("start vkCreateDebugUtilsMessengerEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20918 | auto stream = mImpl->stream(); |
| 20919 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20920 | auto resources = mImpl->resources(); |
| 20921 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20922 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20923 | VkInstance local_instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20924 | VkDebugUtilsMessengerCreateInfoEXT* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 20925 | VkAllocationCallbacks* local_pAllocator; |
| 20926 | local_instance = instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20927 | local_pCreateInfo = nullptr; |
| 20928 | if (pCreateInfo) |
| 20929 | { |
| 20930 | local_pCreateInfo = (VkDebugUtilsMessengerCreateInfoEXT*)pool->alloc(sizeof(const VkDebugUtilsMessengerCreateInfoEXT)); |
| 20931 | deepcopy_VkDebugUtilsMessengerCreateInfoEXT(pool, pCreateInfo, (VkDebugUtilsMessengerCreateInfoEXT*)(local_pCreateInfo)); |
| 20932 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20933 | local_pAllocator = nullptr; |
| 20934 | if (pAllocator) |
| 20935 | { |
| 20936 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 20937 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 20938 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 20939 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 20940 | if (local_pCreateInfo) |
| 20941 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 20942 | transform_tohost_VkDebugUtilsMessengerCreateInfoEXT(mImpl->resources(), (VkDebugUtilsMessengerCreateInfoEXT*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 20943 | } |
| 20944 | if (local_pAllocator) |
| 20945 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 20946 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 20947 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20948 | countingStream->rewind(); |
| 20949 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20950 | uint64_t cgen_var_1402; |
| 20951 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1402, 1); |
| 20952 | countingStream->write((uint64_t*)&cgen_var_1402, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20953 | marshal_VkDebugUtilsMessengerCreateInfoEXT(countingStream, (VkDebugUtilsMessengerCreateInfoEXT*)(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_1403 = (uint64_t)(uintptr_t)local_pAllocator; |
| 20956 | countingStream->putBe64(cgen_var_1403); |
| 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(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20960 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20961 | uint64_t cgen_var_1404; |
| 20962 | countingStream->handleMapping()->mapHandles_VkDebugUtilsMessengerEXT_u64(pMessenger, &cgen_var_1404, 1); |
| 20963 | countingStream->write((uint64_t*)&cgen_var_1404, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20964 | } |
| 20965 | uint32_t packetSize_vkCreateDebugUtilsMessengerEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 20966 | countingStream->rewind(); |
| 20967 | uint32_t opcode_vkCreateDebugUtilsMessengerEXT = OP_vkCreateDebugUtilsMessengerEXT; |
| 20968 | stream->write(&opcode_vkCreateDebugUtilsMessengerEXT, sizeof(uint32_t)); |
| 20969 | stream->write(&packetSize_vkCreateDebugUtilsMessengerEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20970 | uint64_t cgen_var_1405; |
| 20971 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1405, 1); |
| 20972 | stream->write((uint64_t*)&cgen_var_1405, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20973 | marshal_VkDebugUtilsMessengerCreateInfoEXT(stream, (VkDebugUtilsMessengerCreateInfoEXT*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 20974 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20975 | uint64_t cgen_var_1406 = (uint64_t)(uintptr_t)local_pAllocator; |
| 20976 | stream->putBe64(cgen_var_1406); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20977 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20978 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 20979 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20980 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20981 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20982 | uint64_t cgen_var_1407; |
| 20983 | stream->handleMapping()->mapHandles_VkDebugUtilsMessengerEXT_u64(pMessenger, &cgen_var_1407, 1); |
| 20984 | stream->write((uint64_t*)&cgen_var_1407, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20985 | stream->setHandleMapping(resources->unwrapMapping()); |
| 20986 | stream->setHandleMapping(resources->createMapping()); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 20987 | uint64_t cgen_var_1408; |
| 20988 | stream->read((uint64_t*)&cgen_var_1408, 8); |
| 20989 | stream->handleMapping()->mapHandles_u64_VkDebugUtilsMessengerEXT(&cgen_var_1408, (VkDebugUtilsMessengerEXT*)pMessenger, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 20990 | stream->unsetHandleMapping(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20991 | VkResult vkCreateDebugUtilsMessengerEXT_VkResult_return = (VkResult)0; |
| 20992 | stream->read(&vkCreateDebugUtilsMessengerEXT_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 20993 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 20994 | countingStream->clearPool(); |
| 20995 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 20996 | mImpl->log("finish vkCreateDebugUtilsMessengerEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 20997 | return vkCreateDebugUtilsMessengerEXT_VkResult_return; |
| 20998 | } |
| 20999 | |
| 21000 | void VkEncoder::vkDestroyDebugUtilsMessengerEXT( |
| 21001 | VkInstance instance, |
| 21002 | VkDebugUtilsMessengerEXT messenger, |
| 21003 | const VkAllocationCallbacks* pAllocator) |
| 21004 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 21005 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 21006 | mImpl->log("start vkDestroyDebugUtilsMessengerEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21007 | auto stream = mImpl->stream(); |
| 21008 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21009 | auto resources = mImpl->resources(); |
| 21010 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 21011 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21012 | VkInstance local_instance; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 21013 | VkDebugUtilsMessengerEXT local_messenger; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21014 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 21015 | local_instance = instance; |
| 21016 | local_messenger = messenger; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21017 | local_pAllocator = nullptr; |
| 21018 | if (pAllocator) |
| 21019 | { |
| 21020 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 21021 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 21022 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 21023 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 21024 | if (local_pAllocator) |
| 21025 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 21026 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 21027 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21028 | countingStream->rewind(); |
| 21029 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21030 | uint64_t cgen_var_1409; |
| 21031 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1409, 1); |
| 21032 | countingStream->write((uint64_t*)&cgen_var_1409, 1 * 8); |
| 21033 | uint64_t cgen_var_1410; |
| 21034 | countingStream->handleMapping()->mapHandles_VkDebugUtilsMessengerEXT_u64(&local_messenger, &cgen_var_1410, 1); |
| 21035 | countingStream->write((uint64_t*)&cgen_var_1410, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 21036 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21037 | uint64_t cgen_var_1411 = (uint64_t)(uintptr_t)local_pAllocator; |
| 21038 | countingStream->putBe64(cgen_var_1411); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21039 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21040 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21041 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21042 | } |
| 21043 | } |
| 21044 | uint32_t packetSize_vkDestroyDebugUtilsMessengerEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 21045 | countingStream->rewind(); |
| 21046 | uint32_t opcode_vkDestroyDebugUtilsMessengerEXT = OP_vkDestroyDebugUtilsMessengerEXT; |
| 21047 | stream->write(&opcode_vkDestroyDebugUtilsMessengerEXT, sizeof(uint32_t)); |
| 21048 | stream->write(&packetSize_vkDestroyDebugUtilsMessengerEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21049 | uint64_t cgen_var_1412; |
| 21050 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1412, 1); |
| 21051 | stream->write((uint64_t*)&cgen_var_1412, 1 * 8); |
| 21052 | uint64_t cgen_var_1413; |
| 21053 | stream->handleMapping()->mapHandles_VkDebugUtilsMessengerEXT_u64(&local_messenger, &cgen_var_1413, 1); |
| 21054 | stream->write((uint64_t*)&cgen_var_1413, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 21055 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21056 | uint64_t cgen_var_1414 = (uint64_t)(uintptr_t)local_pAllocator; |
| 21057 | stream->putBe64(cgen_var_1414); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21058 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21059 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21060 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21061 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21062 | resources->destroyMapping()->mapHandles_VkDebugUtilsMessengerEXT((VkDebugUtilsMessengerEXT*)&messenger); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 21063 | pool->freeAll(); |
| 21064 | countingStream->clearPool(); |
| 21065 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 21066 | mImpl->log("finish vkDestroyDebugUtilsMessengerEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21067 | } |
| 21068 | |
| 21069 | void VkEncoder::vkSubmitDebugUtilsMessageEXT( |
| 21070 | VkInstance instance, |
| 21071 | VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity, |
| 21072 | VkDebugUtilsMessageTypeFlagsEXT messageTypes, |
| 21073 | const VkDebugUtilsMessengerCallbackDataEXT* pCallbackData) |
| 21074 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 21075 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 21076 | mImpl->log("start vkSubmitDebugUtilsMessageEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21077 | auto stream = mImpl->stream(); |
| 21078 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21079 | auto resources = mImpl->resources(); |
| 21080 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 21081 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21082 | VkInstance local_instance; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21083 | VkDebugUtilsMessageSeverityFlagBitsEXT local_messageSeverity; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21084 | VkDebugUtilsMessageTypeFlagsEXT local_messageTypes; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21085 | VkDebugUtilsMessengerCallbackDataEXT* local_pCallbackData; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 21086 | local_instance = instance; |
| 21087 | local_messageSeverity = messageSeverity; |
| 21088 | local_messageTypes = messageTypes; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21089 | local_pCallbackData = nullptr; |
| 21090 | if (pCallbackData) |
| 21091 | { |
| 21092 | local_pCallbackData = (VkDebugUtilsMessengerCallbackDataEXT*)pool->alloc(sizeof(const VkDebugUtilsMessengerCallbackDataEXT)); |
| 21093 | deepcopy_VkDebugUtilsMessengerCallbackDataEXT(pool, pCallbackData, (VkDebugUtilsMessengerCallbackDataEXT*)(local_pCallbackData)); |
| 21094 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 21095 | if (local_pCallbackData) |
| 21096 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 21097 | transform_tohost_VkDebugUtilsMessengerCallbackDataEXT(mImpl->resources(), (VkDebugUtilsMessengerCallbackDataEXT*)(local_pCallbackData)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 21098 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21099 | countingStream->rewind(); |
| 21100 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21101 | uint64_t cgen_var_1415; |
| 21102 | countingStream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1415, 1); |
| 21103 | countingStream->write((uint64_t*)&cgen_var_1415, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21104 | countingStream->write((VkDebugUtilsMessageSeverityFlagBitsEXT*)&local_messageSeverity, sizeof(VkDebugUtilsMessageSeverityFlagBitsEXT)); |
| 21105 | countingStream->write((VkDebugUtilsMessageTypeFlagsEXT*)&local_messageTypes, sizeof(VkDebugUtilsMessageTypeFlagsEXT)); |
| 21106 | marshal_VkDebugUtilsMessengerCallbackDataEXT(countingStream, (VkDebugUtilsMessengerCallbackDataEXT*)(local_pCallbackData)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21107 | } |
| 21108 | uint32_t packetSize_vkSubmitDebugUtilsMessageEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 21109 | countingStream->rewind(); |
| 21110 | uint32_t opcode_vkSubmitDebugUtilsMessageEXT = OP_vkSubmitDebugUtilsMessageEXT; |
| 21111 | stream->write(&opcode_vkSubmitDebugUtilsMessageEXT, sizeof(uint32_t)); |
| 21112 | stream->write(&packetSize_vkSubmitDebugUtilsMessageEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21113 | uint64_t cgen_var_1416; |
| 21114 | stream->handleMapping()->mapHandles_VkInstance_u64(&local_instance, &cgen_var_1416, 1); |
| 21115 | stream->write((uint64_t*)&cgen_var_1416, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21116 | stream->write((VkDebugUtilsMessageSeverityFlagBitsEXT*)&local_messageSeverity, sizeof(VkDebugUtilsMessageSeverityFlagBitsEXT)); |
| 21117 | stream->write((VkDebugUtilsMessageTypeFlagsEXT*)&local_messageTypes, sizeof(VkDebugUtilsMessageTypeFlagsEXT)); |
| 21118 | marshal_VkDebugUtilsMessengerCallbackDataEXT(stream, (VkDebugUtilsMessengerCallbackDataEXT*)(local_pCallbackData)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 21119 | pool->freeAll(); |
| 21120 | countingStream->clearPool(); |
| 21121 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 21122 | mImpl->log("finish vkSubmitDebugUtilsMessageEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21123 | } |
| 21124 | |
| 21125 | #endif |
| 21126 | #ifdef VK_ANDROID_external_memory_android_hardware_buffer |
| 21127 | VkResult VkEncoder::vkGetAndroidHardwareBufferPropertiesANDROID( |
| 21128 | VkDevice device, |
| 21129 | const AHardwareBuffer* buffer, |
| 21130 | VkAndroidHardwareBufferPropertiesANDROID* pProperties) |
| 21131 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 21132 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 21133 | mImpl->log("start vkGetAndroidHardwareBufferPropertiesANDROID"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21134 | auto stream = mImpl->stream(); |
| 21135 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21136 | auto resources = mImpl->resources(); |
| 21137 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 21138 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21139 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21140 | AHardwareBuffer* local_buffer; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 21141 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21142 | local_buffer = nullptr; |
| 21143 | if (buffer) |
| 21144 | { |
| 21145 | local_buffer = (AHardwareBuffer*)pool->dupArray(buffer, sizeof(const AHardwareBuffer)); |
| 21146 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21147 | countingStream->rewind(); |
| 21148 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21149 | uint64_t cgen_var_1417; |
| 21150 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1417, 1); |
| 21151 | countingStream->write((uint64_t*)&cgen_var_1417, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21152 | countingStream->write((AHardwareBuffer*)local_buffer, sizeof(AHardwareBuffer)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21153 | marshal_VkAndroidHardwareBufferPropertiesANDROID(countingStream, (VkAndroidHardwareBufferPropertiesANDROID*)(pProperties)); |
| 21154 | } |
| 21155 | uint32_t packetSize_vkGetAndroidHardwareBufferPropertiesANDROID = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 21156 | countingStream->rewind(); |
| 21157 | uint32_t opcode_vkGetAndroidHardwareBufferPropertiesANDROID = OP_vkGetAndroidHardwareBufferPropertiesANDROID; |
| 21158 | stream->write(&opcode_vkGetAndroidHardwareBufferPropertiesANDROID, sizeof(uint32_t)); |
| 21159 | stream->write(&packetSize_vkGetAndroidHardwareBufferPropertiesANDROID, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21160 | uint64_t cgen_var_1418; |
| 21161 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1418, 1); |
| 21162 | stream->write((uint64_t*)&cgen_var_1418, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21163 | stream->write((AHardwareBuffer*)local_buffer, sizeof(AHardwareBuffer)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21164 | marshal_VkAndroidHardwareBufferPropertiesANDROID(stream, (VkAndroidHardwareBufferPropertiesANDROID*)(pProperties)); |
| 21165 | unmarshal_VkAndroidHardwareBufferPropertiesANDROID(stream, (VkAndroidHardwareBufferPropertiesANDROID*)(pProperties)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 21166 | if (pProperties) |
| 21167 | { |
| 21168 | transform_fromhost_VkAndroidHardwareBufferPropertiesANDROID(mImpl->resources(), (VkAndroidHardwareBufferPropertiesANDROID*)(pProperties)); |
| 21169 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21170 | VkResult vkGetAndroidHardwareBufferPropertiesANDROID_VkResult_return = (VkResult)0; |
| 21171 | stream->read(&vkGetAndroidHardwareBufferPropertiesANDROID_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 21172 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 21173 | countingStream->clearPool(); |
| 21174 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 21175 | mImpl->log("finish vkGetAndroidHardwareBufferPropertiesANDROID");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21176 | return vkGetAndroidHardwareBufferPropertiesANDROID_VkResult_return; |
| 21177 | } |
| 21178 | |
| 21179 | VkResult VkEncoder::vkGetMemoryAndroidHardwareBufferANDROID( |
| 21180 | VkDevice device, |
| 21181 | const VkMemoryGetAndroidHardwareBufferInfoANDROID* pInfo, |
| 21182 | AHardwareBuffer** pBuffer) |
| 21183 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 21184 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 21185 | mImpl->log("start vkGetMemoryAndroidHardwareBufferANDROID"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21186 | auto stream = mImpl->stream(); |
| 21187 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21188 | auto resources = mImpl->resources(); |
| 21189 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 21190 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21191 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21192 | VkMemoryGetAndroidHardwareBufferInfoANDROID* local_pInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 21193 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21194 | local_pInfo = nullptr; |
| 21195 | if (pInfo) |
| 21196 | { |
| 21197 | local_pInfo = (VkMemoryGetAndroidHardwareBufferInfoANDROID*)pool->alloc(sizeof(const VkMemoryGetAndroidHardwareBufferInfoANDROID)); |
| 21198 | deepcopy_VkMemoryGetAndroidHardwareBufferInfoANDROID(pool, pInfo, (VkMemoryGetAndroidHardwareBufferInfoANDROID*)(local_pInfo)); |
| 21199 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 21200 | if (local_pInfo) |
| 21201 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 21202 | transform_tohost_VkMemoryGetAndroidHardwareBufferInfoANDROID(mImpl->resources(), (VkMemoryGetAndroidHardwareBufferInfoANDROID*)(local_pInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 21203 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21204 | countingStream->rewind(); |
| 21205 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21206 | uint64_t cgen_var_1419; |
| 21207 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1419, 1); |
| 21208 | countingStream->write((uint64_t*)&cgen_var_1419, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21209 | marshal_VkMemoryGetAndroidHardwareBufferInfoANDROID(countingStream, (VkMemoryGetAndroidHardwareBufferInfoANDROID*)(local_pInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21210 | countingStream->write((AHardwareBuffer**)pBuffer, sizeof(AHardwareBuffer*)); |
| 21211 | } |
| 21212 | uint32_t packetSize_vkGetMemoryAndroidHardwareBufferANDROID = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 21213 | countingStream->rewind(); |
| 21214 | uint32_t opcode_vkGetMemoryAndroidHardwareBufferANDROID = OP_vkGetMemoryAndroidHardwareBufferANDROID; |
| 21215 | stream->write(&opcode_vkGetMemoryAndroidHardwareBufferANDROID, sizeof(uint32_t)); |
| 21216 | stream->write(&packetSize_vkGetMemoryAndroidHardwareBufferANDROID, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21217 | uint64_t cgen_var_1420; |
| 21218 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1420, 1); |
| 21219 | stream->write((uint64_t*)&cgen_var_1420, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21220 | marshal_VkMemoryGetAndroidHardwareBufferInfoANDROID(stream, (VkMemoryGetAndroidHardwareBufferInfoANDROID*)(local_pInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21221 | stream->write((AHardwareBuffer**)pBuffer, sizeof(AHardwareBuffer*)); |
| 21222 | stream->read((AHardwareBuffer**)pBuffer, sizeof(AHardwareBuffer*)); |
| 21223 | VkResult vkGetMemoryAndroidHardwareBufferANDROID_VkResult_return = (VkResult)0; |
| 21224 | stream->read(&vkGetMemoryAndroidHardwareBufferANDROID_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 21225 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 21226 | countingStream->clearPool(); |
| 21227 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 21228 | mImpl->log("finish vkGetMemoryAndroidHardwareBufferANDROID");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21229 | return vkGetMemoryAndroidHardwareBufferANDROID_VkResult_return; |
| 21230 | } |
| 21231 | |
| 21232 | #endif |
| 21233 | #ifdef VK_EXT_sampler_filter_minmax |
| 21234 | #endif |
| 21235 | #ifdef VK_AMD_gpu_shader_int16 |
| 21236 | #endif |
| 21237 | #ifdef VK_AMD_mixed_attachment_samples |
| 21238 | #endif |
| 21239 | #ifdef VK_AMD_shader_fragment_mask |
| 21240 | #endif |
| 21241 | #ifdef VK_EXT_shader_stencil_export |
| 21242 | #endif |
| 21243 | #ifdef VK_EXT_sample_locations |
| 21244 | void VkEncoder::vkCmdSetSampleLocationsEXT( |
| 21245 | VkCommandBuffer commandBuffer, |
| 21246 | const VkSampleLocationsInfoEXT* pSampleLocationsInfo) |
| 21247 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 21248 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 21249 | mImpl->log("start vkCmdSetSampleLocationsEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21250 | auto stream = mImpl->stream(); |
| 21251 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21252 | auto resources = mImpl->resources(); |
| 21253 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 21254 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21255 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21256 | VkSampleLocationsInfoEXT* local_pSampleLocationsInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 21257 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21258 | local_pSampleLocationsInfo = nullptr; |
| 21259 | if (pSampleLocationsInfo) |
| 21260 | { |
| 21261 | local_pSampleLocationsInfo = (VkSampleLocationsInfoEXT*)pool->alloc(sizeof(const VkSampleLocationsInfoEXT)); |
| 21262 | deepcopy_VkSampleLocationsInfoEXT(pool, pSampleLocationsInfo, (VkSampleLocationsInfoEXT*)(local_pSampleLocationsInfo)); |
| 21263 | } |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 21264 | if (local_pSampleLocationsInfo) |
| 21265 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 21266 | transform_tohost_VkSampleLocationsInfoEXT(mImpl->resources(), (VkSampleLocationsInfoEXT*)(local_pSampleLocationsInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 21267 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21268 | countingStream->rewind(); |
| 21269 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21270 | uint64_t cgen_var_1421; |
| 21271 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1421, 1); |
| 21272 | countingStream->write((uint64_t*)&cgen_var_1421, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21273 | marshal_VkSampleLocationsInfoEXT(countingStream, (VkSampleLocationsInfoEXT*)(local_pSampleLocationsInfo)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21274 | } |
| 21275 | uint32_t packetSize_vkCmdSetSampleLocationsEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 21276 | countingStream->rewind(); |
| 21277 | uint32_t opcode_vkCmdSetSampleLocationsEXT = OP_vkCmdSetSampleLocationsEXT; |
| 21278 | stream->write(&opcode_vkCmdSetSampleLocationsEXT, sizeof(uint32_t)); |
| 21279 | stream->write(&packetSize_vkCmdSetSampleLocationsEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21280 | uint64_t cgen_var_1422; |
| 21281 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1422, 1); |
| 21282 | stream->write((uint64_t*)&cgen_var_1422, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21283 | marshal_VkSampleLocationsInfoEXT(stream, (VkSampleLocationsInfoEXT*)(local_pSampleLocationsInfo)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 21284 | pool->freeAll(); |
| 21285 | countingStream->clearPool(); |
| 21286 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 21287 | mImpl->log("finish vkCmdSetSampleLocationsEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21288 | } |
| 21289 | |
| 21290 | void VkEncoder::vkGetPhysicalDeviceMultisamplePropertiesEXT( |
| 21291 | VkPhysicalDevice physicalDevice, |
| 21292 | VkSampleCountFlagBits samples, |
| 21293 | VkMultisamplePropertiesEXT* pMultisampleProperties) |
| 21294 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 21295 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 21296 | mImpl->log("start vkGetPhysicalDeviceMultisamplePropertiesEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21297 | auto stream = mImpl->stream(); |
| 21298 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21299 | auto resources = mImpl->resources(); |
| 21300 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 21301 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21302 | VkPhysicalDevice local_physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21303 | VkSampleCountFlagBits local_samples; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 21304 | local_physicalDevice = physicalDevice; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21305 | local_samples = samples; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21306 | countingStream->rewind(); |
| 21307 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21308 | uint64_t cgen_var_1423; |
| 21309 | countingStream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1423, 1); |
| 21310 | countingStream->write((uint64_t*)&cgen_var_1423, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21311 | countingStream->write((VkSampleCountFlagBits*)&local_samples, sizeof(VkSampleCountFlagBits)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21312 | marshal_VkMultisamplePropertiesEXT(countingStream, (VkMultisamplePropertiesEXT*)(pMultisampleProperties)); |
| 21313 | } |
| 21314 | uint32_t packetSize_vkGetPhysicalDeviceMultisamplePropertiesEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 21315 | countingStream->rewind(); |
| 21316 | uint32_t opcode_vkGetPhysicalDeviceMultisamplePropertiesEXT = OP_vkGetPhysicalDeviceMultisamplePropertiesEXT; |
| 21317 | stream->write(&opcode_vkGetPhysicalDeviceMultisamplePropertiesEXT, sizeof(uint32_t)); |
| 21318 | stream->write(&packetSize_vkGetPhysicalDeviceMultisamplePropertiesEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21319 | uint64_t cgen_var_1424; |
| 21320 | stream->handleMapping()->mapHandles_VkPhysicalDevice_u64(&local_physicalDevice, &cgen_var_1424, 1); |
| 21321 | stream->write((uint64_t*)&cgen_var_1424, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21322 | stream->write((VkSampleCountFlagBits*)&local_samples, sizeof(VkSampleCountFlagBits)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21323 | marshal_VkMultisamplePropertiesEXT(stream, (VkMultisamplePropertiesEXT*)(pMultisampleProperties)); |
| 21324 | unmarshal_VkMultisamplePropertiesEXT(stream, (VkMultisamplePropertiesEXT*)(pMultisampleProperties)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 21325 | if (pMultisampleProperties) |
| 21326 | { |
| 21327 | transform_fromhost_VkMultisamplePropertiesEXT(mImpl->resources(), (VkMultisamplePropertiesEXT*)(pMultisampleProperties)); |
| 21328 | } |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 21329 | pool->freeAll(); |
| 21330 | countingStream->clearPool(); |
| 21331 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 21332 | mImpl->log("finish vkGetPhysicalDeviceMultisamplePropertiesEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21333 | } |
| 21334 | |
| 21335 | #endif |
| 21336 | #ifdef VK_EXT_blend_operation_advanced |
| 21337 | #endif |
| 21338 | #ifdef VK_NV_fragment_coverage_to_color |
| 21339 | #endif |
| 21340 | #ifdef VK_NV_framebuffer_mixed_samples |
| 21341 | #endif |
| 21342 | #ifdef VK_NV_fill_rectangle |
| 21343 | #endif |
| 21344 | #ifdef VK_EXT_post_depth_coverage |
| 21345 | #endif |
| 21346 | #ifdef VK_EXT_validation_cache |
| 21347 | VkResult VkEncoder::vkCreateValidationCacheEXT( |
| 21348 | VkDevice device, |
| 21349 | const VkValidationCacheCreateInfoEXT* pCreateInfo, |
| 21350 | const VkAllocationCallbacks* pAllocator, |
| 21351 | VkValidationCacheEXT* pValidationCache) |
| 21352 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 21353 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 21354 | mImpl->log("start vkCreateValidationCacheEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21355 | auto stream = mImpl->stream(); |
| 21356 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21357 | auto resources = mImpl->resources(); |
| 21358 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 21359 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21360 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21361 | VkValidationCacheCreateInfoEXT* local_pCreateInfo; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 21362 | VkAllocationCallbacks* local_pAllocator; |
| 21363 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21364 | local_pCreateInfo = nullptr; |
| 21365 | if (pCreateInfo) |
| 21366 | { |
| 21367 | local_pCreateInfo = (VkValidationCacheCreateInfoEXT*)pool->alloc(sizeof(const VkValidationCacheCreateInfoEXT)); |
| 21368 | deepcopy_VkValidationCacheCreateInfoEXT(pool, pCreateInfo, (VkValidationCacheCreateInfoEXT*)(local_pCreateInfo)); |
| 21369 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21370 | local_pAllocator = nullptr; |
| 21371 | if (pAllocator) |
| 21372 | { |
| 21373 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 21374 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 21375 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 21376 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 21377 | if (local_pCreateInfo) |
| 21378 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 21379 | transform_tohost_VkValidationCacheCreateInfoEXT(mImpl->resources(), (VkValidationCacheCreateInfoEXT*)(local_pCreateInfo)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 21380 | } |
| 21381 | if (local_pAllocator) |
| 21382 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 21383 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 21384 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21385 | countingStream->rewind(); |
| 21386 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21387 | uint64_t cgen_var_1425; |
| 21388 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1425, 1); |
| 21389 | countingStream->write((uint64_t*)&cgen_var_1425, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21390 | marshal_VkValidationCacheCreateInfoEXT(countingStream, (VkValidationCacheCreateInfoEXT*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 21391 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21392 | uint64_t cgen_var_1426 = (uint64_t)(uintptr_t)local_pAllocator; |
| 21393 | countingStream->putBe64(cgen_var_1426); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21394 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21395 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21396 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21397 | } |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21398 | uint64_t cgen_var_1427; |
| 21399 | countingStream->handleMapping()->mapHandles_VkValidationCacheEXT_u64(pValidationCache, &cgen_var_1427, 1); |
| 21400 | countingStream->write((uint64_t*)&cgen_var_1427, 8); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21401 | } |
| 21402 | uint32_t packetSize_vkCreateValidationCacheEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 21403 | countingStream->rewind(); |
| 21404 | uint32_t opcode_vkCreateValidationCacheEXT = OP_vkCreateValidationCacheEXT; |
| 21405 | stream->write(&opcode_vkCreateValidationCacheEXT, sizeof(uint32_t)); |
| 21406 | stream->write(&packetSize_vkCreateValidationCacheEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21407 | uint64_t cgen_var_1428; |
| 21408 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1428, 1); |
| 21409 | stream->write((uint64_t*)&cgen_var_1428, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21410 | marshal_VkValidationCacheCreateInfoEXT(stream, (VkValidationCacheCreateInfoEXT*)(local_pCreateInfo)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 21411 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21412 | uint64_t cgen_var_1429 = (uint64_t)(uintptr_t)local_pAllocator; |
| 21413 | stream->putBe64(cgen_var_1429); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21414 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21415 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21416 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21417 | } |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 21418 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21419 | uint64_t cgen_var_1430; |
| 21420 | stream->handleMapping()->mapHandles_VkValidationCacheEXT_u64(pValidationCache, &cgen_var_1430, 1); |
| 21421 | stream->write((uint64_t*)&cgen_var_1430, 8); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 21422 | stream->setHandleMapping(resources->unwrapMapping()); |
| 21423 | stream->setHandleMapping(resources->createMapping()); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21424 | uint64_t cgen_var_1431; |
| 21425 | stream->read((uint64_t*)&cgen_var_1431, 8); |
| 21426 | stream->handleMapping()->mapHandles_u64_VkValidationCacheEXT(&cgen_var_1431, (VkValidationCacheEXT*)pValidationCache, 1); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 21427 | stream->unsetHandleMapping(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21428 | VkResult vkCreateValidationCacheEXT_VkResult_return = (VkResult)0; |
| 21429 | stream->read(&vkCreateValidationCacheEXT_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 21430 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 21431 | countingStream->clearPool(); |
| 21432 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 21433 | mImpl->log("finish vkCreateValidationCacheEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21434 | return vkCreateValidationCacheEXT_VkResult_return; |
| 21435 | } |
| 21436 | |
| 21437 | void VkEncoder::vkDestroyValidationCacheEXT( |
| 21438 | VkDevice device, |
| 21439 | VkValidationCacheEXT validationCache, |
| 21440 | const VkAllocationCallbacks* pAllocator) |
| 21441 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 21442 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 21443 | mImpl->log("start vkDestroyValidationCacheEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21444 | auto stream = mImpl->stream(); |
| 21445 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21446 | auto resources = mImpl->resources(); |
| 21447 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 21448 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21449 | VkDevice local_device; |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 21450 | VkValidationCacheEXT local_validationCache; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21451 | VkAllocationCallbacks* local_pAllocator; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 21452 | local_device = device; |
| 21453 | local_validationCache = validationCache; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21454 | local_pAllocator = nullptr; |
| 21455 | if (pAllocator) |
| 21456 | { |
| 21457 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 21458 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 21459 | } |
| Lingfeng Yang | 9d02e10 | 2018-11-10 01:51:46 -0800 | [diff] [blame] | 21460 | local_pAllocator = nullptr; |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 21461 | if (local_pAllocator) |
| 21462 | { |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 21463 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | 62b2332 | 2018-12-24 12:45:47 -0800 | [diff] [blame] | 21464 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21465 | countingStream->rewind(); |
| 21466 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21467 | uint64_t cgen_var_1432; |
| 21468 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1432, 1); |
| 21469 | countingStream->write((uint64_t*)&cgen_var_1432, 1 * 8); |
| 21470 | uint64_t cgen_var_1433; |
| 21471 | countingStream->handleMapping()->mapHandles_VkValidationCacheEXT_u64(&local_validationCache, &cgen_var_1433, 1); |
| 21472 | countingStream->write((uint64_t*)&cgen_var_1433, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 21473 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21474 | uint64_t cgen_var_1434 = (uint64_t)(uintptr_t)local_pAllocator; |
| 21475 | countingStream->putBe64(cgen_var_1434); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21476 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21477 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21478 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21479 | } |
| 21480 | } |
| 21481 | uint32_t packetSize_vkDestroyValidationCacheEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 21482 | countingStream->rewind(); |
| 21483 | uint32_t opcode_vkDestroyValidationCacheEXT = OP_vkDestroyValidationCacheEXT; |
| 21484 | stream->write(&opcode_vkDestroyValidationCacheEXT, sizeof(uint32_t)); |
| 21485 | stream->write(&packetSize_vkDestroyValidationCacheEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21486 | uint64_t cgen_var_1435; |
| 21487 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1435, 1); |
| 21488 | stream->write((uint64_t*)&cgen_var_1435, 1 * 8); |
| 21489 | uint64_t cgen_var_1436; |
| 21490 | stream->handleMapping()->mapHandles_VkValidationCacheEXT_u64(&local_validationCache, &cgen_var_1436, 1); |
| 21491 | stream->write((uint64_t*)&cgen_var_1436, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 21492 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21493 | uint64_t cgen_var_1437 = (uint64_t)(uintptr_t)local_pAllocator; |
| 21494 | stream->putBe64(cgen_var_1437); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21495 | if (local_pAllocator) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21496 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21497 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21498 | } |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21499 | resources->destroyMapping()->mapHandles_VkValidationCacheEXT((VkValidationCacheEXT*)&validationCache); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 21500 | pool->freeAll(); |
| 21501 | countingStream->clearPool(); |
| 21502 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 21503 | mImpl->log("finish vkDestroyValidationCacheEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21504 | } |
| 21505 | |
| 21506 | VkResult VkEncoder::vkMergeValidationCachesEXT( |
| 21507 | VkDevice device, |
| 21508 | VkValidationCacheEXT dstCache, |
| 21509 | uint32_t srcCacheCount, |
| 21510 | const VkValidationCacheEXT* pSrcCaches) |
| 21511 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 21512 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 21513 | mImpl->log("start vkMergeValidationCachesEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21514 | auto stream = mImpl->stream(); |
| 21515 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21516 | auto resources = mImpl->resources(); |
| 21517 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 21518 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21519 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21520 | VkValidationCacheEXT local_dstCache; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21521 | uint32_t local_srcCacheCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21522 | VkValidationCacheEXT* local_pSrcCaches; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 21523 | local_device = device; |
| 21524 | local_dstCache = dstCache; |
| 21525 | local_srcCacheCount = srcCacheCount; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21526 | local_pSrcCaches = nullptr; |
| 21527 | if (pSrcCaches) |
| 21528 | { |
| 21529 | local_pSrcCaches = (VkValidationCacheEXT*)pool->dupArray(pSrcCaches, ((srcCacheCount)) * sizeof(const VkValidationCacheEXT)); |
| 21530 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21531 | countingStream->rewind(); |
| 21532 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21533 | uint64_t cgen_var_1438; |
| 21534 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1438, 1); |
| 21535 | countingStream->write((uint64_t*)&cgen_var_1438, 1 * 8); |
| 21536 | uint64_t cgen_var_1439; |
| 21537 | countingStream->handleMapping()->mapHandles_VkValidationCacheEXT_u64(&local_dstCache, &cgen_var_1439, 1); |
| 21538 | countingStream->write((uint64_t*)&cgen_var_1439, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21539 | countingStream->write((uint32_t*)&local_srcCacheCount, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 21540 | if (((srcCacheCount))) |
| 21541 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21542 | uint64_t* cgen_var_1440; |
| 21543 | countingStream->alloc((void**)&cgen_var_1440, ((srcCacheCount)) * 8); |
| 21544 | countingStream->handleMapping()->mapHandles_VkValidationCacheEXT_u64(local_pSrcCaches, cgen_var_1440, ((srcCacheCount))); |
| 21545 | countingStream->write((uint64_t*)cgen_var_1440, ((srcCacheCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 21546 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21547 | } |
| 21548 | uint32_t packetSize_vkMergeValidationCachesEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 21549 | countingStream->rewind(); |
| 21550 | uint32_t opcode_vkMergeValidationCachesEXT = OP_vkMergeValidationCachesEXT; |
| 21551 | stream->write(&opcode_vkMergeValidationCachesEXT, sizeof(uint32_t)); |
| 21552 | stream->write(&packetSize_vkMergeValidationCachesEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21553 | uint64_t cgen_var_1441; |
| 21554 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1441, 1); |
| 21555 | stream->write((uint64_t*)&cgen_var_1441, 1 * 8); |
| 21556 | uint64_t cgen_var_1442; |
| 21557 | stream->handleMapping()->mapHandles_VkValidationCacheEXT_u64(&local_dstCache, &cgen_var_1442, 1); |
| 21558 | stream->write((uint64_t*)&cgen_var_1442, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21559 | stream->write((uint32_t*)&local_srcCacheCount, sizeof(uint32_t)); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 21560 | if (((srcCacheCount))) |
| 21561 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21562 | uint64_t* cgen_var_1443; |
| 21563 | stream->alloc((void**)&cgen_var_1443, ((srcCacheCount)) * 8); |
| 21564 | stream->handleMapping()->mapHandles_VkValidationCacheEXT_u64(local_pSrcCaches, cgen_var_1443, ((srcCacheCount))); |
| 21565 | stream->write((uint64_t*)cgen_var_1443, ((srcCacheCount)) * 8); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 21566 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21567 | VkResult vkMergeValidationCachesEXT_VkResult_return = (VkResult)0; |
| 21568 | stream->read(&vkMergeValidationCachesEXT_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 21569 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 21570 | countingStream->clearPool(); |
| 21571 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 21572 | mImpl->log("finish vkMergeValidationCachesEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21573 | return vkMergeValidationCachesEXT_VkResult_return; |
| 21574 | } |
| 21575 | |
| 21576 | VkResult VkEncoder::vkGetValidationCacheDataEXT( |
| 21577 | VkDevice device, |
| 21578 | VkValidationCacheEXT validationCache, |
| 21579 | size_t* pDataSize, |
| 21580 | void* pData) |
| 21581 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 21582 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 21583 | mImpl->log("start vkGetValidationCacheDataEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21584 | auto stream = mImpl->stream(); |
| 21585 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21586 | auto resources = mImpl->resources(); |
| 21587 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 21588 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21589 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21590 | VkValidationCacheEXT local_validationCache; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 21591 | local_device = device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21592 | local_validationCache = validationCache; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21593 | countingStream->rewind(); |
| 21594 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21595 | uint64_t cgen_var_1444; |
| 21596 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1444, 1); |
| 21597 | countingStream->write((uint64_t*)&cgen_var_1444, 1 * 8); |
| 21598 | uint64_t cgen_var_1445; |
| 21599 | countingStream->handleMapping()->mapHandles_VkValidationCacheEXT_u64(&local_validationCache, &cgen_var_1445, 1); |
| 21600 | countingStream->write((uint64_t*)&cgen_var_1445, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 21601 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21602 | uint64_t cgen_var_1446 = (uint64_t)(uintptr_t)pDataSize; |
| 21603 | countingStream->putBe64(cgen_var_1446); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21604 | if (pDataSize) |
| 21605 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21606 | uint64_t cgen_var_1447 = (uint64_t)(*pDataSize); |
| 21607 | countingStream->putBe64(cgen_var_1447); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21608 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 21609 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21610 | uint64_t cgen_var_1448 = (uint64_t)(uintptr_t)pData; |
| 21611 | countingStream->putBe64(cgen_var_1448); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21612 | if (pData) |
| 21613 | { |
| 21614 | countingStream->write((void*)pData, (*(pDataSize)) * sizeof(uint8_t)); |
| 21615 | } |
| 21616 | } |
| 21617 | uint32_t packetSize_vkGetValidationCacheDataEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 21618 | countingStream->rewind(); |
| 21619 | uint32_t opcode_vkGetValidationCacheDataEXT = OP_vkGetValidationCacheDataEXT; |
| 21620 | stream->write(&opcode_vkGetValidationCacheDataEXT, sizeof(uint32_t)); |
| 21621 | stream->write(&packetSize_vkGetValidationCacheDataEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21622 | uint64_t cgen_var_1449; |
| 21623 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1449, 1); |
| 21624 | stream->write((uint64_t*)&cgen_var_1449, 1 * 8); |
| 21625 | uint64_t cgen_var_1450; |
| 21626 | stream->handleMapping()->mapHandles_VkValidationCacheEXT_u64(&local_validationCache, &cgen_var_1450, 1); |
| 21627 | stream->write((uint64_t*)&cgen_var_1450, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 21628 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21629 | uint64_t cgen_var_1451 = (uint64_t)(uintptr_t)pDataSize; |
| 21630 | stream->putBe64(cgen_var_1451); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21631 | if (pDataSize) |
| 21632 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21633 | uint64_t cgen_var_1452 = (uint64_t)(*pDataSize); |
| 21634 | stream->putBe64(cgen_var_1452); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21635 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 21636 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21637 | uint64_t cgen_var_1453 = (uint64_t)(uintptr_t)pData; |
| 21638 | stream->putBe64(cgen_var_1453); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21639 | if (pData) |
| 21640 | { |
| 21641 | stream->write((void*)pData, (*(pDataSize)) * sizeof(uint8_t)); |
| 21642 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 21643 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21644 | size_t* check_pDataSize; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 21645 | check_pDataSize = (size_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21646 | if (pDataSize) |
| 21647 | { |
| 21648 | if (!(check_pDataSize)) |
| 21649 | { |
| 21650 | fprintf(stderr, "fatal: pDataSize inconsistent between guest and host\n"); |
| 21651 | } |
| Lingfeng Yang | fddc0de | 2018-11-27 22:26:51 -0800 | [diff] [blame] | 21652 | (*pDataSize) = (size_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21653 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 21654 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21655 | void* check_pData; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 21656 | check_pData = (void*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21657 | if (pData) |
| 21658 | { |
| 21659 | if (!(check_pData)) |
| 21660 | { |
| 21661 | fprintf(stderr, "fatal: pData inconsistent between guest and host\n"); |
| 21662 | } |
| 21663 | stream->read((void*)pData, (*(pDataSize)) * sizeof(uint8_t)); |
| 21664 | } |
| 21665 | VkResult vkGetValidationCacheDataEXT_VkResult_return = (VkResult)0; |
| 21666 | stream->read(&vkGetValidationCacheDataEXT_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 21667 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 21668 | countingStream->clearPool(); |
| 21669 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 21670 | mImpl->log("finish vkGetValidationCacheDataEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21671 | return vkGetValidationCacheDataEXT_VkResult_return; |
| 21672 | } |
| 21673 | |
| 21674 | #endif |
| 21675 | #ifdef VK_EXT_descriptor_indexing |
| 21676 | #endif |
| 21677 | #ifdef VK_EXT_shader_viewport_index_layer |
| 21678 | #endif |
| 21679 | #ifdef VK_EXT_global_priority |
| 21680 | #endif |
| 21681 | #ifdef VK_EXT_external_memory_host |
| 21682 | VkResult VkEncoder::vkGetMemoryHostPointerPropertiesEXT( |
| 21683 | VkDevice device, |
| 21684 | VkExternalMemoryHandleTypeFlagBits handleType, |
| 21685 | const void* pHostPointer, |
| 21686 | VkMemoryHostPointerPropertiesEXT* pMemoryHostPointerProperties) |
| 21687 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 21688 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 21689 | mImpl->log("start vkGetMemoryHostPointerPropertiesEXT"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21690 | auto stream = mImpl->stream(); |
| 21691 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21692 | auto resources = mImpl->resources(); |
| 21693 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 21694 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21695 | VkDevice local_device; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21696 | VkExternalMemoryHandleTypeFlagBits local_handleType; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21697 | void* local_pHostPointer; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 21698 | local_device = device; |
| 21699 | local_handleType = handleType; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21700 | local_pHostPointer = nullptr; |
| 21701 | if (pHostPointer) |
| 21702 | { |
| 21703 | local_pHostPointer = (void*)pool->dupArray(pHostPointer, sizeof(const uint8_t)); |
| 21704 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21705 | countingStream->rewind(); |
| 21706 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21707 | uint64_t cgen_var_1457; |
| 21708 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1457, 1); |
| 21709 | countingStream->write((uint64_t*)&cgen_var_1457, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21710 | countingStream->write((VkExternalMemoryHandleTypeFlagBits*)&local_handleType, sizeof(VkExternalMemoryHandleTypeFlagBits)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 21711 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21712 | uint64_t cgen_var_1458 = (uint64_t)(uintptr_t)local_pHostPointer; |
| 21713 | countingStream->putBe64(cgen_var_1458); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21714 | if (local_pHostPointer) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21715 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21716 | countingStream->write((void*)local_pHostPointer, sizeof(uint8_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21717 | } |
| 21718 | marshal_VkMemoryHostPointerPropertiesEXT(countingStream, (VkMemoryHostPointerPropertiesEXT*)(pMemoryHostPointerProperties)); |
| 21719 | } |
| 21720 | uint32_t packetSize_vkGetMemoryHostPointerPropertiesEXT = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 21721 | countingStream->rewind(); |
| 21722 | uint32_t opcode_vkGetMemoryHostPointerPropertiesEXT = OP_vkGetMemoryHostPointerPropertiesEXT; |
| 21723 | stream->write(&opcode_vkGetMemoryHostPointerPropertiesEXT, sizeof(uint32_t)); |
| 21724 | stream->write(&packetSize_vkGetMemoryHostPointerPropertiesEXT, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21725 | uint64_t cgen_var_1459; |
| 21726 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1459, 1); |
| 21727 | stream->write((uint64_t*)&cgen_var_1459, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21728 | stream->write((VkExternalMemoryHandleTypeFlagBits*)&local_handleType, sizeof(VkExternalMemoryHandleTypeFlagBits)); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 21729 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21730 | uint64_t cgen_var_1460 = (uint64_t)(uintptr_t)local_pHostPointer; |
| 21731 | stream->putBe64(cgen_var_1460); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21732 | if (local_pHostPointer) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21733 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21734 | stream->write((void*)local_pHostPointer, sizeof(uint8_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21735 | } |
| 21736 | marshal_VkMemoryHostPointerPropertiesEXT(stream, (VkMemoryHostPointerPropertiesEXT*)(pMemoryHostPointerProperties)); |
| 21737 | unmarshal_VkMemoryHostPointerPropertiesEXT(stream, (VkMemoryHostPointerPropertiesEXT*)(pMemoryHostPointerProperties)); |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 21738 | if (pMemoryHostPointerProperties) |
| 21739 | { |
| 21740 | transform_fromhost_VkMemoryHostPointerPropertiesEXT(mImpl->resources(), (VkMemoryHostPointerPropertiesEXT*)(pMemoryHostPointerProperties)); |
| 21741 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21742 | VkResult vkGetMemoryHostPointerPropertiesEXT_VkResult_return = (VkResult)0; |
| 21743 | stream->read(&vkGetMemoryHostPointerPropertiesEXT_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 21744 | pool->freeAll(); |
| Lingfeng Yang | 2285df1 | 2018-11-17 16:25:11 -0800 | [diff] [blame] | 21745 | countingStream->clearPool(); |
| 21746 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 21747 | mImpl->log("finish vkGetMemoryHostPointerPropertiesEXT");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21748 | return vkGetMemoryHostPointerPropertiesEXT_VkResult_return; |
| 21749 | } |
| 21750 | |
| 21751 | #endif |
| 21752 | #ifdef VK_AMD_buffer_marker |
| 21753 | void VkEncoder::vkCmdWriteBufferMarkerAMD( |
| 21754 | VkCommandBuffer commandBuffer, |
| 21755 | VkPipelineStageFlagBits pipelineStage, |
| 21756 | VkBuffer dstBuffer, |
| 21757 | VkDeviceSize dstOffset, |
| 21758 | uint32_t marker) |
| 21759 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 21760 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 21761 | mImpl->log("start vkCmdWriteBufferMarkerAMD"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21762 | auto stream = mImpl->stream(); |
| 21763 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21764 | auto resources = mImpl->resources(); |
| 21765 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 21766 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21767 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21768 | VkPipelineStageFlagBits local_pipelineStage; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21769 | VkBuffer local_dstBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21770 | VkDeviceSize local_dstOffset; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21771 | uint32_t local_marker; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 21772 | local_commandBuffer = commandBuffer; |
| 21773 | local_pipelineStage = pipelineStage; |
| 21774 | local_dstBuffer = dstBuffer; |
| 21775 | local_dstOffset = dstOffset; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21776 | local_marker = marker; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21777 | countingStream->rewind(); |
| 21778 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21779 | uint64_t cgen_var_1461; |
| 21780 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1461, 1); |
| 21781 | countingStream->write((uint64_t*)&cgen_var_1461, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21782 | countingStream->write((VkPipelineStageFlagBits*)&local_pipelineStage, sizeof(VkPipelineStageFlagBits)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21783 | uint64_t cgen_var_1462; |
| 21784 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_dstBuffer, &cgen_var_1462, 1); |
| 21785 | countingStream->write((uint64_t*)&cgen_var_1462, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21786 | countingStream->write((VkDeviceSize*)&local_dstOffset, sizeof(VkDeviceSize)); |
| 21787 | countingStream->write((uint32_t*)&local_marker, sizeof(uint32_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21788 | } |
| 21789 | uint32_t packetSize_vkCmdWriteBufferMarkerAMD = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 21790 | countingStream->rewind(); |
| 21791 | uint32_t opcode_vkCmdWriteBufferMarkerAMD = OP_vkCmdWriteBufferMarkerAMD; |
| 21792 | stream->write(&opcode_vkCmdWriteBufferMarkerAMD, sizeof(uint32_t)); |
| 21793 | stream->write(&packetSize_vkCmdWriteBufferMarkerAMD, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21794 | uint64_t cgen_var_1463; |
| 21795 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1463, 1); |
| 21796 | stream->write((uint64_t*)&cgen_var_1463, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21797 | stream->write((VkPipelineStageFlagBits*)&local_pipelineStage, sizeof(VkPipelineStageFlagBits)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21798 | uint64_t cgen_var_1464; |
| 21799 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_dstBuffer, &cgen_var_1464, 1); |
| 21800 | stream->write((uint64_t*)&cgen_var_1464, 1 * 8); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21801 | stream->write((VkDeviceSize*)&local_dstOffset, sizeof(VkDeviceSize)); |
| 21802 | stream->write((uint32_t*)&local_marker, sizeof(uint32_t)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 21803 | pool->freeAll(); |
| 21804 | countingStream->clearPool(); |
| 21805 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 21806 | mImpl->log("finish vkCmdWriteBufferMarkerAMD");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21807 | } |
| 21808 | |
| 21809 | #endif |
| 21810 | #ifdef VK_AMD_shader_core_properties |
| 21811 | #endif |
| 21812 | #ifdef VK_EXT_vertex_attribute_divisor |
| 21813 | #endif |
| 21814 | #ifdef VK_NV_shader_subgroup_partitioned |
| 21815 | #endif |
| 21816 | #ifdef VK_NV_device_diagnostic_checkpoints |
| 21817 | void VkEncoder::vkCmdSetCheckpointNV( |
| 21818 | VkCommandBuffer commandBuffer, |
| 21819 | const void* pCheckpointMarker) |
| 21820 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 21821 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 21822 | mImpl->log("start vkCmdSetCheckpointNV"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21823 | auto stream = mImpl->stream(); |
| 21824 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21825 | auto resources = mImpl->resources(); |
| 21826 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 21827 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21828 | VkCommandBuffer local_commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21829 | void* local_pCheckpointMarker; |
| Lingfeng Yang | 9666b85 | 2018-11-13 23:09:59 -0800 | [diff] [blame] | 21830 | local_commandBuffer = commandBuffer; |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21831 | local_pCheckpointMarker = nullptr; |
| 21832 | if (pCheckpointMarker) |
| 21833 | { |
| 21834 | local_pCheckpointMarker = (void*)pool->dupArray(pCheckpointMarker, sizeof(const uint8_t)); |
| 21835 | } |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21836 | countingStream->rewind(); |
| 21837 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21838 | uint64_t cgen_var_1465; |
| 21839 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1465, 1); |
| 21840 | countingStream->write((uint64_t*)&cgen_var_1465, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 21841 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21842 | uint64_t cgen_var_1466 = (uint64_t)(uintptr_t)local_pCheckpointMarker; |
| 21843 | countingStream->putBe64(cgen_var_1466); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21844 | if (local_pCheckpointMarker) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21845 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21846 | countingStream->write((void*)local_pCheckpointMarker, sizeof(uint8_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21847 | } |
| 21848 | } |
| 21849 | uint32_t packetSize_vkCmdSetCheckpointNV = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 21850 | countingStream->rewind(); |
| 21851 | uint32_t opcode_vkCmdSetCheckpointNV = OP_vkCmdSetCheckpointNV; |
| 21852 | stream->write(&opcode_vkCmdSetCheckpointNV, sizeof(uint32_t)); |
| 21853 | stream->write(&packetSize_vkCmdSetCheckpointNV, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21854 | uint64_t cgen_var_1467; |
| 21855 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1467, 1); |
| 21856 | stream->write((uint64_t*)&cgen_var_1467, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 21857 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21858 | uint64_t cgen_var_1468 = (uint64_t)(uintptr_t)local_pCheckpointMarker; |
| 21859 | stream->putBe64(cgen_var_1468); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21860 | if (local_pCheckpointMarker) |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21861 | { |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21862 | stream->write((void*)local_pCheckpointMarker, sizeof(uint8_t)); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21863 | } |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 21864 | pool->freeAll(); |
| 21865 | countingStream->clearPool(); |
| 21866 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 21867 | mImpl->log("finish vkCmdSetCheckpointNV");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21868 | } |
| 21869 | |
| 21870 | void VkEncoder::vkGetQueueCheckpointDataNV( |
| 21871 | VkQueue queue, |
| 21872 | uint32_t* pCheckpointDataCount, |
| 21873 | VkCheckpointDataNV* pCheckpointData) |
| 21874 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 21875 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 21876 | mImpl->log("start vkGetQueueCheckpointDataNV"); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21877 | auto stream = mImpl->stream(); |
| 21878 | auto countingStream = mImpl->countingStream(); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21879 | auto resources = mImpl->resources(); |
| 21880 | auto pool = mImpl->pool(); |
| Lingfeng Yang | e4008a0 | 2018-11-18 12:22:48 -0800 | [diff] [blame] | 21881 | stream->setHandleMapping(resources->unwrapMapping()); |
| Lingfeng Yang | 71b596b | 2018-11-07 18:03:25 -0800 | [diff] [blame] | 21882 | VkQueue local_queue; |
| 21883 | local_queue = queue; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21884 | countingStream->rewind(); |
| 21885 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21886 | uint64_t cgen_var_1469; |
| 21887 | countingStream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_1469, 1); |
| 21888 | countingStream->write((uint64_t*)&cgen_var_1469, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 21889 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21890 | uint64_t cgen_var_1470 = (uint64_t)(uintptr_t)pCheckpointDataCount; |
| 21891 | countingStream->putBe64(cgen_var_1470); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21892 | if (pCheckpointDataCount) |
| 21893 | { |
| 21894 | countingStream->write((uint32_t*)pCheckpointDataCount, sizeof(uint32_t)); |
| 21895 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 21896 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21897 | uint64_t cgen_var_1471 = (uint64_t)(uintptr_t)pCheckpointData; |
| 21898 | countingStream->putBe64(cgen_var_1471); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21899 | if (pCheckpointData) |
| 21900 | { |
| 21901 | for (uint32_t i = 0; i < (uint32_t)(*(pCheckpointDataCount)); ++i) |
| 21902 | { |
| 21903 | marshal_VkCheckpointDataNV(countingStream, (VkCheckpointDataNV*)(pCheckpointData + i)); |
| 21904 | } |
| 21905 | } |
| 21906 | } |
| 21907 | uint32_t packetSize_vkGetQueueCheckpointDataNV = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 21908 | countingStream->rewind(); |
| 21909 | uint32_t opcode_vkGetQueueCheckpointDataNV = OP_vkGetQueueCheckpointDataNV; |
| 21910 | stream->write(&opcode_vkGetQueueCheckpointDataNV, sizeof(uint32_t)); |
| 21911 | stream->write(&packetSize_vkGetQueueCheckpointDataNV, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21912 | uint64_t cgen_var_1472; |
| 21913 | stream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_1472, 1); |
| 21914 | stream->write((uint64_t*)&cgen_var_1472, 1 * 8); |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 21915 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21916 | uint64_t cgen_var_1473 = (uint64_t)(uintptr_t)pCheckpointDataCount; |
| 21917 | stream->putBe64(cgen_var_1473); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21918 | if (pCheckpointDataCount) |
| 21919 | { |
| 21920 | stream->write((uint32_t*)pCheckpointDataCount, sizeof(uint32_t)); |
| 21921 | } |
| 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_1474 = (uint64_t)(uintptr_t)pCheckpointData; |
| 21924 | stream->putBe64(cgen_var_1474); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21925 | if (pCheckpointData) |
| 21926 | { |
| 21927 | for (uint32_t i = 0; i < (uint32_t)(*(pCheckpointDataCount)); ++i) |
| 21928 | { |
| 21929 | marshal_VkCheckpointDataNV(stream, (VkCheckpointDataNV*)(pCheckpointData + i)); |
| 21930 | } |
| 21931 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 21932 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21933 | uint32_t* check_pCheckpointDataCount; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 21934 | check_pCheckpointDataCount = (uint32_t*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21935 | if (pCheckpointDataCount) |
| 21936 | { |
| 21937 | if (!(check_pCheckpointDataCount)) |
| 21938 | { |
| 21939 | fprintf(stderr, "fatal: pCheckpointDataCount inconsistent between guest and host\n"); |
| 21940 | } |
| 21941 | stream->read((uint32_t*)pCheckpointDataCount, sizeof(uint32_t)); |
| 21942 | } |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 21943 | // WARNING PTR CHECK |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21944 | VkCheckpointDataNV* check_pCheckpointData; |
| Lingfeng Yang | 77dc251 | 2018-11-17 12:48:37 -0800 | [diff] [blame] | 21945 | check_pCheckpointData = (VkCheckpointDataNV*)(uintptr_t)stream->getBe64(); |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21946 | if (pCheckpointData) |
| 21947 | { |
| 21948 | if (!(check_pCheckpointData)) |
| 21949 | { |
| 21950 | fprintf(stderr, "fatal: pCheckpointData inconsistent between guest and host\n"); |
| 21951 | } |
| 21952 | for (uint32_t i = 0; i < (uint32_t)(*(pCheckpointDataCount)); ++i) |
| 21953 | { |
| 21954 | unmarshal_VkCheckpointDataNV(stream, (VkCheckpointDataNV*)(pCheckpointData + i)); |
| 21955 | } |
| 21956 | } |
| Lingfeng Yang | 97a0670 | 2018-12-24 17:02:43 -0800 | [diff] [blame] | 21957 | if (pCheckpointData) |
| 21958 | { |
| 21959 | for (uint32_t i = 0; i < (uint32_t)(*(pCheckpointDataCount)); ++i) |
| 21960 | { |
| 21961 | transform_fromhost_VkCheckpointDataNV(mImpl->resources(), (VkCheckpointDataNV*)(pCheckpointData + i)); |
| 21962 | } |
| 21963 | } |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 21964 | pool->freeAll(); |
| 21965 | countingStream->clearPool(); |
| 21966 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 21967 | mImpl->log("finish vkGetQueueCheckpointDataNV");; |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 21968 | } |
| 21969 | |
| 21970 | #endif |
| Lingfeng Yang | 5c63afd | 2018-12-22 01:21:14 -0800 | [diff] [blame] | 21971 | #ifdef VK_GOOGLE_address_space |
| 21972 | VkResult VkEncoder::vkMapMemoryIntoAddressSpaceGOOGLE( |
| 21973 | VkDevice device, |
| 21974 | VkDeviceMemory memory, |
| 21975 | uint64_t* pAddress) |
| 21976 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 21977 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 21978 | mImpl->log("start vkMapMemoryIntoAddressSpaceGOOGLE"); |
| Lingfeng Yang | 5c63afd | 2018-12-22 01:21:14 -0800 | [diff] [blame] | 21979 | mImpl->resources()->on_vkMapMemoryIntoAddressSpaceGOOGLE_pre(this, VK_SUCCESS, device, memory, pAddress); |
| 21980 | auto stream = mImpl->stream(); |
| 21981 | auto countingStream = mImpl->countingStream(); |
| 21982 | auto resources = mImpl->resources(); |
| 21983 | auto pool = mImpl->pool(); |
| 21984 | stream->setHandleMapping(resources->unwrapMapping()); |
| 21985 | VkDevice local_device; |
| 21986 | VkDeviceMemory local_memory; |
| 21987 | local_device = device; |
| 21988 | local_memory = memory; |
| Lingfeng Yang | 2b1b8cf | 2019-02-08 09:53:36 -0800 | [diff] [blame] | 21989 | 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] | 21990 | countingStream->rewind(); |
| 21991 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21992 | uint64_t cgen_var_1477; |
| 21993 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1477, 1); |
| 21994 | countingStream->write((uint64_t*)&cgen_var_1477, 1 * 8); |
| 21995 | uint64_t cgen_var_1478; |
| 21996 | countingStream->handleMapping()->mapHandles_VkDeviceMemory_u64(&local_memory, &cgen_var_1478, 1); |
| 21997 | countingStream->write((uint64_t*)&cgen_var_1478, 1 * 8); |
| Lingfeng Yang | 5c63afd | 2018-12-22 01:21:14 -0800 | [diff] [blame] | 21998 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 21999 | uint64_t cgen_var_1479 = (uint64_t)(uintptr_t)pAddress; |
| 22000 | countingStream->putBe64(cgen_var_1479); |
| Lingfeng Yang | 5c63afd | 2018-12-22 01:21:14 -0800 | [diff] [blame] | 22001 | if (pAddress) |
| 22002 | { |
| 22003 | countingStream->write((uint64_t*)pAddress, sizeof(uint64_t)); |
| 22004 | } |
| 22005 | } |
| 22006 | uint32_t packetSize_vkMapMemoryIntoAddressSpaceGOOGLE = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 22007 | countingStream->rewind(); |
| 22008 | uint32_t opcode_vkMapMemoryIntoAddressSpaceGOOGLE = OP_vkMapMemoryIntoAddressSpaceGOOGLE; |
| 22009 | stream->write(&opcode_vkMapMemoryIntoAddressSpaceGOOGLE, sizeof(uint32_t)); |
| 22010 | stream->write(&packetSize_vkMapMemoryIntoAddressSpaceGOOGLE, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22011 | uint64_t cgen_var_1480; |
| 22012 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1480, 1); |
| 22013 | stream->write((uint64_t*)&cgen_var_1480, 1 * 8); |
| 22014 | uint64_t cgen_var_1481; |
| 22015 | stream->handleMapping()->mapHandles_VkDeviceMemory_u64(&local_memory, &cgen_var_1481, 1); |
| 22016 | stream->write((uint64_t*)&cgen_var_1481, 1 * 8); |
| Lingfeng Yang | 5c63afd | 2018-12-22 01:21:14 -0800 | [diff] [blame] | 22017 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22018 | uint64_t cgen_var_1482 = (uint64_t)(uintptr_t)pAddress; |
| 22019 | stream->putBe64(cgen_var_1482); |
| Lingfeng Yang | 5c63afd | 2018-12-22 01:21:14 -0800 | [diff] [blame] | 22020 | if (pAddress) |
| 22021 | { |
| 22022 | stream->write((uint64_t*)pAddress, sizeof(uint64_t)); |
| 22023 | } |
| 22024 | // WARNING PTR CHECK |
| 22025 | uint64_t* check_pAddress; |
| 22026 | check_pAddress = (uint64_t*)(uintptr_t)stream->getBe64(); |
| 22027 | if (pAddress) |
| 22028 | { |
| 22029 | if (!(check_pAddress)) |
| 22030 | { |
| 22031 | fprintf(stderr, "fatal: pAddress inconsistent between guest and host\n"); |
| 22032 | } |
| 22033 | stream->read((uint64_t*)pAddress, sizeof(uint64_t)); |
| 22034 | } |
| 22035 | VkResult vkMapMemoryIntoAddressSpaceGOOGLE_VkResult_return = (VkResult)0; |
| 22036 | stream->read(&vkMapMemoryIntoAddressSpaceGOOGLE_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 22037 | mImpl->resources()->on_vkMapMemoryIntoAddressSpaceGOOGLE(this, vkMapMemoryIntoAddressSpaceGOOGLE_VkResult_return, device, memory, pAddress); |
| 22038 | pool->freeAll(); |
| Lingfeng Yang | 5c63afd | 2018-12-22 01:21:14 -0800 | [diff] [blame] | 22039 | countingStream->clearPool(); |
| 22040 | stream->clearPool(); |
| Lingfeng Yang | 858ebe2 | 2019-01-22 15:53:52 -0800 | [diff] [blame] | 22041 | mImpl->log("finish vkMapMemoryIntoAddressSpaceGOOGLE");; |
| Lingfeng Yang | 5c63afd | 2018-12-22 01:21:14 -0800 | [diff] [blame] | 22042 | return vkMapMemoryIntoAddressSpaceGOOGLE_VkResult_return; |
| 22043 | } |
| 22044 | |
| 22045 | #endif |
| Lingfeng Yang | ae7e1b3 | 2019-02-19 14:07:39 -0800 | [diff] [blame] | 22046 | #ifdef VK_GOOGLE_color_buffer |
| 22047 | VkResult VkEncoder::vkRegisterImageColorBufferGOOGLE( |
| 22048 | VkDevice device, |
| 22049 | VkImage image, |
| 22050 | uint32_t colorBuffer) |
| 22051 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 22052 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | ae7e1b3 | 2019-02-19 14:07:39 -0800 | [diff] [blame] | 22053 | mImpl->log("start vkRegisterImageColorBufferGOOGLE"); |
| 22054 | auto stream = mImpl->stream(); |
| 22055 | auto countingStream = mImpl->countingStream(); |
| 22056 | auto resources = mImpl->resources(); |
| 22057 | auto pool = mImpl->pool(); |
| 22058 | stream->setHandleMapping(resources->unwrapMapping()); |
| 22059 | VkDevice local_device; |
| 22060 | VkImage local_image; |
| 22061 | uint32_t local_colorBuffer; |
| 22062 | local_device = device; |
| 22063 | local_image = image; |
| 22064 | local_colorBuffer = colorBuffer; |
| 22065 | countingStream->rewind(); |
| 22066 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22067 | uint64_t cgen_var_1484; |
| 22068 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1484, 1); |
| 22069 | countingStream->write((uint64_t*)&cgen_var_1484, 1 * 8); |
| 22070 | uint64_t cgen_var_1485; |
| 22071 | countingStream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_1485, 1); |
| 22072 | countingStream->write((uint64_t*)&cgen_var_1485, 1 * 8); |
| Lingfeng Yang | ae7e1b3 | 2019-02-19 14:07:39 -0800 | [diff] [blame] | 22073 | countingStream->write((uint32_t*)&local_colorBuffer, sizeof(uint32_t)); |
| 22074 | } |
| 22075 | uint32_t packetSize_vkRegisterImageColorBufferGOOGLE = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 22076 | countingStream->rewind(); |
| 22077 | uint32_t opcode_vkRegisterImageColorBufferGOOGLE = OP_vkRegisterImageColorBufferGOOGLE; |
| 22078 | stream->write(&opcode_vkRegisterImageColorBufferGOOGLE, sizeof(uint32_t)); |
| 22079 | stream->write(&packetSize_vkRegisterImageColorBufferGOOGLE, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22080 | uint64_t cgen_var_1486; |
| 22081 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1486, 1); |
| 22082 | stream->write((uint64_t*)&cgen_var_1486, 1 * 8); |
| 22083 | uint64_t cgen_var_1487; |
| 22084 | stream->handleMapping()->mapHandles_VkImage_u64(&local_image, &cgen_var_1487, 1); |
| 22085 | stream->write((uint64_t*)&cgen_var_1487, 1 * 8); |
| Lingfeng Yang | ae7e1b3 | 2019-02-19 14:07:39 -0800 | [diff] [blame] | 22086 | stream->write((uint32_t*)&local_colorBuffer, sizeof(uint32_t)); |
| 22087 | VkResult vkRegisterImageColorBufferGOOGLE_VkResult_return = (VkResult)0; |
| 22088 | stream->read(&vkRegisterImageColorBufferGOOGLE_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 22089 | pool->freeAll(); |
| Lingfeng Yang | ae7e1b3 | 2019-02-19 14:07:39 -0800 | [diff] [blame] | 22090 | countingStream->clearPool(); |
| 22091 | stream->clearPool(); |
| Lingfeng Yang | ae7e1b3 | 2019-02-19 14:07:39 -0800 | [diff] [blame] | 22092 | mImpl->log("finish vkRegisterImageColorBufferGOOGLE");; |
| 22093 | return vkRegisterImageColorBufferGOOGLE_VkResult_return; |
| 22094 | } |
| 22095 | |
| 22096 | VkResult VkEncoder::vkRegisterBufferColorBufferGOOGLE( |
| 22097 | VkDevice device, |
| 22098 | VkBuffer buffer, |
| 22099 | uint32_t colorBuffer) |
| 22100 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 22101 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | ae7e1b3 | 2019-02-19 14:07:39 -0800 | [diff] [blame] | 22102 | mImpl->log("start vkRegisterBufferColorBufferGOOGLE"); |
| 22103 | auto stream = mImpl->stream(); |
| 22104 | auto countingStream = mImpl->countingStream(); |
| 22105 | auto resources = mImpl->resources(); |
| 22106 | auto pool = mImpl->pool(); |
| 22107 | stream->setHandleMapping(resources->unwrapMapping()); |
| 22108 | VkDevice local_device; |
| 22109 | VkBuffer local_buffer; |
| 22110 | uint32_t local_colorBuffer; |
| 22111 | local_device = device; |
| 22112 | local_buffer = buffer; |
| 22113 | local_colorBuffer = colorBuffer; |
| 22114 | countingStream->rewind(); |
| 22115 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22116 | uint64_t cgen_var_1488; |
| 22117 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1488, 1); |
| 22118 | countingStream->write((uint64_t*)&cgen_var_1488, 1 * 8); |
| 22119 | uint64_t cgen_var_1489; |
| 22120 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_1489, 1); |
| 22121 | countingStream->write((uint64_t*)&cgen_var_1489, 1 * 8); |
| Lingfeng Yang | ae7e1b3 | 2019-02-19 14:07:39 -0800 | [diff] [blame] | 22122 | countingStream->write((uint32_t*)&local_colorBuffer, sizeof(uint32_t)); |
| 22123 | } |
| 22124 | uint32_t packetSize_vkRegisterBufferColorBufferGOOGLE = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 22125 | countingStream->rewind(); |
| 22126 | uint32_t opcode_vkRegisterBufferColorBufferGOOGLE = OP_vkRegisterBufferColorBufferGOOGLE; |
| 22127 | stream->write(&opcode_vkRegisterBufferColorBufferGOOGLE, sizeof(uint32_t)); |
| 22128 | stream->write(&packetSize_vkRegisterBufferColorBufferGOOGLE, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22129 | uint64_t cgen_var_1490; |
| 22130 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1490, 1); |
| 22131 | stream->write((uint64_t*)&cgen_var_1490, 1 * 8); |
| 22132 | uint64_t cgen_var_1491; |
| 22133 | stream->handleMapping()->mapHandles_VkBuffer_u64(&local_buffer, &cgen_var_1491, 1); |
| 22134 | stream->write((uint64_t*)&cgen_var_1491, 1 * 8); |
| Lingfeng Yang | ae7e1b3 | 2019-02-19 14:07:39 -0800 | [diff] [blame] | 22135 | stream->write((uint32_t*)&local_colorBuffer, sizeof(uint32_t)); |
| 22136 | VkResult vkRegisterBufferColorBufferGOOGLE_VkResult_return = (VkResult)0; |
| 22137 | stream->read(&vkRegisterBufferColorBufferGOOGLE_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 22138 | pool->freeAll(); |
| Lingfeng Yang | ae7e1b3 | 2019-02-19 14:07:39 -0800 | [diff] [blame] | 22139 | countingStream->clearPool(); |
| 22140 | stream->clearPool(); |
| Lingfeng Yang | ae7e1b3 | 2019-02-19 14:07:39 -0800 | [diff] [blame] | 22141 | mImpl->log("finish vkRegisterBufferColorBufferGOOGLE");; |
| 22142 | return vkRegisterBufferColorBufferGOOGLE_VkResult_return; |
| 22143 | } |
| 22144 | |
| 22145 | #endif |
| Lingfeng Yang | 05d5ea3 | 2019-03-23 00:12:39 -0700 | [diff] [blame] | 22146 | #ifdef VK_GOOGLE_sized_descriptor_update_template |
| 22147 | void VkEncoder::vkUpdateDescriptorSetWithTemplateSizedGOOGLE( |
| 22148 | VkDevice device, |
| 22149 | VkDescriptorSet descriptorSet, |
| 22150 | VkDescriptorUpdateTemplate descriptorUpdateTemplate, |
| 22151 | uint32_t imageInfoCount, |
| 22152 | uint32_t bufferInfoCount, |
| 22153 | uint32_t bufferViewCount, |
| 22154 | const uint32_t* pImageInfoEntryIndices, |
| 22155 | const uint32_t* pBufferInfoEntryIndices, |
| 22156 | const uint32_t* pBufferViewEntryIndices, |
| 22157 | const VkDescriptorImageInfo* pImageInfos, |
| 22158 | const VkDescriptorBufferInfo* pBufferInfos, |
| 22159 | const VkBufferView* pBufferViews) |
| 22160 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 22161 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 05d5ea3 | 2019-03-23 00:12:39 -0700 | [diff] [blame] | 22162 | mImpl->log("start vkUpdateDescriptorSetWithTemplateSizedGOOGLE"); |
| 22163 | auto stream = mImpl->stream(); |
| 22164 | auto countingStream = mImpl->countingStream(); |
| 22165 | auto resources = mImpl->resources(); |
| 22166 | auto pool = mImpl->pool(); |
| 22167 | stream->setHandleMapping(resources->unwrapMapping()); |
| 22168 | VkDevice local_device; |
| 22169 | VkDescriptorSet local_descriptorSet; |
| 22170 | VkDescriptorUpdateTemplate local_descriptorUpdateTemplate; |
| 22171 | uint32_t local_imageInfoCount; |
| 22172 | uint32_t local_bufferInfoCount; |
| 22173 | uint32_t local_bufferViewCount; |
| 22174 | uint32_t* local_pImageInfoEntryIndices; |
| 22175 | uint32_t* local_pBufferInfoEntryIndices; |
| 22176 | uint32_t* local_pBufferViewEntryIndices; |
| 22177 | VkDescriptorImageInfo* local_pImageInfos; |
| 22178 | VkDescriptorBufferInfo* local_pBufferInfos; |
| 22179 | VkBufferView* local_pBufferViews; |
| 22180 | local_device = device; |
| 22181 | local_descriptorSet = descriptorSet; |
| 22182 | local_descriptorUpdateTemplate = descriptorUpdateTemplate; |
| 22183 | local_imageInfoCount = imageInfoCount; |
| 22184 | local_bufferInfoCount = bufferInfoCount; |
| 22185 | local_bufferViewCount = bufferViewCount; |
| 22186 | local_pImageInfoEntryIndices = nullptr; |
| 22187 | if (pImageInfoEntryIndices) |
| 22188 | { |
| 22189 | local_pImageInfoEntryIndices = (uint32_t*)pool->dupArray(pImageInfoEntryIndices, ((imageInfoCount)) * sizeof(const uint32_t)); |
| 22190 | } |
| 22191 | local_pBufferInfoEntryIndices = nullptr; |
| 22192 | if (pBufferInfoEntryIndices) |
| 22193 | { |
| 22194 | local_pBufferInfoEntryIndices = (uint32_t*)pool->dupArray(pBufferInfoEntryIndices, ((bufferInfoCount)) * sizeof(const uint32_t)); |
| 22195 | } |
| 22196 | local_pBufferViewEntryIndices = nullptr; |
| 22197 | if (pBufferViewEntryIndices) |
| 22198 | { |
| 22199 | local_pBufferViewEntryIndices = (uint32_t*)pool->dupArray(pBufferViewEntryIndices, ((bufferViewCount)) * sizeof(const uint32_t)); |
| 22200 | } |
| 22201 | local_pImageInfos = nullptr; |
| 22202 | if (pImageInfos) |
| 22203 | { |
| 22204 | local_pImageInfos = (VkDescriptorImageInfo*)pool->alloc(((imageInfoCount)) * sizeof(const VkDescriptorImageInfo)); |
| 22205 | for (uint32_t i = 0; i < (uint32_t)((imageInfoCount)); ++i) |
| 22206 | { |
| 22207 | deepcopy_VkDescriptorImageInfo(pool, pImageInfos + i, (VkDescriptorImageInfo*)(local_pImageInfos + i)); |
| 22208 | } |
| 22209 | } |
| 22210 | local_pBufferInfos = nullptr; |
| 22211 | if (pBufferInfos) |
| 22212 | { |
| 22213 | local_pBufferInfos = (VkDescriptorBufferInfo*)pool->alloc(((bufferInfoCount)) * sizeof(const VkDescriptorBufferInfo)); |
| 22214 | for (uint32_t i = 0; i < (uint32_t)((bufferInfoCount)); ++i) |
| 22215 | { |
| 22216 | deepcopy_VkDescriptorBufferInfo(pool, pBufferInfos + i, (VkDescriptorBufferInfo*)(local_pBufferInfos + i)); |
| 22217 | } |
| 22218 | } |
| 22219 | local_pBufferViews = nullptr; |
| 22220 | if (pBufferViews) |
| 22221 | { |
| 22222 | local_pBufferViews = (VkBufferView*)pool->dupArray(pBufferViews, ((bufferViewCount)) * sizeof(const VkBufferView)); |
| 22223 | } |
| 22224 | if (local_pImageInfos) |
| 22225 | { |
| 22226 | for (uint32_t i = 0; i < (uint32_t)((imageInfoCount)); ++i) |
| 22227 | { |
| 22228 | transform_tohost_VkDescriptorImageInfo(mImpl->resources(), (VkDescriptorImageInfo*)(local_pImageInfos + i)); |
| 22229 | } |
| 22230 | } |
| 22231 | if (local_pBufferInfos) |
| 22232 | { |
| 22233 | for (uint32_t i = 0; i < (uint32_t)((bufferInfoCount)); ++i) |
| 22234 | { |
| 22235 | transform_tohost_VkDescriptorBufferInfo(mImpl->resources(), (VkDescriptorBufferInfo*)(local_pBufferInfos + i)); |
| 22236 | } |
| 22237 | } |
| 22238 | countingStream->rewind(); |
| 22239 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22240 | uint64_t cgen_var_1492; |
| 22241 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1492, 1); |
| 22242 | countingStream->write((uint64_t*)&cgen_var_1492, 1 * 8); |
| 22243 | uint64_t cgen_var_1493; |
| 22244 | countingStream->handleMapping()->mapHandles_VkDescriptorSet_u64(&local_descriptorSet, &cgen_var_1493, 1); |
| 22245 | countingStream->write((uint64_t*)&cgen_var_1493, 1 * 8); |
| 22246 | uint64_t cgen_var_1494; |
| 22247 | countingStream->handleMapping()->mapHandles_VkDescriptorUpdateTemplate_u64(&local_descriptorUpdateTemplate, &cgen_var_1494, 1); |
| 22248 | countingStream->write((uint64_t*)&cgen_var_1494, 1 * 8); |
| Lingfeng Yang | 05d5ea3 | 2019-03-23 00:12:39 -0700 | [diff] [blame] | 22249 | countingStream->write((uint32_t*)&local_imageInfoCount, sizeof(uint32_t)); |
| 22250 | countingStream->write((uint32_t*)&local_bufferInfoCount, sizeof(uint32_t)); |
| 22251 | countingStream->write((uint32_t*)&local_bufferViewCount, sizeof(uint32_t)); |
| 22252 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22253 | uint64_t cgen_var_1495 = (uint64_t)(uintptr_t)local_pImageInfoEntryIndices; |
| 22254 | countingStream->putBe64(cgen_var_1495); |
| Lingfeng Yang | 05d5ea3 | 2019-03-23 00:12:39 -0700 | [diff] [blame] | 22255 | if (local_pImageInfoEntryIndices) |
| 22256 | { |
| 22257 | countingStream->write((uint32_t*)local_pImageInfoEntryIndices, ((imageInfoCount)) * sizeof(uint32_t)); |
| 22258 | } |
| 22259 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22260 | uint64_t cgen_var_1496 = (uint64_t)(uintptr_t)local_pBufferInfoEntryIndices; |
| 22261 | countingStream->putBe64(cgen_var_1496); |
| Lingfeng Yang | 05d5ea3 | 2019-03-23 00:12:39 -0700 | [diff] [blame] | 22262 | if (local_pBufferInfoEntryIndices) |
| 22263 | { |
| 22264 | countingStream->write((uint32_t*)local_pBufferInfoEntryIndices, ((bufferInfoCount)) * sizeof(uint32_t)); |
| 22265 | } |
| 22266 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22267 | uint64_t cgen_var_1497 = (uint64_t)(uintptr_t)local_pBufferViewEntryIndices; |
| 22268 | countingStream->putBe64(cgen_var_1497); |
| Lingfeng Yang | 05d5ea3 | 2019-03-23 00:12:39 -0700 | [diff] [blame] | 22269 | if (local_pBufferViewEntryIndices) |
| 22270 | { |
| 22271 | countingStream->write((uint32_t*)local_pBufferViewEntryIndices, ((bufferViewCount)) * sizeof(uint32_t)); |
| 22272 | } |
| 22273 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22274 | uint64_t cgen_var_1498 = (uint64_t)(uintptr_t)local_pImageInfos; |
| 22275 | countingStream->putBe64(cgen_var_1498); |
| Lingfeng Yang | 05d5ea3 | 2019-03-23 00:12:39 -0700 | [diff] [blame] | 22276 | if (local_pImageInfos) |
| 22277 | { |
| 22278 | for (uint32_t i = 0; i < (uint32_t)((imageInfoCount)); ++i) |
| 22279 | { |
| 22280 | marshal_VkDescriptorImageInfo(countingStream, (VkDescriptorImageInfo*)(local_pImageInfos + i)); |
| 22281 | } |
| 22282 | } |
| 22283 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22284 | uint64_t cgen_var_1499 = (uint64_t)(uintptr_t)local_pBufferInfos; |
| 22285 | countingStream->putBe64(cgen_var_1499); |
| Lingfeng Yang | 05d5ea3 | 2019-03-23 00:12:39 -0700 | [diff] [blame] | 22286 | if (local_pBufferInfos) |
| 22287 | { |
| 22288 | for (uint32_t i = 0; i < (uint32_t)((bufferInfoCount)); ++i) |
| 22289 | { |
| 22290 | marshal_VkDescriptorBufferInfo(countingStream, (VkDescriptorBufferInfo*)(local_pBufferInfos + i)); |
| 22291 | } |
| 22292 | } |
| 22293 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22294 | uint64_t cgen_var_1500 = (uint64_t)(uintptr_t)local_pBufferViews; |
| 22295 | countingStream->putBe64(cgen_var_1500); |
| Lingfeng Yang | 05d5ea3 | 2019-03-23 00:12:39 -0700 | [diff] [blame] | 22296 | if (local_pBufferViews) |
| 22297 | { |
| 22298 | if (((bufferViewCount))) |
| 22299 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22300 | uint64_t* cgen_var_1501; |
| 22301 | countingStream->alloc((void**)&cgen_var_1501, ((bufferViewCount)) * 8); |
| 22302 | countingStream->handleMapping()->mapHandles_VkBufferView_u64(local_pBufferViews, cgen_var_1501, ((bufferViewCount))); |
| 22303 | countingStream->write((uint64_t*)cgen_var_1501, ((bufferViewCount)) * 8); |
| Lingfeng Yang | 05d5ea3 | 2019-03-23 00:12:39 -0700 | [diff] [blame] | 22304 | } |
| 22305 | } |
| 22306 | } |
| 22307 | uint32_t packetSize_vkUpdateDescriptorSetWithTemplateSizedGOOGLE = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 22308 | countingStream->rewind(); |
| 22309 | uint32_t opcode_vkUpdateDescriptorSetWithTemplateSizedGOOGLE = OP_vkUpdateDescriptorSetWithTemplateSizedGOOGLE; |
| 22310 | stream->write(&opcode_vkUpdateDescriptorSetWithTemplateSizedGOOGLE, sizeof(uint32_t)); |
| 22311 | stream->write(&packetSize_vkUpdateDescriptorSetWithTemplateSizedGOOGLE, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22312 | uint64_t cgen_var_1502; |
| 22313 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1502, 1); |
| 22314 | stream->write((uint64_t*)&cgen_var_1502, 1 * 8); |
| 22315 | uint64_t cgen_var_1503; |
| 22316 | stream->handleMapping()->mapHandles_VkDescriptorSet_u64(&local_descriptorSet, &cgen_var_1503, 1); |
| 22317 | stream->write((uint64_t*)&cgen_var_1503, 1 * 8); |
| 22318 | uint64_t cgen_var_1504; |
| 22319 | stream->handleMapping()->mapHandles_VkDescriptorUpdateTemplate_u64(&local_descriptorUpdateTemplate, &cgen_var_1504, 1); |
| 22320 | stream->write((uint64_t*)&cgen_var_1504, 1 * 8); |
| Lingfeng Yang | 05d5ea3 | 2019-03-23 00:12:39 -0700 | [diff] [blame] | 22321 | stream->write((uint32_t*)&local_imageInfoCount, sizeof(uint32_t)); |
| 22322 | stream->write((uint32_t*)&local_bufferInfoCount, sizeof(uint32_t)); |
| 22323 | stream->write((uint32_t*)&local_bufferViewCount, sizeof(uint32_t)); |
| 22324 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22325 | uint64_t cgen_var_1505 = (uint64_t)(uintptr_t)local_pImageInfoEntryIndices; |
| 22326 | stream->putBe64(cgen_var_1505); |
| Lingfeng Yang | 05d5ea3 | 2019-03-23 00:12:39 -0700 | [diff] [blame] | 22327 | if (local_pImageInfoEntryIndices) |
| 22328 | { |
| 22329 | stream->write((uint32_t*)local_pImageInfoEntryIndices, ((imageInfoCount)) * sizeof(uint32_t)); |
| 22330 | } |
| 22331 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22332 | uint64_t cgen_var_1506 = (uint64_t)(uintptr_t)local_pBufferInfoEntryIndices; |
| 22333 | stream->putBe64(cgen_var_1506); |
| Lingfeng Yang | 05d5ea3 | 2019-03-23 00:12:39 -0700 | [diff] [blame] | 22334 | if (local_pBufferInfoEntryIndices) |
| 22335 | { |
| 22336 | stream->write((uint32_t*)local_pBufferInfoEntryIndices, ((bufferInfoCount)) * sizeof(uint32_t)); |
| 22337 | } |
| 22338 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22339 | uint64_t cgen_var_1507 = (uint64_t)(uintptr_t)local_pBufferViewEntryIndices; |
| 22340 | stream->putBe64(cgen_var_1507); |
| Lingfeng Yang | 05d5ea3 | 2019-03-23 00:12:39 -0700 | [diff] [blame] | 22341 | if (local_pBufferViewEntryIndices) |
| 22342 | { |
| 22343 | stream->write((uint32_t*)local_pBufferViewEntryIndices, ((bufferViewCount)) * sizeof(uint32_t)); |
| 22344 | } |
| 22345 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22346 | uint64_t cgen_var_1508 = (uint64_t)(uintptr_t)local_pImageInfos; |
| 22347 | stream->putBe64(cgen_var_1508); |
| Lingfeng Yang | 05d5ea3 | 2019-03-23 00:12:39 -0700 | [diff] [blame] | 22348 | if (local_pImageInfos) |
| 22349 | { |
| 22350 | for (uint32_t i = 0; i < (uint32_t)((imageInfoCount)); ++i) |
| 22351 | { |
| 22352 | marshal_VkDescriptorImageInfo(stream, (VkDescriptorImageInfo*)(local_pImageInfos + i)); |
| 22353 | } |
| 22354 | } |
| 22355 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22356 | uint64_t cgen_var_1509 = (uint64_t)(uintptr_t)local_pBufferInfos; |
| 22357 | stream->putBe64(cgen_var_1509); |
| Lingfeng Yang | 05d5ea3 | 2019-03-23 00:12:39 -0700 | [diff] [blame] | 22358 | if (local_pBufferInfos) |
| 22359 | { |
| 22360 | for (uint32_t i = 0; i < (uint32_t)((bufferInfoCount)); ++i) |
| 22361 | { |
| 22362 | marshal_VkDescriptorBufferInfo(stream, (VkDescriptorBufferInfo*)(local_pBufferInfos + i)); |
| 22363 | } |
| 22364 | } |
| 22365 | // WARNING PTR CHECK |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22366 | uint64_t cgen_var_1510 = (uint64_t)(uintptr_t)local_pBufferViews; |
| 22367 | stream->putBe64(cgen_var_1510); |
| Lingfeng Yang | 05d5ea3 | 2019-03-23 00:12:39 -0700 | [diff] [blame] | 22368 | if (local_pBufferViews) |
| 22369 | { |
| 22370 | if (((bufferViewCount))) |
| 22371 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22372 | uint64_t* cgen_var_1511; |
| 22373 | stream->alloc((void**)&cgen_var_1511, ((bufferViewCount)) * 8); |
| 22374 | stream->handleMapping()->mapHandles_VkBufferView_u64(local_pBufferViews, cgen_var_1511, ((bufferViewCount))); |
| 22375 | stream->write((uint64_t*)cgen_var_1511, ((bufferViewCount)) * 8); |
| Lingfeng Yang | 05d5ea3 | 2019-03-23 00:12:39 -0700 | [diff] [blame] | 22376 | } |
| 22377 | } |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 22378 | pool->freeAll(); |
| 22379 | countingStream->clearPool(); |
| 22380 | stream->clearPool(); |
| Lingfeng Yang | 05d5ea3 | 2019-03-23 00:12:39 -0700 | [diff] [blame] | 22381 | mImpl->log("finish vkUpdateDescriptorSetWithTemplateSizedGOOGLE");; |
| 22382 | } |
| 22383 | |
| 22384 | #endif |
| Lingfeng Yang | c53e747 | 2019-03-27 08:50:55 -0700 | [diff] [blame] | 22385 | #ifdef VK_GOOGLE_async_command_buffers |
| 22386 | void VkEncoder::vkBeginCommandBufferAsyncGOOGLE( |
| 22387 | VkCommandBuffer commandBuffer, |
| 22388 | const VkCommandBufferBeginInfo* pBeginInfo) |
| 22389 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 22390 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | c53e747 | 2019-03-27 08:50:55 -0700 | [diff] [blame] | 22391 | mImpl->log("start vkBeginCommandBufferAsyncGOOGLE"); |
| 22392 | auto stream = mImpl->stream(); |
| 22393 | auto countingStream = mImpl->countingStream(); |
| 22394 | auto resources = mImpl->resources(); |
| 22395 | auto pool = mImpl->pool(); |
| 22396 | stream->setHandleMapping(resources->unwrapMapping()); |
| 22397 | VkCommandBuffer local_commandBuffer; |
| 22398 | VkCommandBufferBeginInfo* local_pBeginInfo; |
| 22399 | local_commandBuffer = commandBuffer; |
| 22400 | local_pBeginInfo = nullptr; |
| 22401 | if (pBeginInfo) |
| 22402 | { |
| 22403 | local_pBeginInfo = (VkCommandBufferBeginInfo*)pool->alloc(sizeof(const VkCommandBufferBeginInfo)); |
| 22404 | deepcopy_VkCommandBufferBeginInfo(pool, pBeginInfo, (VkCommandBufferBeginInfo*)(local_pBeginInfo)); |
| 22405 | } |
| 22406 | if (local_pBeginInfo) |
| 22407 | { |
| 22408 | transform_tohost_VkCommandBufferBeginInfo(mImpl->resources(), (VkCommandBufferBeginInfo*)(local_pBeginInfo)); |
| 22409 | } |
| 22410 | countingStream->rewind(); |
| 22411 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22412 | uint64_t cgen_var_1512; |
| 22413 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1512, 1); |
| 22414 | countingStream->write((uint64_t*)&cgen_var_1512, 1 * 8); |
| Lingfeng Yang | c53e747 | 2019-03-27 08:50:55 -0700 | [diff] [blame] | 22415 | marshal_VkCommandBufferBeginInfo(countingStream, (VkCommandBufferBeginInfo*)(local_pBeginInfo)); |
| 22416 | } |
| 22417 | uint32_t packetSize_vkBeginCommandBufferAsyncGOOGLE = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 22418 | countingStream->rewind(); |
| 22419 | uint32_t opcode_vkBeginCommandBufferAsyncGOOGLE = OP_vkBeginCommandBufferAsyncGOOGLE; |
| 22420 | stream->write(&opcode_vkBeginCommandBufferAsyncGOOGLE, sizeof(uint32_t)); |
| 22421 | stream->write(&packetSize_vkBeginCommandBufferAsyncGOOGLE, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22422 | uint64_t cgen_var_1513; |
| 22423 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1513, 1); |
| 22424 | stream->write((uint64_t*)&cgen_var_1513, 1 * 8); |
| Lingfeng Yang | c53e747 | 2019-03-27 08:50:55 -0700 | [diff] [blame] | 22425 | marshal_VkCommandBufferBeginInfo(stream, (VkCommandBufferBeginInfo*)(local_pBeginInfo)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 22426 | pool->freeAll(); |
| 22427 | countingStream->clearPool(); |
| 22428 | stream->clearPool(); |
| Lingfeng Yang | c53e747 | 2019-03-27 08:50:55 -0700 | [diff] [blame] | 22429 | mImpl->log("finish vkBeginCommandBufferAsyncGOOGLE");; |
| 22430 | } |
| 22431 | |
| 22432 | void VkEncoder::vkEndCommandBufferAsyncGOOGLE( |
| 22433 | VkCommandBuffer commandBuffer) |
| 22434 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 22435 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | c53e747 | 2019-03-27 08:50:55 -0700 | [diff] [blame] | 22436 | mImpl->log("start vkEndCommandBufferAsyncGOOGLE"); |
| 22437 | auto stream = mImpl->stream(); |
| 22438 | auto countingStream = mImpl->countingStream(); |
| 22439 | auto resources = mImpl->resources(); |
| 22440 | auto pool = mImpl->pool(); |
| 22441 | stream->setHandleMapping(resources->unwrapMapping()); |
| 22442 | VkCommandBuffer local_commandBuffer; |
| 22443 | local_commandBuffer = commandBuffer; |
| 22444 | countingStream->rewind(); |
| 22445 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22446 | uint64_t cgen_var_1514; |
| 22447 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1514, 1); |
| 22448 | countingStream->write((uint64_t*)&cgen_var_1514, 1 * 8); |
| Lingfeng Yang | c53e747 | 2019-03-27 08:50:55 -0700 | [diff] [blame] | 22449 | } |
| 22450 | uint32_t packetSize_vkEndCommandBufferAsyncGOOGLE = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 22451 | countingStream->rewind(); |
| 22452 | uint32_t opcode_vkEndCommandBufferAsyncGOOGLE = OP_vkEndCommandBufferAsyncGOOGLE; |
| 22453 | stream->write(&opcode_vkEndCommandBufferAsyncGOOGLE, sizeof(uint32_t)); |
| 22454 | stream->write(&packetSize_vkEndCommandBufferAsyncGOOGLE, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22455 | uint64_t cgen_var_1515; |
| 22456 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1515, 1); |
| 22457 | stream->write((uint64_t*)&cgen_var_1515, 1 * 8); |
| Lingfeng Yang | f89f75d | 2020-07-09 17:42:33 -0700 | [diff] [blame] | 22458 | stream->flush(); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 22459 | pool->freeAll(); |
| 22460 | countingStream->clearPool(); |
| 22461 | stream->clearPool(); |
| Lingfeng Yang | c53e747 | 2019-03-27 08:50:55 -0700 | [diff] [blame] | 22462 | mImpl->log("finish vkEndCommandBufferAsyncGOOGLE");; |
| 22463 | } |
| 22464 | |
| 22465 | void VkEncoder::vkResetCommandBufferAsyncGOOGLE( |
| 22466 | VkCommandBuffer commandBuffer, |
| 22467 | VkCommandBufferResetFlags flags) |
| 22468 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 22469 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | c53e747 | 2019-03-27 08:50:55 -0700 | [diff] [blame] | 22470 | mImpl->log("start vkResetCommandBufferAsyncGOOGLE"); |
| 22471 | auto stream = mImpl->stream(); |
| 22472 | auto countingStream = mImpl->countingStream(); |
| 22473 | auto resources = mImpl->resources(); |
| 22474 | auto pool = mImpl->pool(); |
| 22475 | stream->setHandleMapping(resources->unwrapMapping()); |
| 22476 | VkCommandBuffer local_commandBuffer; |
| 22477 | VkCommandBufferResetFlags local_flags; |
| 22478 | local_commandBuffer = commandBuffer; |
| 22479 | local_flags = flags; |
| 22480 | countingStream->rewind(); |
| 22481 | { |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22482 | uint64_t cgen_var_1516; |
| 22483 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1516, 1); |
| 22484 | countingStream->write((uint64_t*)&cgen_var_1516, 1 * 8); |
| Lingfeng Yang | c53e747 | 2019-03-27 08:50:55 -0700 | [diff] [blame] | 22485 | countingStream->write((VkCommandBufferResetFlags*)&local_flags, sizeof(VkCommandBufferResetFlags)); |
| 22486 | } |
| 22487 | uint32_t packetSize_vkResetCommandBufferAsyncGOOGLE = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 22488 | countingStream->rewind(); |
| 22489 | uint32_t opcode_vkResetCommandBufferAsyncGOOGLE = OP_vkResetCommandBufferAsyncGOOGLE; |
| 22490 | stream->write(&opcode_vkResetCommandBufferAsyncGOOGLE, sizeof(uint32_t)); |
| 22491 | stream->write(&packetSize_vkResetCommandBufferAsyncGOOGLE, sizeof(uint32_t)); |
| David Reveman | 9875f2c | 2019-06-11 21:47:12 -0400 | [diff] [blame] | 22492 | uint64_t cgen_var_1517; |
| 22493 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1517, 1); |
| 22494 | stream->write((uint64_t*)&cgen_var_1517, 1 * 8); |
| Lingfeng Yang | c53e747 | 2019-03-27 08:50:55 -0700 | [diff] [blame] | 22495 | stream->write((VkCommandBufferResetFlags*)&local_flags, sizeof(VkCommandBufferResetFlags)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 22496 | pool->freeAll(); |
| 22497 | countingStream->clearPool(); |
| 22498 | stream->clearPool(); |
| Lingfeng Yang | c53e747 | 2019-03-27 08:50:55 -0700 | [diff] [blame] | 22499 | mImpl->log("finish vkResetCommandBufferAsyncGOOGLE");; |
| 22500 | } |
| 22501 | |
| Lingfeng Yang | 39a276e | 2019-06-17 13:27:22 -0700 | [diff] [blame] | 22502 | void VkEncoder::vkCommandBufferHostSyncGOOGLE( |
| 22503 | VkCommandBuffer commandBuffer, |
| 22504 | uint32_t needHostSync, |
| 22505 | uint32_t sequenceNumber) |
| 22506 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 22507 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 39a276e | 2019-06-17 13:27:22 -0700 | [diff] [blame] | 22508 | mImpl->log("start vkCommandBufferHostSyncGOOGLE"); |
| 22509 | auto stream = mImpl->stream(); |
| 22510 | auto countingStream = mImpl->countingStream(); |
| 22511 | auto resources = mImpl->resources(); |
| 22512 | auto pool = mImpl->pool(); |
| 22513 | stream->setHandleMapping(resources->unwrapMapping()); |
| 22514 | VkCommandBuffer local_commandBuffer; |
| 22515 | uint32_t local_needHostSync; |
| 22516 | uint32_t local_sequenceNumber; |
| 22517 | local_commandBuffer = commandBuffer; |
| 22518 | local_needHostSync = needHostSync; |
| 22519 | local_sequenceNumber = sequenceNumber; |
| 22520 | countingStream->rewind(); |
| 22521 | { |
| 22522 | uint64_t cgen_var_1518; |
| 22523 | countingStream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1518, 1); |
| 22524 | countingStream->write((uint64_t*)&cgen_var_1518, 1 * 8); |
| 22525 | countingStream->write((uint32_t*)&local_needHostSync, sizeof(uint32_t)); |
| 22526 | countingStream->write((uint32_t*)&local_sequenceNumber, sizeof(uint32_t)); |
| 22527 | } |
| 22528 | uint32_t packetSize_vkCommandBufferHostSyncGOOGLE = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 22529 | countingStream->rewind(); |
| 22530 | uint32_t opcode_vkCommandBufferHostSyncGOOGLE = OP_vkCommandBufferHostSyncGOOGLE; |
| 22531 | stream->write(&opcode_vkCommandBufferHostSyncGOOGLE, sizeof(uint32_t)); |
| 22532 | stream->write(&packetSize_vkCommandBufferHostSyncGOOGLE, sizeof(uint32_t)); |
| 22533 | uint64_t cgen_var_1519; |
| 22534 | stream->handleMapping()->mapHandles_VkCommandBuffer_u64(&local_commandBuffer, &cgen_var_1519, 1); |
| 22535 | stream->write((uint64_t*)&cgen_var_1519, 1 * 8); |
| 22536 | stream->write((uint32_t*)&local_needHostSync, sizeof(uint32_t)); |
| 22537 | stream->write((uint32_t*)&local_sequenceNumber, sizeof(uint32_t)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 22538 | pool->freeAll(); |
| 22539 | countingStream->clearPool(); |
| 22540 | stream->clearPool(); |
| Lingfeng Yang | 39a276e | 2019-06-17 13:27:22 -0700 | [diff] [blame] | 22541 | mImpl->log("finish vkCommandBufferHostSyncGOOGLE");; |
| 22542 | } |
| 22543 | |
| Lingfeng Yang | c53e747 | 2019-03-27 08:50:55 -0700 | [diff] [blame] | 22544 | #endif |
| Lingfeng Yang | 87f1196 | 2019-06-27 16:28:53 +0000 | [diff] [blame] | 22545 | #ifdef VK_GOOGLE_create_resources_with_requirements |
| 22546 | VkResult VkEncoder::vkCreateImageWithRequirementsGOOGLE( |
| 22547 | VkDevice device, |
| 22548 | const VkImageCreateInfo* pCreateInfo, |
| 22549 | const VkAllocationCallbacks* pAllocator, |
| 22550 | VkImage* pImage, |
| 22551 | VkMemoryRequirements* pMemoryRequirements) |
| 22552 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 22553 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 87f1196 | 2019-06-27 16:28:53 +0000 | [diff] [blame] | 22554 | mImpl->log("start vkCreateImageWithRequirementsGOOGLE"); |
| 22555 | auto stream = mImpl->stream(); |
| 22556 | auto countingStream = mImpl->countingStream(); |
| 22557 | auto resources = mImpl->resources(); |
| 22558 | auto pool = mImpl->pool(); |
| 22559 | stream->setHandleMapping(resources->unwrapMapping()); |
| 22560 | VkDevice local_device; |
| 22561 | VkImageCreateInfo* local_pCreateInfo; |
| 22562 | VkAllocationCallbacks* local_pAllocator; |
| 22563 | local_device = device; |
| 22564 | local_pCreateInfo = nullptr; |
| 22565 | if (pCreateInfo) |
| 22566 | { |
| 22567 | local_pCreateInfo = (VkImageCreateInfo*)pool->alloc(sizeof(const VkImageCreateInfo)); |
| 22568 | deepcopy_VkImageCreateInfo(pool, pCreateInfo, (VkImageCreateInfo*)(local_pCreateInfo)); |
| 22569 | } |
| 22570 | local_pAllocator = nullptr; |
| 22571 | if (pAllocator) |
| 22572 | { |
| 22573 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 22574 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 22575 | } |
| 22576 | mImpl->resources()->unwrap_VkNativeBufferANDROID(pCreateInfo, local_pCreateInfo); |
| 22577 | local_pAllocator = nullptr; |
| 22578 | if (local_pCreateInfo) |
| 22579 | { |
| 22580 | transform_tohost_VkImageCreateInfo(mImpl->resources(), (VkImageCreateInfo*)(local_pCreateInfo)); |
| 22581 | } |
| 22582 | if (local_pAllocator) |
| 22583 | { |
| 22584 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| 22585 | } |
| 22586 | countingStream->rewind(); |
| 22587 | { |
| 22588 | uint64_t cgen_var_1520; |
| 22589 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1520, 1); |
| 22590 | countingStream->write((uint64_t*)&cgen_var_1520, 1 * 8); |
| 22591 | marshal_VkImageCreateInfo(countingStream, (VkImageCreateInfo*)(local_pCreateInfo)); |
| 22592 | // WARNING PTR CHECK |
| 22593 | uint64_t cgen_var_1521 = (uint64_t)(uintptr_t)local_pAllocator; |
| 22594 | countingStream->putBe64(cgen_var_1521); |
| 22595 | if (local_pAllocator) |
| 22596 | { |
| 22597 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| 22598 | } |
| 22599 | uint64_t cgen_var_1522; |
| 22600 | countingStream->handleMapping()->mapHandles_VkImage_u64(pImage, &cgen_var_1522, 1); |
| 22601 | countingStream->write((uint64_t*)&cgen_var_1522, 8); |
| 22602 | marshal_VkMemoryRequirements(countingStream, (VkMemoryRequirements*)(pMemoryRequirements)); |
| 22603 | } |
| 22604 | uint32_t packetSize_vkCreateImageWithRequirementsGOOGLE = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 22605 | countingStream->rewind(); |
| 22606 | uint32_t opcode_vkCreateImageWithRequirementsGOOGLE = OP_vkCreateImageWithRequirementsGOOGLE; |
| 22607 | stream->write(&opcode_vkCreateImageWithRequirementsGOOGLE, sizeof(uint32_t)); |
| 22608 | stream->write(&packetSize_vkCreateImageWithRequirementsGOOGLE, sizeof(uint32_t)); |
| 22609 | uint64_t cgen_var_1523; |
| 22610 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1523, 1); |
| 22611 | stream->write((uint64_t*)&cgen_var_1523, 1 * 8); |
| 22612 | marshal_VkImageCreateInfo(stream, (VkImageCreateInfo*)(local_pCreateInfo)); |
| 22613 | // WARNING PTR CHECK |
| 22614 | uint64_t cgen_var_1524 = (uint64_t)(uintptr_t)local_pAllocator; |
| 22615 | stream->putBe64(cgen_var_1524); |
| 22616 | if (local_pAllocator) |
| 22617 | { |
| 22618 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| 22619 | } |
| 22620 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| 22621 | uint64_t cgen_var_1525; |
| 22622 | stream->handleMapping()->mapHandles_VkImage_u64(pImage, &cgen_var_1525, 1); |
| 22623 | stream->write((uint64_t*)&cgen_var_1525, 8); |
| 22624 | stream->setHandleMapping(resources->unwrapMapping()); |
| 22625 | marshal_VkMemoryRequirements(stream, (VkMemoryRequirements*)(pMemoryRequirements)); |
| Lingfeng Yang | 87f1196 | 2019-06-27 16:28:53 +0000 | [diff] [blame] | 22626 | stream->setHandleMapping(resources->createMapping()); |
| 22627 | uint64_t cgen_var_1526; |
| 22628 | stream->read((uint64_t*)&cgen_var_1526, 8); |
| 22629 | stream->handleMapping()->mapHandles_u64_VkImage(&cgen_var_1526, (VkImage*)pImage, 1); |
| 22630 | stream->unsetHandleMapping(); |
| 22631 | unmarshal_VkMemoryRequirements(stream, (VkMemoryRequirements*)(pMemoryRequirements)); |
| 22632 | if (pMemoryRequirements) |
| 22633 | { |
| 22634 | transform_fromhost_VkMemoryRequirements(mImpl->resources(), (VkMemoryRequirements*)(pMemoryRequirements)); |
| 22635 | } |
| Lingfeng Yang | 87f1196 | 2019-06-27 16:28:53 +0000 | [diff] [blame] | 22636 | VkResult vkCreateImageWithRequirementsGOOGLE_VkResult_return = (VkResult)0; |
| 22637 | stream->read(&vkCreateImageWithRequirementsGOOGLE_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 22638 | pool->freeAll(); |
| Lingfeng Yang | 87f1196 | 2019-06-27 16:28:53 +0000 | [diff] [blame] | 22639 | countingStream->clearPool(); |
| 22640 | stream->clearPool(); |
| Lingfeng Yang | 87f1196 | 2019-06-27 16:28:53 +0000 | [diff] [blame] | 22641 | mImpl->log("finish vkCreateImageWithRequirementsGOOGLE");; |
| 22642 | return vkCreateImageWithRequirementsGOOGLE_VkResult_return; |
| 22643 | } |
| 22644 | |
| 22645 | VkResult VkEncoder::vkCreateBufferWithRequirementsGOOGLE( |
| 22646 | VkDevice device, |
| 22647 | const VkBufferCreateInfo* pCreateInfo, |
| 22648 | const VkAllocationCallbacks* pAllocator, |
| 22649 | VkBuffer* pBuffer, |
| 22650 | VkMemoryRequirements* pMemoryRequirements) |
| 22651 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 22652 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 87f1196 | 2019-06-27 16:28:53 +0000 | [diff] [blame] | 22653 | mImpl->log("start vkCreateBufferWithRequirementsGOOGLE"); |
| 22654 | auto stream = mImpl->stream(); |
| 22655 | auto countingStream = mImpl->countingStream(); |
| 22656 | auto resources = mImpl->resources(); |
| 22657 | auto pool = mImpl->pool(); |
| 22658 | stream->setHandleMapping(resources->unwrapMapping()); |
| 22659 | VkDevice local_device; |
| 22660 | VkBufferCreateInfo* local_pCreateInfo; |
| 22661 | VkAllocationCallbacks* local_pAllocator; |
| 22662 | local_device = device; |
| 22663 | local_pCreateInfo = nullptr; |
| 22664 | if (pCreateInfo) |
| 22665 | { |
| 22666 | local_pCreateInfo = (VkBufferCreateInfo*)pool->alloc(sizeof(const VkBufferCreateInfo)); |
| 22667 | deepcopy_VkBufferCreateInfo(pool, pCreateInfo, (VkBufferCreateInfo*)(local_pCreateInfo)); |
| 22668 | } |
| 22669 | local_pAllocator = nullptr; |
| 22670 | if (pAllocator) |
| 22671 | { |
| 22672 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 22673 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 22674 | } |
| 22675 | local_pAllocator = nullptr; |
| 22676 | if (local_pCreateInfo) |
| 22677 | { |
| 22678 | transform_tohost_VkBufferCreateInfo(mImpl->resources(), (VkBufferCreateInfo*)(local_pCreateInfo)); |
| 22679 | } |
| 22680 | if (local_pAllocator) |
| 22681 | { |
| 22682 | transform_tohost_VkAllocationCallbacks(mImpl->resources(), (VkAllocationCallbacks*)(local_pAllocator)); |
| 22683 | } |
| 22684 | countingStream->rewind(); |
| 22685 | { |
| 22686 | uint64_t cgen_var_1527; |
| 22687 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1527, 1); |
| 22688 | countingStream->write((uint64_t*)&cgen_var_1527, 1 * 8); |
| 22689 | marshal_VkBufferCreateInfo(countingStream, (VkBufferCreateInfo*)(local_pCreateInfo)); |
| 22690 | // WARNING PTR CHECK |
| 22691 | uint64_t cgen_var_1528 = (uint64_t)(uintptr_t)local_pAllocator; |
| 22692 | countingStream->putBe64(cgen_var_1528); |
| 22693 | if (local_pAllocator) |
| 22694 | { |
| 22695 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| 22696 | } |
| 22697 | uint64_t cgen_var_1529; |
| 22698 | countingStream->handleMapping()->mapHandles_VkBuffer_u64(pBuffer, &cgen_var_1529, 1); |
| 22699 | countingStream->write((uint64_t*)&cgen_var_1529, 8); |
| 22700 | marshal_VkMemoryRequirements(countingStream, (VkMemoryRequirements*)(pMemoryRequirements)); |
| 22701 | } |
| 22702 | uint32_t packetSize_vkCreateBufferWithRequirementsGOOGLE = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 22703 | countingStream->rewind(); |
| 22704 | uint32_t opcode_vkCreateBufferWithRequirementsGOOGLE = OP_vkCreateBufferWithRequirementsGOOGLE; |
| 22705 | stream->write(&opcode_vkCreateBufferWithRequirementsGOOGLE, sizeof(uint32_t)); |
| 22706 | stream->write(&packetSize_vkCreateBufferWithRequirementsGOOGLE, sizeof(uint32_t)); |
| 22707 | uint64_t cgen_var_1530; |
| 22708 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1530, 1); |
| 22709 | stream->write((uint64_t*)&cgen_var_1530, 1 * 8); |
| 22710 | marshal_VkBufferCreateInfo(stream, (VkBufferCreateInfo*)(local_pCreateInfo)); |
| 22711 | // WARNING PTR CHECK |
| 22712 | uint64_t cgen_var_1531 = (uint64_t)(uintptr_t)local_pAllocator; |
| 22713 | stream->putBe64(cgen_var_1531); |
| 22714 | if (local_pAllocator) |
| 22715 | { |
| 22716 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| 22717 | } |
| 22718 | stream->unsetHandleMapping() /* emit_marshal, is handle, possibly out */; |
| 22719 | uint64_t cgen_var_1532; |
| 22720 | stream->handleMapping()->mapHandles_VkBuffer_u64(pBuffer, &cgen_var_1532, 1); |
| 22721 | stream->write((uint64_t*)&cgen_var_1532, 8); |
| 22722 | stream->setHandleMapping(resources->unwrapMapping()); |
| 22723 | marshal_VkMemoryRequirements(stream, (VkMemoryRequirements*)(pMemoryRequirements)); |
| Lingfeng Yang | 87f1196 | 2019-06-27 16:28:53 +0000 | [diff] [blame] | 22724 | stream->setHandleMapping(resources->createMapping()); |
| 22725 | uint64_t cgen_var_1533; |
| 22726 | stream->read((uint64_t*)&cgen_var_1533, 8); |
| 22727 | stream->handleMapping()->mapHandles_u64_VkBuffer(&cgen_var_1533, (VkBuffer*)pBuffer, 1); |
| 22728 | stream->unsetHandleMapping(); |
| 22729 | unmarshal_VkMemoryRequirements(stream, (VkMemoryRequirements*)(pMemoryRequirements)); |
| 22730 | if (pMemoryRequirements) |
| 22731 | { |
| 22732 | transform_fromhost_VkMemoryRequirements(mImpl->resources(), (VkMemoryRequirements*)(pMemoryRequirements)); |
| 22733 | } |
| Lingfeng Yang | 87f1196 | 2019-06-27 16:28:53 +0000 | [diff] [blame] | 22734 | VkResult vkCreateBufferWithRequirementsGOOGLE_VkResult_return = (VkResult)0; |
| 22735 | stream->read(&vkCreateBufferWithRequirementsGOOGLE_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 22736 | pool->freeAll(); |
| Lingfeng Yang | 87f1196 | 2019-06-27 16:28:53 +0000 | [diff] [blame] | 22737 | countingStream->clearPool(); |
| 22738 | stream->clearPool(); |
| Lingfeng Yang | 87f1196 | 2019-06-27 16:28:53 +0000 | [diff] [blame] | 22739 | mImpl->log("finish vkCreateBufferWithRequirementsGOOGLE");; |
| 22740 | return vkCreateBufferWithRequirementsGOOGLE_VkResult_return; |
| 22741 | } |
| 22742 | |
| 22743 | #endif |
| Lingfeng Yang | 4c54241 | 2020-02-04 18:18:32 -0800 | [diff] [blame] | 22744 | #ifdef VK_GOOGLE_address_space_info |
| 22745 | VkResult VkEncoder::vkGetMemoryHostAddressInfoGOOGLE( |
| 22746 | VkDevice device, |
| 22747 | VkDeviceMemory memory, |
| 22748 | uint64_t* pAddress, |
| 22749 | uint64_t* pSize, |
| 22750 | uint64_t* pHostmemId) |
| 22751 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 22752 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 4c54241 | 2020-02-04 18:18:32 -0800 | [diff] [blame] | 22753 | mImpl->log("start vkGetMemoryHostAddressInfoGOOGLE"); |
| 22754 | auto stream = mImpl->stream(); |
| 22755 | auto countingStream = mImpl->countingStream(); |
| 22756 | auto resources = mImpl->resources(); |
| 22757 | auto pool = mImpl->pool(); |
| 22758 | stream->setHandleMapping(resources->unwrapMapping()); |
| 22759 | VkDevice local_device; |
| 22760 | VkDeviceMemory local_memory; |
| 22761 | local_device = device; |
| 22762 | local_memory = memory; |
| 22763 | mImpl->resources()->deviceMemoryTransform_tohost((VkDeviceMemory*)&local_memory, 1, (VkDeviceSize*)nullptr, 0, (VkDeviceSize*)nullptr, 0, (uint32_t*)nullptr, 0, (uint32_t*)nullptr, 0); |
| 22764 | countingStream->rewind(); |
| 22765 | { |
| 22766 | uint64_t cgen_var_1534; |
| 22767 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1534, 1); |
| 22768 | countingStream->write((uint64_t*)&cgen_var_1534, 1 * 8); |
| 22769 | uint64_t cgen_var_1535; |
| 22770 | countingStream->handleMapping()->mapHandles_VkDeviceMemory_u64(&local_memory, &cgen_var_1535, 1); |
| 22771 | countingStream->write((uint64_t*)&cgen_var_1535, 1 * 8); |
| 22772 | // WARNING PTR CHECK |
| 22773 | uint64_t cgen_var_1536 = (uint64_t)(uintptr_t)pAddress; |
| 22774 | countingStream->putBe64(cgen_var_1536); |
| 22775 | if (pAddress) |
| 22776 | { |
| 22777 | countingStream->write((uint64_t*)pAddress, sizeof(uint64_t)); |
| 22778 | } |
| 22779 | // WARNING PTR CHECK |
| 22780 | uint64_t cgen_var_1537 = (uint64_t)(uintptr_t)pSize; |
| 22781 | countingStream->putBe64(cgen_var_1537); |
| 22782 | if (pSize) |
| 22783 | { |
| 22784 | countingStream->write((uint64_t*)pSize, sizeof(uint64_t)); |
| 22785 | } |
| 22786 | // WARNING PTR CHECK |
| 22787 | uint64_t cgen_var_1538 = (uint64_t)(uintptr_t)pHostmemId; |
| 22788 | countingStream->putBe64(cgen_var_1538); |
| 22789 | if (pHostmemId) |
| 22790 | { |
| 22791 | countingStream->write((uint64_t*)pHostmemId, sizeof(uint64_t)); |
| 22792 | } |
| 22793 | } |
| 22794 | uint32_t packetSize_vkGetMemoryHostAddressInfoGOOGLE = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 22795 | countingStream->rewind(); |
| 22796 | uint32_t opcode_vkGetMemoryHostAddressInfoGOOGLE = OP_vkGetMemoryHostAddressInfoGOOGLE; |
| 22797 | stream->write(&opcode_vkGetMemoryHostAddressInfoGOOGLE, sizeof(uint32_t)); |
| 22798 | stream->write(&packetSize_vkGetMemoryHostAddressInfoGOOGLE, sizeof(uint32_t)); |
| 22799 | uint64_t cgen_var_1539; |
| 22800 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1539, 1); |
| 22801 | stream->write((uint64_t*)&cgen_var_1539, 1 * 8); |
| 22802 | uint64_t cgen_var_1540; |
| 22803 | stream->handleMapping()->mapHandles_VkDeviceMemory_u64(&local_memory, &cgen_var_1540, 1); |
| 22804 | stream->write((uint64_t*)&cgen_var_1540, 1 * 8); |
| 22805 | // WARNING PTR CHECK |
| 22806 | uint64_t cgen_var_1541 = (uint64_t)(uintptr_t)pAddress; |
| 22807 | stream->putBe64(cgen_var_1541); |
| 22808 | if (pAddress) |
| 22809 | { |
| 22810 | stream->write((uint64_t*)pAddress, sizeof(uint64_t)); |
| 22811 | } |
| 22812 | // WARNING PTR CHECK |
| 22813 | uint64_t cgen_var_1542 = (uint64_t)(uintptr_t)pSize; |
| 22814 | stream->putBe64(cgen_var_1542); |
| 22815 | if (pSize) |
| 22816 | { |
| 22817 | stream->write((uint64_t*)pSize, sizeof(uint64_t)); |
| 22818 | } |
| 22819 | // WARNING PTR CHECK |
| 22820 | uint64_t cgen_var_1543 = (uint64_t)(uintptr_t)pHostmemId; |
| 22821 | stream->putBe64(cgen_var_1543); |
| 22822 | if (pHostmemId) |
| 22823 | { |
| 22824 | stream->write((uint64_t*)pHostmemId, sizeof(uint64_t)); |
| 22825 | } |
| Lingfeng Yang | 4c54241 | 2020-02-04 18:18:32 -0800 | [diff] [blame] | 22826 | // WARNING PTR CHECK |
| 22827 | uint64_t* check_pAddress; |
| 22828 | check_pAddress = (uint64_t*)(uintptr_t)stream->getBe64(); |
| 22829 | if (pAddress) |
| 22830 | { |
| 22831 | if (!(check_pAddress)) |
| 22832 | { |
| 22833 | fprintf(stderr, "fatal: pAddress inconsistent between guest and host\n"); |
| 22834 | } |
| 22835 | stream->read((uint64_t*)pAddress, sizeof(uint64_t)); |
| 22836 | } |
| 22837 | // WARNING PTR CHECK |
| 22838 | uint64_t* check_pSize; |
| 22839 | check_pSize = (uint64_t*)(uintptr_t)stream->getBe64(); |
| 22840 | if (pSize) |
| 22841 | { |
| 22842 | if (!(check_pSize)) |
| 22843 | { |
| 22844 | fprintf(stderr, "fatal: pSize inconsistent between guest and host\n"); |
| 22845 | } |
| 22846 | stream->read((uint64_t*)pSize, sizeof(uint64_t)); |
| 22847 | } |
| 22848 | // WARNING PTR CHECK |
| 22849 | uint64_t* check_pHostmemId; |
| 22850 | check_pHostmemId = (uint64_t*)(uintptr_t)stream->getBe64(); |
| 22851 | if (pHostmemId) |
| 22852 | { |
| 22853 | if (!(check_pHostmemId)) |
| 22854 | { |
| 22855 | fprintf(stderr, "fatal: pHostmemId inconsistent between guest and host\n"); |
| 22856 | } |
| 22857 | stream->read((uint64_t*)pHostmemId, sizeof(uint64_t)); |
| 22858 | } |
| Lingfeng Yang | 4c54241 | 2020-02-04 18:18:32 -0800 | [diff] [blame] | 22859 | VkResult vkGetMemoryHostAddressInfoGOOGLE_VkResult_return = (VkResult)0; |
| 22860 | stream->read(&vkGetMemoryHostAddressInfoGOOGLE_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 22861 | pool->freeAll(); |
| Lingfeng Yang | 4c54241 | 2020-02-04 18:18:32 -0800 | [diff] [blame] | 22862 | countingStream->clearPool(); |
| 22863 | stream->clearPool(); |
| Lingfeng Yang | 4c54241 | 2020-02-04 18:18:32 -0800 | [diff] [blame] | 22864 | mImpl->log("finish vkGetMemoryHostAddressInfoGOOGLE");; |
| 22865 | return vkGetMemoryHostAddressInfoGOOGLE_VkResult_return; |
| 22866 | } |
| 22867 | |
| 22868 | #endif |
| Lingfeng Yang | 2f39a1f | 2020-04-14 19:24:41 -0700 | [diff] [blame] | 22869 | #ifdef VK_GOOGLE_free_memory_sync |
| 22870 | VkResult VkEncoder::vkFreeMemorySyncGOOGLE( |
| 22871 | VkDevice device, |
| 22872 | VkDeviceMemory memory, |
| 22873 | const VkAllocationCallbacks* pAllocator) |
| 22874 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 22875 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | 2f39a1f | 2020-04-14 19:24:41 -0700 | [diff] [blame] | 22876 | mImpl->log("start vkFreeMemorySyncGOOGLE"); |
| 22877 | auto stream = mImpl->stream(); |
| 22878 | auto countingStream = mImpl->countingStream(); |
| 22879 | auto resources = mImpl->resources(); |
| 22880 | auto pool = mImpl->pool(); |
| 22881 | stream->setHandleMapping(resources->unwrapMapping()); |
| 22882 | VkDevice local_device; |
| 22883 | VkDeviceMemory local_memory; |
| 22884 | VkAllocationCallbacks* local_pAllocator; |
| 22885 | local_device = device; |
| 22886 | local_memory = memory; |
| 22887 | local_pAllocator = nullptr; |
| 22888 | if (pAllocator) |
| 22889 | { |
| 22890 | local_pAllocator = (VkAllocationCallbacks*)pool->alloc(sizeof(const VkAllocationCallbacks)); |
| 22891 | deepcopy_VkAllocationCallbacks(pool, pAllocator, (VkAllocationCallbacks*)(local_pAllocator)); |
| 22892 | } |
| 22893 | local_pAllocator = nullptr; |
| 22894 | mImpl->resources()->deviceMemoryTransform_tohost((VkDeviceMemory*)&local_memory, 1, (VkDeviceSize*)nullptr, 0, (VkDeviceSize*)nullptr, 0, (uint32_t*)nullptr, 0, (uint32_t*)nullptr, 0); |
| 22895 | countingStream->rewind(); |
| 22896 | { |
| 22897 | uint64_t cgen_var_1547; |
| 22898 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1547, 1); |
| 22899 | countingStream->write((uint64_t*)&cgen_var_1547, 1 * 8); |
| 22900 | uint64_t cgen_var_1548; |
| 22901 | countingStream->handleMapping()->mapHandles_VkDeviceMemory_u64(&local_memory, &cgen_var_1548, 1); |
| 22902 | countingStream->write((uint64_t*)&cgen_var_1548, 1 * 8); |
| 22903 | // WARNING PTR CHECK |
| 22904 | uint64_t cgen_var_1549 = (uint64_t)(uintptr_t)local_pAllocator; |
| 22905 | countingStream->putBe64(cgen_var_1549); |
| 22906 | if (local_pAllocator) |
| 22907 | { |
| 22908 | marshal_VkAllocationCallbacks(countingStream, (VkAllocationCallbacks*)(local_pAllocator)); |
| 22909 | } |
| 22910 | } |
| 22911 | uint32_t packetSize_vkFreeMemorySyncGOOGLE = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 22912 | countingStream->rewind(); |
| 22913 | uint32_t opcode_vkFreeMemorySyncGOOGLE = OP_vkFreeMemorySyncGOOGLE; |
| 22914 | stream->write(&opcode_vkFreeMemorySyncGOOGLE, sizeof(uint32_t)); |
| 22915 | stream->write(&packetSize_vkFreeMemorySyncGOOGLE, sizeof(uint32_t)); |
| 22916 | uint64_t cgen_var_1550; |
| 22917 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1550, 1); |
| 22918 | stream->write((uint64_t*)&cgen_var_1550, 1 * 8); |
| 22919 | uint64_t cgen_var_1551; |
| 22920 | stream->handleMapping()->mapHandles_VkDeviceMemory_u64(&local_memory, &cgen_var_1551, 1); |
| 22921 | stream->write((uint64_t*)&cgen_var_1551, 1 * 8); |
| 22922 | // WARNING PTR CHECK |
| 22923 | uint64_t cgen_var_1552 = (uint64_t)(uintptr_t)local_pAllocator; |
| 22924 | stream->putBe64(cgen_var_1552); |
| 22925 | if (local_pAllocator) |
| 22926 | { |
| 22927 | marshal_VkAllocationCallbacks(stream, (VkAllocationCallbacks*)(local_pAllocator)); |
| 22928 | } |
| Lingfeng Yang | 2f39a1f | 2020-04-14 19:24:41 -0700 | [diff] [blame] | 22929 | VkResult vkFreeMemorySyncGOOGLE_VkResult_return = (VkResult)0; |
| 22930 | stream->read(&vkFreeMemorySyncGOOGLE_VkResult_return, sizeof(VkResult)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 22931 | resources->destroyMapping()->mapHandles_VkDeviceMemory((VkDeviceMemory*)&memory); |
| 22932 | pool->freeAll(); |
| Lingfeng Yang | 2f39a1f | 2020-04-14 19:24:41 -0700 | [diff] [blame] | 22933 | countingStream->clearPool(); |
| 22934 | stream->clearPool(); |
| Lingfeng Yang | 2f39a1f | 2020-04-14 19:24:41 -0700 | [diff] [blame] | 22935 | mImpl->log("finish vkFreeMemorySyncGOOGLE");; |
| 22936 | return vkFreeMemorySyncGOOGLE_VkResult_return; |
| 22937 | } |
| 22938 | |
| 22939 | #endif |
| Lingfeng Yang | f89f75d | 2020-07-09 17:42:33 -0700 | [diff] [blame] | 22940 | #ifdef VK_GOOGLE_async_queue_submit |
| 22941 | void VkEncoder::vkQueueHostSyncGOOGLE( |
| 22942 | VkQueue queue, |
| 22943 | uint32_t needHostSync, |
| 22944 | uint32_t sequenceNumber) |
| 22945 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 22946 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | f89f75d | 2020-07-09 17:42:33 -0700 | [diff] [blame] | 22947 | mImpl->log("start vkQueueHostSyncGOOGLE"); |
| 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 | VkQueue local_queue; |
| 22954 | uint32_t local_needHostSync; |
| 22955 | uint32_t local_sequenceNumber; |
| 22956 | local_queue = queue; |
| 22957 | local_needHostSync = needHostSync; |
| 22958 | local_sequenceNumber = sequenceNumber; |
| 22959 | countingStream->rewind(); |
| 22960 | { |
| 22961 | uint64_t cgen_var_1553; |
| 22962 | countingStream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_1553, 1); |
| 22963 | countingStream->write((uint64_t*)&cgen_var_1553, 1 * 8); |
| 22964 | countingStream->write((uint32_t*)&local_needHostSync, sizeof(uint32_t)); |
| 22965 | countingStream->write((uint32_t*)&local_sequenceNumber, sizeof(uint32_t)); |
| 22966 | } |
| 22967 | uint32_t packetSize_vkQueueHostSyncGOOGLE = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 22968 | countingStream->rewind(); |
| 22969 | uint32_t opcode_vkQueueHostSyncGOOGLE = OP_vkQueueHostSyncGOOGLE; |
| 22970 | stream->write(&opcode_vkQueueHostSyncGOOGLE, sizeof(uint32_t)); |
| 22971 | stream->write(&packetSize_vkQueueHostSyncGOOGLE, sizeof(uint32_t)); |
| 22972 | uint64_t cgen_var_1554; |
| 22973 | stream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_1554, 1); |
| 22974 | stream->write((uint64_t*)&cgen_var_1554, 1 * 8); |
| 22975 | stream->write((uint32_t*)&local_needHostSync, sizeof(uint32_t)); |
| 22976 | stream->write((uint32_t*)&local_sequenceNumber, sizeof(uint32_t)); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 22977 | pool->freeAll(); |
| 22978 | countingStream->clearPool(); |
| 22979 | stream->clearPool(); |
| Lingfeng Yang | f89f75d | 2020-07-09 17:42:33 -0700 | [diff] [blame] | 22980 | mImpl->log("finish vkQueueHostSyncGOOGLE");; |
| 22981 | } |
| 22982 | |
| 22983 | void VkEncoder::vkQueueSubmitAsyncGOOGLE( |
| 22984 | VkQueue queue, |
| 22985 | uint32_t submitCount, |
| 22986 | const VkSubmitInfo* pSubmits, |
| 22987 | VkFence fence) |
| 22988 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 22989 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | f89f75d | 2020-07-09 17:42:33 -0700 | [diff] [blame] | 22990 | mImpl->log("start vkQueueSubmitAsyncGOOGLE"); |
| 22991 | auto stream = mImpl->stream(); |
| 22992 | auto countingStream = mImpl->countingStream(); |
| 22993 | auto resources = mImpl->resources(); |
| 22994 | auto pool = mImpl->pool(); |
| 22995 | stream->setHandleMapping(resources->unwrapMapping()); |
| 22996 | VkQueue local_queue; |
| 22997 | uint32_t local_submitCount; |
| 22998 | VkSubmitInfo* local_pSubmits; |
| 22999 | VkFence local_fence; |
| 23000 | local_queue = queue; |
| 23001 | local_submitCount = submitCount; |
| 23002 | local_pSubmits = nullptr; |
| 23003 | if (pSubmits) |
| 23004 | { |
| 23005 | local_pSubmits = (VkSubmitInfo*)pool->alloc(((submitCount)) * sizeof(const VkSubmitInfo)); |
| 23006 | for (uint32_t i = 0; i < (uint32_t)((submitCount)); ++i) |
| 23007 | { |
| 23008 | deepcopy_VkSubmitInfo(pool, pSubmits + i, (VkSubmitInfo*)(local_pSubmits + i)); |
| 23009 | } |
| 23010 | } |
| 23011 | local_fence = fence; |
| 23012 | if (local_pSubmits) |
| 23013 | { |
| 23014 | for (uint32_t i = 0; i < (uint32_t)((submitCount)); ++i) |
| 23015 | { |
| 23016 | transform_tohost_VkSubmitInfo(mImpl->resources(), (VkSubmitInfo*)(local_pSubmits + i)); |
| 23017 | } |
| 23018 | } |
| 23019 | countingStream->rewind(); |
| 23020 | { |
| 23021 | uint64_t cgen_var_1555; |
| 23022 | countingStream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_1555, 1); |
| 23023 | countingStream->write((uint64_t*)&cgen_var_1555, 1 * 8); |
| 23024 | countingStream->write((uint32_t*)&local_submitCount, sizeof(uint32_t)); |
| 23025 | for (uint32_t i = 0; i < (uint32_t)((submitCount)); ++i) |
| 23026 | { |
| 23027 | marshal_VkSubmitInfo(countingStream, (VkSubmitInfo*)(local_pSubmits + i)); |
| 23028 | } |
| 23029 | uint64_t cgen_var_1556; |
| 23030 | countingStream->handleMapping()->mapHandles_VkFence_u64(&local_fence, &cgen_var_1556, 1); |
| 23031 | countingStream->write((uint64_t*)&cgen_var_1556, 1 * 8); |
| 23032 | } |
| 23033 | uint32_t packetSize_vkQueueSubmitAsyncGOOGLE = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 23034 | countingStream->rewind(); |
| 23035 | uint32_t opcode_vkQueueSubmitAsyncGOOGLE = OP_vkQueueSubmitAsyncGOOGLE; |
| 23036 | stream->write(&opcode_vkQueueSubmitAsyncGOOGLE, sizeof(uint32_t)); |
| 23037 | stream->write(&packetSize_vkQueueSubmitAsyncGOOGLE, sizeof(uint32_t)); |
| 23038 | uint64_t cgen_var_1557; |
| 23039 | stream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_1557, 1); |
| 23040 | stream->write((uint64_t*)&cgen_var_1557, 1 * 8); |
| 23041 | stream->write((uint32_t*)&local_submitCount, sizeof(uint32_t)); |
| 23042 | for (uint32_t i = 0; i < (uint32_t)((submitCount)); ++i) |
| 23043 | { |
| 23044 | marshal_VkSubmitInfo(stream, (VkSubmitInfo*)(local_pSubmits + i)); |
| 23045 | } |
| 23046 | uint64_t cgen_var_1558; |
| 23047 | stream->handleMapping()->mapHandles_VkFence_u64(&local_fence, &cgen_var_1558, 1); |
| 23048 | stream->write((uint64_t*)&cgen_var_1558, 1 * 8); |
| Lingfeng Yang | f89f75d | 2020-07-09 17:42:33 -0700 | [diff] [blame] | 23049 | stream->flush(); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 23050 | pool->freeAll(); |
| 23051 | countingStream->clearPool(); |
| 23052 | stream->clearPool(); |
| Lingfeng Yang | f89f75d | 2020-07-09 17:42:33 -0700 | [diff] [blame] | 23053 | mImpl->log("finish vkQueueSubmitAsyncGOOGLE");; |
| 23054 | } |
| 23055 | |
| 23056 | void VkEncoder::vkQueueWaitIdleAsyncGOOGLE( |
| 23057 | VkQueue queue) |
| 23058 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 23059 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | f89f75d | 2020-07-09 17:42:33 -0700 | [diff] [blame] | 23060 | mImpl->log("start vkQueueWaitIdleAsyncGOOGLE"); |
| 23061 | auto stream = mImpl->stream(); |
| 23062 | auto countingStream = mImpl->countingStream(); |
| 23063 | auto resources = mImpl->resources(); |
| 23064 | auto pool = mImpl->pool(); |
| 23065 | stream->setHandleMapping(resources->unwrapMapping()); |
| 23066 | VkQueue local_queue; |
| 23067 | local_queue = queue; |
| 23068 | countingStream->rewind(); |
| 23069 | { |
| 23070 | uint64_t cgen_var_1559; |
| 23071 | countingStream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_1559, 1); |
| 23072 | countingStream->write((uint64_t*)&cgen_var_1559, 1 * 8); |
| 23073 | } |
| 23074 | uint32_t packetSize_vkQueueWaitIdleAsyncGOOGLE = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 23075 | countingStream->rewind(); |
| 23076 | uint32_t opcode_vkQueueWaitIdleAsyncGOOGLE = OP_vkQueueWaitIdleAsyncGOOGLE; |
| 23077 | stream->write(&opcode_vkQueueWaitIdleAsyncGOOGLE, sizeof(uint32_t)); |
| 23078 | stream->write(&packetSize_vkQueueWaitIdleAsyncGOOGLE, sizeof(uint32_t)); |
| 23079 | uint64_t cgen_var_1560; |
| 23080 | stream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_1560, 1); |
| 23081 | stream->write((uint64_t*)&cgen_var_1560, 1 * 8); |
| Lingfeng Yang | f89f75d | 2020-07-09 17:42:33 -0700 | [diff] [blame] | 23082 | stream->flush(); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 23083 | pool->freeAll(); |
| 23084 | countingStream->clearPool(); |
| 23085 | stream->clearPool(); |
| Lingfeng Yang | f89f75d | 2020-07-09 17:42:33 -0700 | [diff] [blame] | 23086 | mImpl->log("finish vkQueueWaitIdleAsyncGOOGLE");; |
| 23087 | } |
| 23088 | |
| 23089 | void VkEncoder::vkQueueBindSparseAsyncGOOGLE( |
| 23090 | VkQueue queue, |
| 23091 | uint32_t bindInfoCount, |
| 23092 | const VkBindSparseInfo* pBindInfo, |
| 23093 | VkFence fence) |
| 23094 | { |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 23095 | EncoderAutoLock encoderLock(this); |
| Lingfeng Yang | f89f75d | 2020-07-09 17:42:33 -0700 | [diff] [blame] | 23096 | mImpl->log("start vkQueueBindSparseAsyncGOOGLE"); |
| 23097 | auto stream = mImpl->stream(); |
| 23098 | auto countingStream = mImpl->countingStream(); |
| 23099 | auto resources = mImpl->resources(); |
| 23100 | auto pool = mImpl->pool(); |
| 23101 | stream->setHandleMapping(resources->unwrapMapping()); |
| 23102 | VkQueue local_queue; |
| 23103 | uint32_t local_bindInfoCount; |
| 23104 | VkBindSparseInfo* local_pBindInfo; |
| 23105 | VkFence local_fence; |
| 23106 | local_queue = queue; |
| 23107 | local_bindInfoCount = bindInfoCount; |
| 23108 | local_pBindInfo = nullptr; |
| 23109 | if (pBindInfo) |
| 23110 | { |
| 23111 | local_pBindInfo = (VkBindSparseInfo*)pool->alloc(((bindInfoCount)) * sizeof(const VkBindSparseInfo)); |
| 23112 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 23113 | { |
| 23114 | deepcopy_VkBindSparseInfo(pool, pBindInfo + i, (VkBindSparseInfo*)(local_pBindInfo + i)); |
| 23115 | } |
| 23116 | } |
| 23117 | local_fence = fence; |
| 23118 | if (local_pBindInfo) |
| 23119 | { |
| 23120 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 23121 | { |
| 23122 | transform_tohost_VkBindSparseInfo(mImpl->resources(), (VkBindSparseInfo*)(local_pBindInfo + i)); |
| 23123 | } |
| 23124 | } |
| 23125 | countingStream->rewind(); |
| 23126 | { |
| 23127 | uint64_t cgen_var_1561; |
| 23128 | countingStream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_1561, 1); |
| 23129 | countingStream->write((uint64_t*)&cgen_var_1561, 1 * 8); |
| 23130 | countingStream->write((uint32_t*)&local_bindInfoCount, sizeof(uint32_t)); |
| 23131 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 23132 | { |
| 23133 | marshal_VkBindSparseInfo(countingStream, (VkBindSparseInfo*)(local_pBindInfo + i)); |
| 23134 | } |
| 23135 | uint64_t cgen_var_1562; |
| 23136 | countingStream->handleMapping()->mapHandles_VkFence_u64(&local_fence, &cgen_var_1562, 1); |
| 23137 | countingStream->write((uint64_t*)&cgen_var_1562, 1 * 8); |
| 23138 | } |
| 23139 | uint32_t packetSize_vkQueueBindSparseAsyncGOOGLE = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 23140 | countingStream->rewind(); |
| 23141 | uint32_t opcode_vkQueueBindSparseAsyncGOOGLE = OP_vkQueueBindSparseAsyncGOOGLE; |
| 23142 | stream->write(&opcode_vkQueueBindSparseAsyncGOOGLE, sizeof(uint32_t)); |
| 23143 | stream->write(&packetSize_vkQueueBindSparseAsyncGOOGLE, sizeof(uint32_t)); |
| 23144 | uint64_t cgen_var_1563; |
| 23145 | stream->handleMapping()->mapHandles_VkQueue_u64(&local_queue, &cgen_var_1563, 1); |
| 23146 | stream->write((uint64_t*)&cgen_var_1563, 1 * 8); |
| 23147 | stream->write((uint32_t*)&local_bindInfoCount, sizeof(uint32_t)); |
| 23148 | for (uint32_t i = 0; i < (uint32_t)((bindInfoCount)); ++i) |
| 23149 | { |
| 23150 | marshal_VkBindSparseInfo(stream, (VkBindSparseInfo*)(local_pBindInfo + i)); |
| 23151 | } |
| 23152 | uint64_t cgen_var_1564; |
| 23153 | stream->handleMapping()->mapHandles_VkFence_u64(&local_fence, &cgen_var_1564, 1); |
| 23154 | stream->write((uint64_t*)&cgen_var_1564, 1 * 8); |
| Lingfeng Yang | f89f75d | 2020-07-09 17:42:33 -0700 | [diff] [blame] | 23155 | stream->flush(); |
| Lingfeng Yang | 256f925 | 2020-07-14 14:27:33 -0700 | [diff] [blame] | 23156 | pool->freeAll(); |
| 23157 | countingStream->clearPool(); |
| 23158 | stream->clearPool(); |
| Lingfeng Yang | f89f75d | 2020-07-09 17:42:33 -0700 | [diff] [blame] | 23159 | mImpl->log("finish vkQueueBindSparseAsyncGOOGLE");; |
| 23160 | } |
| 23161 | |
| 23162 | #endif |
| Yilong Li | a48b010 | 2020-09-15 15:08:28 -0700 | [diff] [blame] | 23163 | #ifdef VK_GOOGLE_linear_image_layout |
| 23164 | void VkEncoder::vkGetLinearImageLayoutGOOGLE( |
| 23165 | VkDevice device, |
| 23166 | VkFormat format, |
| 23167 | VkDeviceSize* pOffset, |
| 23168 | VkDeviceSize* pRowPitchAlignment) |
| 23169 | { |
| 23170 | EncoderAutoLock encoderLock(this); |
| Yilong Li | a48b010 | 2020-09-15 15:08:28 -0700 | [diff] [blame] | 23171 | mImpl->log("start vkGetLinearImageLayoutGOOGLE"); |
| 23172 | auto stream = mImpl->stream(); |
| 23173 | auto countingStream = mImpl->countingStream(); |
| 23174 | auto resources = mImpl->resources(); |
| 23175 | auto pool = mImpl->pool(); |
| 23176 | stream->setHandleMapping(resources->unwrapMapping()); |
| 23177 | VkDevice local_device; |
| 23178 | VkFormat local_format; |
| 23179 | local_device = device; |
| 23180 | local_format = format; |
| 23181 | countingStream->rewind(); |
| 23182 | { |
| 23183 | uint64_t cgen_var_1565; |
| 23184 | countingStream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1565, 1); |
| 23185 | countingStream->write((uint64_t*)&cgen_var_1565, 1 * 8); |
| 23186 | countingStream->write((VkFormat*)&local_format, sizeof(VkFormat)); |
| 23187 | countingStream->write((VkDeviceSize*)pOffset, sizeof(VkDeviceSize)); |
| 23188 | countingStream->write((VkDeviceSize*)pRowPitchAlignment, sizeof(VkDeviceSize)); |
| 23189 | } |
| 23190 | uint32_t packetSize_vkGetLinearImageLayoutGOOGLE = 4 + 4 + (uint32_t)countingStream->bytesWritten(); |
| 23191 | countingStream->rewind(); |
| 23192 | uint32_t opcode_vkGetLinearImageLayoutGOOGLE = OP_vkGetLinearImageLayoutGOOGLE; |
| 23193 | stream->write(&opcode_vkGetLinearImageLayoutGOOGLE, sizeof(uint32_t)); |
| 23194 | stream->write(&packetSize_vkGetLinearImageLayoutGOOGLE, sizeof(uint32_t)); |
| 23195 | uint64_t cgen_var_1566; |
| 23196 | stream->handleMapping()->mapHandles_VkDevice_u64(&local_device, &cgen_var_1566, 1); |
| 23197 | stream->write((uint64_t*)&cgen_var_1566, 1 * 8); |
| 23198 | stream->write((VkFormat*)&local_format, sizeof(VkFormat)); |
| 23199 | stream->write((VkDeviceSize*)pOffset, sizeof(VkDeviceSize)); |
| 23200 | stream->write((VkDeviceSize*)pRowPitchAlignment, sizeof(VkDeviceSize)); |
| Yilong Li | a48b010 | 2020-09-15 15:08:28 -0700 | [diff] [blame] | 23201 | stream->read((VkDeviceSize*)pOffset, sizeof(VkDeviceSize)); |
| 23202 | stream->read((VkDeviceSize*)pRowPitchAlignment, sizeof(VkDeviceSize)); |
| Yilong Li | a48b010 | 2020-09-15 15:08:28 -0700 | [diff] [blame] | 23203 | pool->freeAll(); |
| 23204 | countingStream->clearPool(); |
| 23205 | stream->clearPool(); |
| 23206 | mImpl->log("finish vkGetLinearImageLayoutGOOGLE");; |
| 23207 | } |
| 23208 | |
| 23209 | #endif |
| Lingfeng Yang | f4d77ef | 2018-11-02 23:21:37 -0700 | [diff] [blame] | 23210 | |
| Lingfeng Yang | b1d9010 | 2018-11-29 16:10:36 -0800 | [diff] [blame] | 23211 | } // namespace goldfish_vk |