| 1 | #cxx . . $ `<file>/primus_vk.cpp`/define VK_USE_PLATFORM_XCB_KHRcxx . . $ `primus_vk.cpp:1:9`! |
| 2 | #define VK_USE_PLATFORM_XLIB_KHRcxx . . $ `primus_vk.cpp:2:9`! |
| 3 | #define VK_USE_PLATFORM_WAYLAND_KHRcxx . . $ `primus_vk.cpp:3:9`! |
| 4 | #include "vulkan.h" |
| 5 | #include "vk_layer.h" |
| 6 | |
| 7 | #include "primus_vk_dispatch_table.h"cxx . . $ `<file>/primus_vk_dispatch_table.h`/ |
| 8 | |
| 9 | #include <cassert> |
| 10 | #include <cstring> |
| 11 | |
| 12 | #include <mutex> |
| 13 | #include <condition_variable> |
| 14 | #include <map> |
| 15 | #include <vector> |
| 16 | #include <list> |
| 17 | #include <iostream> |
| 18 | |
| 19 | #include <pthread.h> |
| 20 | |
| 21 | #include <stdexcept> |
| 22 | |
| 23 | #include <dlfcn.h> |
| 24 | |
| 25 | #include <vector> |
| 26 | #include <memory> |
| 27 | #include <thread> |
| 28 | #include <algorithm> |
| 29 | #include <sstream> |
| 30 | #include <string> |
| 31 | #include <chrono> |
| 32 | #include <functional> |
| 33 | |
| 34 | #include <X11/extensions/Xrandr.h> |
| 35 | |
| 36 | #undef VK_LAYER_EXPORT |
| 37 | #if defined(WIN32) |
| 38 | #define VK_LAYER_EXPORT extern "C" __declspec(dllexport) |
| 39 | #else |
| 40 | #define VK_LAYER_EXPORTcxx . . $ `primus_vk.cpp:40:9`! extern "C" |
| 41 | #endif |
| 42 | |
| 43 | // single global lock, for simplicity |
| 44 | stdcxx . . $ std/::mutexcxx . . $ std/mutex# global_lockcxx . . $ global_lock.; |
| 45 | typedef stdcxx . . $ std/::lock_guardcxx . . $ std/lock_guard#<stdcxx . . $ std/::mutexcxx . . $ std/mutex#> scoped_lockcxx . . $ scoped_lock#; |
| 46 | |
| 47 | // use the loader's dispatch table pointer as a key for dispatch map lookups |
| 48 | template<typename DispatchableType> |
| 49 | void *&GetKeycxx . . $ GetKey(d29c9e52fbefad67).(DispatchableType inst) |
| 50 | { |
| 51 | return *(void **)inst; |
| 52 | } |
| 53 | |
| 54 | class CreateOtherDevicecxx . . $ CreateOtherDevice#; |
| 55 | |
| 56 | // #define TRACE(x) |
| 57 | #define TRACEcxx . . $ `primus_vk.cpp:57:9`!(x) std::cerr << "PrimusVK: " << x << "\n"; |
| 58 | #define TRACE_PROFILINGcxx . . $ `primus_vk.cpp:58:9`!(x) |
| 59 | // #define TRACE_PROFILING(x) std::cout << "PrimusVK: " << x << "\n"; |
| 60 | #define TRACE_PROFILING_EVENTcxx . . $ `primus_vk.cpp:60:9`!(x, y) |
| 61 | // #define TRACE_PROFILING_EVENT(idx, evt) std::cout << "PrimusVK-profiling: " << idx << " " << std::chrono::duration_cast<std::chrono::nanoseconds>(std::chrono::steady_clock::now() - primus_start).count() << " " << evt << "\n"; |
| 62 | #define TRACE_FRAMEcxx . . $ `primus_vk.cpp:62:9`!(x) |
| 63 | // #define TRACE_FRAME(x) std::cout << "PrimusVK: " << x << "\n"; |
| 64 | |
| 65 | #define VK_CHECK_RESULTcxx . . $ `primus_vk.cpp:65:9`!(x) do{ const VkResult r = x; if(r != VK_SUCCESS){printf("PrimusVK: Error %d in line %d.\n", r, __LINE__);}}while(0); |
| 66 | // #define VK_CHECK_RESULT(x) if(x != VK_SUCCESS){printf("Error %d, in %d\n", x, __LINE__);} |
| 67 | |
| 68 | struct InstanceInfocxx . . $ InstanceInfo# { |
| 69 | public: |
| 70 | VkInstance instancecxx . . $ InstanceInfo#instance.; |
| 71 | PFN_vkLayerCreateDevicecxx . . $ PFN_vkLayerCreateDevice# layerCreateDevicecxx . . $ InstanceInfo#layerCreateDevice.; |
| 72 | PFN_vkLayerDestroyDevicecxx . . $ PFN_vkLayerDestroyDevice# layerDestroyDevicecxx . . $ InstanceInfo#layerDestroyDevice.; |
| 73 | |
| 74 | VkPhysicalDevice rendercxx . . $ InstanceInfo#render. = VK_NULL_HANDLEcxx . . $ `<external>/13734482859137699468/vulkan_core.h:41:21`!; |
| 75 | uint32_t renderQueueFamilyIndexcxx . . $ InstanceInfo#renderQueueFamilyIndex. = 0; |
| 76 | VkPhysicalDevice displaycxx . . $ InstanceInfo#display. = VK_NULL_HANDLEcxx . . $ `<external>/13734482859137699468/vulkan_core.h:41:21`!; |
| 77 | uint32_t displayQueueFamilyIndexcxx . . $ InstanceInfo#displayQueueFamilyIndex. = 0; |
| 78 | stdcxx . . $ std/::mapcxx . . $ std/map#<void*, stdcxx . . $ std/::shared_ptrcxx . . $ std/shared_ptr#<CreateOtherDevicecxx . . $ CreateOtherDevice#>> codcxx . . $ InstanceInfo#cod. =cxx . . $ std/map#map(49f6e7a06ebc5aa8). {}; |
| 79 | |
| 80 | stdcxx . . $ std/::shared_ptrcxx . . $ std/shared_ptr#<stdcxx . . $ std/::mutexcxx . . $ std/mutex#> renderQueueMutexcxx . . $ InstanceInfo#renderQueueMutex. = stdcxx . . $ std/::make_sharedcxx . . $ std/make_shared(ffca0f3977536948).<stdcxx . . $ std/::mutexcxx . . $ std/mutex#>(); |
| 81 | InstanceInfocxx . . $ InstanceInfo#InstanceInfo(49f6e7a06ebc5aa8).() = default; |
| 82 | InstanceInfocxx . . $ InstanceInfo#InstanceInfo(fa125c687000c644).(const InstanceInfocxx . . $ InstanceInfo# &) = delete; |
| 83 | InstanceInfocxx . . $ InstanceInfo#InstanceInfo(80aaa9e4df907d5a).(InstanceInfocxx . . $ InstanceInfo# &&) = default; |
| 84 | InstanceInfocxx . . $ InstanceInfo#InstanceInfo(beb60864f7202da2).(VkInstance instance, |
| 85 | PFN_vkLayerCreateDevicecxx . . $ PFN_vkLayerCreateDevice# layerCreateDevice, |
| 86 | PFN_vkLayerDestroyDevicecxx . . $ PFN_vkLayerDestroyDevice# layerDestroyDevice) : instancecxx . . $ InstanceInfo#instance.(instance), layerCreateDevicecxx . . $ InstanceInfo#layerCreateDevice.(layerCreateDevice), layerDestroyDevicecxx . . $ InstanceInfo#layerDestroyDevice.(layerDestroyDevice) { |
| 87 | } |
| 88 | InstanceInfocxx . . $ InstanceInfo# &operatorcxx . . $ InstanceInfo#`operator=`(f625c3b3ee791084).=(InstanceInfocxx . . $ InstanceInfo# &&) = default; |
| 89 | private: |
| 90 | void GetEnvVendorDeviceIDscxx . . $ InstanceInfo#GetEnvVendorDeviceIDs(2f6accceca21c89d).(stdcxx . . $ std/::stringcxx . . $ std/string# env, uint32_t &vendor, uint32_t &device) { |
| 91 | char *envstr = getenv(env.c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).()); |
| 92 | if(envstr != nullptr){ |
| 93 | stdcxx . . $ std/::stringstreamcxx . . $ std/stringstream# sscxx . . $ std/__cxx11/basic_stringstream#basic_stringstream(d3c8ea0e6521074c).(envstrcxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).); |
| 94 | stdcxx . . $ std/::stringcxx . . $ std/string# itemcxx . . $ std/__cxx11/basic_string#basic_string(925dcc5e17f50391).; |
| 95 | stdcxx . . $ std/::vectorcxx . . $ std/vector#<uint32_t> hexnumscxx . . $ std/vector#vector(83fdeebbe0501a83).(2); |
| 96 | int i = 0; |
| 97 | while(stdcxx . . $ std/::getlinecxx . . $ std/getline(30074676001a27e3).(ss, item, ':') && (i < 2)) { |
| 98 | uint32_t num = 0; |
| 99 | stdcxx . . $ std/::stringstreamcxx . . $ std/stringstream# _sscxx . . $ std/__cxx11/basic_stringstream#basic_stringstream(49f6e7a06ebc5aa8).; |
| 100 | _ss <<cxx . . $ std/basic_ostream#`operator<<`(d90e0e305b0e25c2). stdcxx . . $ std/::hexcxx . . $ std/hex(cf36cc481190cd1f). <<cxx . . $ std/`operator<<`(88df5bef833f7f83). item; |
| 101 | _ss >>cxx . . $ std/basic_istream#`operator>>`(f468ad56ed456da0). num; |
| 102 | hexnums[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).i] = num; |
| 103 | ++i; |
| 104 | } |
| 105 | vendor = hexnums[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).0]; |
| 106 | device = hexnums[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1]; |
| 107 | } |
| 108 | } |
| 109 | |
| 110 | bool IsDevicecxx . . $ InstanceInfo#IsDevice(2e7aa2a803107e4b).( |
| 111 | VkPhysicalDeviceProperties props, |
| 112 | uint32_t vendor, |
| 113 | uint32_t device, |
| 114 | VkPhysicalDeviceType type = VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU) { |
| 115 | if((vendor == 0) && (props.deviceType == type)){ |
| 116 | if(type == VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU){ |
| 117 | TRACEcxx . . $ `primus_vk.cpp:57:9`!("Got integrated gpu!"); |
| 118 | } else { |
| 119 | TRACEcxx . . $ `primus_vk.cpp:57:9`!("Got discrete gpu!"); |
| 120 | } |
| 121 | TRACEcxx . . $ `primus_vk.cpp:57:9`!("Device: " << props.deviceName); |
| 122 | TRACEcxx . . $ `primus_vk.cpp:57:9`!(" Type: " << props.deviceType); |
| 123 | return true; |
| 124 | } |
| 125 | if((props.vendorID == vendor) && (props.deviceID == device)){ |
| 126 | TRACEcxx . . $ `primus_vk.cpp:57:9`!("Got device from env!"); |
| 127 | TRACEcxx . . $ `primus_vk.cpp:57:9`!("Device: " << props.deviceName); |
| 128 | TRACEcxx . . $ `primus_vk.cpp:57:9`!(" Type: " << props.deviceType); |
| 129 | return true; |
| 130 | } |
| 131 | if(props.vendorID == vendor && device == 0){ |
| 132 | TRACEcxx . . $ `primus_vk.cpp:57:9`!("Got device from env! (via vendorID)"); |
| 133 | TRACEcxx . . $ `primus_vk.cpp:57:9`!("Device: " << props.deviceName); |
| 134 | TRACEcxx . . $ `primus_vk.cpp:57:9`!(" Type: " << props.deviceType); |
| 135 | return true; |
| 136 | } |
| 137 | return false; |
| 138 | } |
| 139 | |
| 140 | public: |
| 141 | VkResult searchDevicescxx . . $ InstanceInfo#searchDevices(b9e637a8c2cacc95).(PvkInstanceDispatchTablecxx . . $ PvkInstanceDispatchTable# &dispatchTable){ |
| 142 | uint32_t displayVendorID = 0; |
| 143 | uint32_t displayDeviceID = 0; |
| 144 | uint32_t renderVendorID = 0; |
| 145 | uint32_t renderDeviceID = 0; |
| 146 | GetEnvVendorDeviceIDscxx . . $ InstanceInfo#GetEnvVendorDeviceIDs(2f6accceca21c89d).("PRIMUS_VK_DISPLAYID"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d)., displayVendorID, displayDeviceID); |
| 147 | GetEnvVendorDeviceIDscxx . . $ InstanceInfo#GetEnvVendorDeviceIDs(2f6accceca21c89d).("PRIMUS_VK_RENDERID"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d)., renderVendorID, renderDeviceID); |
| 148 | |
| 149 | stdcxx . . $ std/::vectorcxx . . $ std/vector#<VkPhysicalDevice> physicalDevicescxx . . $ std/vector#vector(49f6e7a06ebc5aa8).; |
| 150 | { |
| 151 | auto enumerateDevices = dispatchTable.EnumeratePhysicalDevicescxx . . $ PvkInstanceDispatchTable#EnumeratePhysicalDevices.; |
| 152 | uint32_t gpuCount = 0; |
| 153 | enumerateDevices(instancecxx . . $ InstanceInfo#instance., &gpuCount, nullptr); |
| 154 | physicalDevices.resizecxx . . $ std/vector#resize(2c44cd906ae4e829).(gpuCount); |
| 155 | enumerateDevices(instancecxx . . $ InstanceInfo#instance., &gpuCount, physicalDevices.datacxx . . $ std/vector#data(258ee1c9e0a18a5c).()); |
| 156 | } |
| 157 | |
| 158 | TRACEcxx . . $ `primus_vk.cpp:57:9`!("Searching for display GPU:"); |
| 159 | for(auto &dev: physicalDevices){ |
| 160 | VkPhysicalDeviceProperties props; |
| 161 | dispatchTable.GetPhysicalDevicePropertiescxx . . $ PvkInstanceDispatchTable#GetPhysicalDeviceProperties.(dev, &props); |
| 162 | TRACEcxx . . $ `primus_vk.cpp:57:9`!(dev << ": " << props.vendorID << ";" << props.deviceID); |
| 163 | if(IsDevicecxx . . $ InstanceInfo#IsDevice(2e7aa2a803107e4b).(props, displayVendorID, displayDeviceID, VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU)){ |
| 164 | displaycxx . . $ InstanceInfo#display. = dev; |
| 165 | break; |
| 166 | } |
| 167 | } |
| 168 | |
| 169 | TRACEcxx . . $ `primus_vk.cpp:57:9`!("Searching for render GPU:"); |
| 170 | for(auto &dev: physicalDevices){ |
| 171 | VkPhysicalDeviceProperties props; |
| 172 | dispatchTable.GetPhysicalDevicePropertiescxx . . $ PvkInstanceDispatchTable#GetPhysicalDeviceProperties.(dev, &props); |
| 173 | TRACEcxx . . $ `primus_vk.cpp:57:9`!(dev << "."); |
| 174 | if(IsDevicecxx . . $ InstanceInfo#IsDevice(2e7aa2a803107e4b).(props, renderVendorID, renderDeviceID)){ |
| 175 | rendercxx . . $ InstanceInfo#render. = dev; |
| 176 | break; |
| 177 | } |
| 178 | } |
| 179 | if(displaycxx . . $ InstanceInfo#display. == VK_NULL_HANDLEcxx . . $ `<external>/13734482859137699468/vulkan_core.h:41:21`! || rendercxx . . $ InstanceInfo#render. == VK_NULL_HANDLEcxx . . $ `<external>/13734482859137699468/vulkan_core.h:41:21`!){ |
| 180 | const auto c_icd_filenames = getenv("VK_ICD_FILENAMES"); |
| 181 | if(displaycxx . . $ InstanceInfo#display. == VK_NULL_HANDLEcxx . . $ `<external>/13734482859137699468/vulkan_core.h:41:21`!) { |
| 182 | TRACEcxx . . $ `primus_vk.cpp:57:9`!("No device for the display GPU found. Are the intel-mesa drivers installed?"); |
| 183 | } |
| 184 | if(rendercxx . . $ InstanceInfo#render. == VK_NULL_HANDLEcxx . . $ `<external>/13734482859137699468/vulkan_core.h:41:21`!) { |
| 185 | TRACEcxx . . $ `primus_vk.cpp:57:9`!("No device for the rendering GPU found. Is the correct driver installed?"); |
| 186 | } |
| 187 | if(c_icd_filenames != nullptr) { |
| 188 | TRACEcxx . . $ `primus_vk.cpp:57:9`!("VK_ICD_FILENAMES=" << c_icd_filenames); |
| 189 | } else { |
| 190 | TRACEcxx . . $ `primus_vk.cpp:57:9`!("VK_ICD_FILENAMES not set"); |
| 191 | } |
| 192 | return VK_ERROR_INITIALIZATION_FAILED; |
| 193 | } |
| 194 | auto ret = getQueueFamilyIndexcxx . . $ InstanceInfo#getQueueFamilyIndex(78f24c34f3487619).(displaycxx . . $ InstanceInfo#display., dispatchTable, &displayQueueFamilyIndexcxx . . $ InstanceInfo#displayQueueFamilyIndex.); |
| 195 | if(ret != VK_SUCCESS){ |
| 196 | return ret; |
| 197 | } |
| 198 | ret = getQueueFamilyIndexcxx . . $ InstanceInfo#getQueueFamilyIndex(78f24c34f3487619).(rendercxx . . $ InstanceInfo#render., dispatchTable, &renderQueueFamilyIndexcxx . . $ InstanceInfo#renderQueueFamilyIndex.); |
| 199 | if(ret != VK_SUCCESS){ |
| 200 | return ret; |
| 201 | } |
| 202 | return VK_SUCCESS; |
| 203 | } |
| 204 | VkResult getQueueFamilyIndexcxx . . $ InstanceInfo#getQueueFamilyIndex(78f24c34f3487619).(VkPhysicalDevice device, PvkInstanceDispatchTablecxx . . $ PvkInstanceDispatchTable# &dispatchTable, uint32_t *queueFamilyIndex) { |
| 205 | uint32_t display_queue_count = 0; |
| 206 | dispatchTable.GetPhysicalDeviceQueueFamilyPropertiescxx . . $ PvkInstanceDispatchTable#GetPhysicalDeviceQueueFamilyProperties.(device, &display_queue_count, nullptr); |
| 207 | auto displayQueueProperties = stdcxx . . $ std/::vectorcxx . . $ std/vector#<VkQueueFamilyProperties>(display_queue_count); |
| 208 | dispatchTable.GetPhysicalDeviceQueueFamilyPropertiescxx . . $ PvkInstanceDispatchTable#GetPhysicalDeviceQueueFamilyProperties.(device, &display_queue_count, displayQueueProperties.datacxx . . $ std/vector#data(258ee1c9e0a18a5c).()); |
| 209 | VkQueueFlags requiredFlags = VK_QUEUE_GRAPHICS_BIT | VK_QUEUE_COMPUTE_BIT | VK_QUEUE_TRANSFER_BIT; |
| 210 | bool found = false; |
| 211 | while(*queueFamilyIndex < displayQueueProperties.sizecxx . . $ std/vector#size(c9b1e749b64d5edc).()){ |
| 212 | auto &prop = displayQueueProperties[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).*queueFamilyIndex]; |
| 213 | if((prop.queueFlags & requiredFlags) == requiredFlags){ |
| 214 | found = true; |
| 215 | break; |
| 216 | } |
| 217 | (*queueFamilyIndex)++; |
| 218 | } |
| 219 | if(!found) { |
| 220 | TRACEcxx . . $ `primus_vk.cpp:57:9`!("No fitting queue found out of: " << display_queue_count); |
| 221 | return VK_ERROR_INITIALIZATION_FAILED; |
| 222 | } |
| 223 | return VK_SUCCESS; |
| 224 | } |
| 225 | }; |
| 226 | |
| 227 | stdcxx . . $ std/::mapcxx . . $ std/map#<void *, PvkInstanceDispatchTablecxx . . $ PvkInstanceDispatchTable#> instance_dispatchcxx . . $ instance_dispatch.; |
| 228 | // VkInstance->disp is beeing malloc'ed for every new instance |
| 229 | // so we can assume it to be a good key. |
| 230 | stdcxx . . $ std/::mapcxx . . $ std/map#<void *, InstanceInfocxx . . $ InstanceInfo#> instance_infocxx . . $ instance_info.; |
| 231 | |
| 232 | stdcxx . . $ std/::mapcxx . . $ std/map#<void *, InstanceInfocxx . . $ InstanceInfo#*> device_instance_infocxx . . $ device_instance_info.; |
| 233 | stdcxx . . $ std/::mapcxx . . $ std/map#<void *, PvkDispatchTablecxx . . $ PvkDispatchTable#> device_dispatchcxx . . $ device_dispatch.; |
| 234 | |
| 235 | /////////////////////////////////////////////////////////////////////////////////////////// |
| 236 | // Layer init and shutdown |
| 237 | PvkDispatchTablecxx . . $ PvkDispatchTable# fetchDispatchTablecxx . . $ fetchDispatchTable(a881f2b8dd7c0546).(PFN_vkGetDeviceProcAddr gdpa, VkDevice *pDevice); |
| 238 | VK_LAYER_EXPORTcxx . . $ `primus_vk.cpp:40:9`! PFN_vkVoidFunction VKAPI_CALLcxx . . $ `<external>/12100432684025345130/vk_platform.h:57:13`! PrimusVK_GetInstanceProcAddr(VkInstance instance, const char *pName); |
| 239 | VkResult VKAPI_CALLcxx . . $ `<external>/12100432684025345130/vk_platform.h:57:13`! PrimusVK_CreateInstancecxx . . $ PrimusVK_CreateInstance(a841a7fc5e6952cf).( |
| 240 | const VkInstanceCreateInfo* pCreateInfo, |
| 241 | const VkAllocationCallbacks* pAllocator, |
| 242 | VkInstance* pInstance) |
| 243 | { |
| 244 | VkLayerInstanceCreateInfocxx . . $ VkLayerInstanceCreateInfo# *layer_link_info = nullptr; |
| 245 | PFN_vkLayerCreateDevicecxx . . $ PFN_vkLayerCreateDevice# layerCreateDevice = nullptr; |
| 246 | PFN_vkLayerDestroyDevicecxx . . $ PFN_vkLayerDestroyDevice# layerDestroyDevice = nullptr; |
| 247 | VkLayerInstanceCreateInfocxx . . $ VkLayerInstanceCreateInfo# *layerCreateInfo = (VkLayerInstanceCreateInfocxx . . $ VkLayerInstanceCreateInfo# *)pCreateInfo->pNext; |
| 248 | |
| 249 | while(layerCreateInfo) { |
| 250 | if ( layerCreateInfo->sTypecxx . . $ $anonymous_type_f61a1b97f973f0b1_0#sType. == VK_STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO && layerCreateInfo->functioncxx . . $ $anonymous_type_f61a1b97f973f0b1_0#function. == VK_LAYER_LINK_INFOcxx . . $ VK_LAYER_LINK_INFO.) { |
| 251 | layer_link_info = layerCreateInfo; |
| 252 | } |
| 253 | if ( layerCreateInfo->sTypecxx . . $ $anonymous_type_f61a1b97f973f0b1_0#sType. == VK_STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO && layerCreateInfo->functioncxx . . $ $anonymous_type_f61a1b97f973f0b1_0#function. == VK_LOADER_LAYER_CREATE_DEVICE_CALLBACKcxx . . $ VK_LOADER_LAYER_CREATE_DEVICE_CALLBACK.) { |
| 254 | layerCreateDevice = layerCreateInfo->ucxx . . $ $anonymous_type_f61a1b97f973f0b1_0#u..layerDevicecxx . . $ $anonymous_type_f61a1b97f973f0b1_0#$anonymous_type_1#layerDevice..pfnLayerCreateDevicecxx . . $ $anonymous_type_f61a1b97f973f0b1_0#$anonymous_type_1#$anonymous_type_2#pfnLayerCreateDevice.; |
| 255 | layerDestroyDevice = layerCreateInfo->ucxx . . $ $anonymous_type_f61a1b97f973f0b1_0#u..layerDevicecxx . . $ $anonymous_type_f61a1b97f973f0b1_0#$anonymous_type_1#layerDevice..pfnLayerDestroyDevicecxx . . $ $anonymous_type_f61a1b97f973f0b1_0#$anonymous_type_1#$anonymous_type_2#pfnLayerDestroyDevice.; |
| 256 | } |
| 257 | layerCreateInfo = (VkLayerInstanceCreateInfocxx . . $ VkLayerInstanceCreateInfo# *)layerCreateInfo->pNextcxx . . $ $anonymous_type_f61a1b97f973f0b1_0#pNext.; |
| 258 | } |
| 259 | |
| 260 | if(layer_link_info == nullptr) { |
| 261 | return VK_ERROR_INITIALIZATION_FAILED; |
| 262 | } |
| 263 | if(layerCreateDevice == nullptr || layerDestroyDevice == nullptr) { |
| 264 | TRACEcxx . . $ `primus_vk.cpp:57:9`!("Loader did not supply layer device creation callbacks. Please upgrade to vulkan >= 1.1.108"); |
| 265 | return VK_ERROR_INITIALIZATION_FAILED; |
| 266 | } |
| 267 | |
| 268 | PFN_vkGetInstanceProcAddr gpa = layer_link_info->ucxx . . $ $anonymous_type_f61a1b97f973f0b1_0#u..pLayerInfocxx . . $ $anonymous_type_f61a1b97f973f0b1_0#$anonymous_type_1#pLayerInfo.->pfnNextGetInstanceProcAddrcxx . . $ VkLayerInstanceLink_#pfnNextGetInstanceProcAddr.; |
| 269 | layer_link_info->ucxx . . $ $anonymous_type_f61a1b97f973f0b1_0#u..pLayerInfocxx . . $ $anonymous_type_f61a1b97f973f0b1_0#$anonymous_type_1#pLayerInfo. = layer_link_info->ucxx . . $ $anonymous_type_f61a1b97f973f0b1_0#u..pLayerInfocxx . . $ $anonymous_type_f61a1b97f973f0b1_0#$anonymous_type_1#pLayerInfo.->pNextcxx . . $ VkLayerInstanceLink_#pNext.; |
| 270 | |
| 271 | PFN_vkCreateInstance createFunc = (PFN_vkCreateInstance)gpa(VK_NULL_HANDLEcxx . . $ `<external>/13734482859137699468/vulkan_core.h:41:21`!, "vkCreateInstance"); |
| 272 | VK_CHECK_RESULTcxx . . $ `primus_vk.cpp:65:9`!( createFunc(pCreateInfo, pAllocator, pInstance) ); |
| 273 | |
| 274 | // fetch our own dispatch table for the functions we need, into the next layer |
| 275 | PvkInstanceDispatchTablecxx . . $ PvkInstanceDispatchTable# dispatchTable = {cxx . . $ PvkInstanceDispatchTable#PvkInstanceDispatchTable(1028400b8faa508).pInstance, gpa}; |
| 276 | auto my_instance_info = InstanceInfocxx . . $ InstanceInfo#InstanceInfo(beb60864f7202da2).{*pInstance, layerCreateDevice, layerDestroyDevice}; |
| 277 | |
| 278 | // store the table by key |
| 279 | { |
| 280 | scoped_lockcxx . . $ scoped_lock# lcxx . . $ std/lock_guard#lock_guard(8e935d9c2e576e3a).(global_lockcxx . . $ global_lock.); |
| 281 | |
| 282 | instance_dispatchcxx . . $ instance_dispatch..insertcxx . . $ std/map#insert(274b9441a76f0de8).({cxx . . $ std/pair#pair(14d64bafa7379ebc).GetKeycxx . . $ GetKey(d29c9e52fbefad67).(*pInstance), dispatchTable}); |
| 283 | instance_infocxx . . $ instance_info.[cxx . . $ std/map#`operator[]`(bbd415b616967878).GetKeycxx . . $ GetKey(d29c9e52fbefad67).(*pInstance)] =cxx . . $ InstanceInfo#`operator=`(f625c3b3ee791084). stdcxx . . $ std/::movecxx . . $ std/move(e35c19a1ba7baa26).(my_instance_info); |
| 284 | } |
| 285 | |
| 286 | return VK_SUCCESS; |
| 287 | } |
| 288 | |
| 289 | void VKAPI_CALLcxx . . $ `<external>/12100432684025345130/vk_platform.h:57:13`! PrimusVK_DestroyInstancecxx . . $ PrimusVK_DestroyInstance(c3164aabbd6adc8c).(VkInstance instance, const VkAllocationCallbacks* pAllocator) |
| 290 | { |
| 291 | scoped_lockcxx . . $ scoped_lock# lcxx . . $ std/lock_guard#lock_guard(8e935d9c2e576e3a).(global_lockcxx . . $ global_lock.); |
| 292 | |
| 293 | auto instance_key = GetKeycxx . . $ GetKey(d29c9e52fbefad67).(instance); |
| 294 | instance_dispatchcxx . . $ instance_dispatch.[cxx . . $ std/map#`operator[]`(bbd415b616967878).GetKeycxx . . $ GetKey(d29c9e52fbefad67).(instance)].DestroyInstancecxx . . $ PvkInstanceDispatchTable#DestroyInstance.(instance, pAllocator); |
| 295 | instance_dispatchcxx . . $ instance_dispatch..erasecxx . . $ std/map#erase(a7de169f3ef4bfb3).(instance_key); |
| 296 | instance_infocxx . . $ instance_info..erasecxx . . $ std/map#erase(a7de169f3ef4bfb3).(instance_key); |
| 297 | } |
| 298 | |
| 299 | struct FramebufferImagecxx . . $ FramebufferImage#; |
| 300 | struct MappedMemorycxx . . $ MappedMemory#{ |
| 301 | VkDevice devicecxx . . $ MappedMemory#device.; |
| 302 | VkDeviceMemory memcxx . . $ MappedMemory#mem.; |
| 303 | char* datacxx . . $ MappedMemory#data.; |
| 304 | MappedMemorycxx . . $ MappedMemory#MappedMemory(def08832bc6ea019).(VkDevice device, FramebufferImagecxx . . $ FramebufferImage# &img); |
| 305 | ~cxx . . $ MappedMemory#`~MappedMemory`(ced63f7c635d850d).MappedMemorycxx . . $ MappedMemory#(); |
| 306 | }; |
| 307 | struct FramebufferImagecxx . . $ FramebufferImage# { |
| 308 | VkImage imgcxx . . $ FramebufferImage#img.; |
| 309 | VkDeviceMemory memcxx . . $ FramebufferImage#mem.; |
| 310 | |
| 311 | VkDevice devicecxx . . $ FramebufferImage#device.; |
| 312 | |
| 313 | stdcxx . . $ std/::shared_ptrcxx . . $ std/shared_ptr#<MappedMemorycxx . . $ MappedMemory#> mappedcxx . . $ FramebufferImage#mapped.; |
| 314 | FramebufferImagecxx . . $ FramebufferImage#FramebufferImage(20d40ed35f56145a).(FramebufferImagecxx . . $ FramebufferImage# &) = delete; |
| 315 | FramebufferImagecxx . . $ FramebufferImage#FramebufferImage(17bc67192b71a787).(VkDevice device, VkExtent2D size, VkImageTiling tiling, VkImageUsageFlags usage, VkFormat format, stdcxx . . $ std/::functioncxx . . $ std/function#<uint32_t(uint32_t memory_type_bits)> memoryTypeIndex): devicecxx . . $ FramebufferImage#device.(device){ |
| 316 | TRACEcxx . . $ `primus_vk.cpp:57:9`!("Creating image: " << size.width << "x" << size.height); |
| 317 | VkImageCreateInfo imageCreateCI {}; |
| 318 | imageCreateCI.sType = VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO; |
| 319 | imageCreateCI.imageType = VK_IMAGE_TYPE_2D; |
| 320 | imageCreateCI.format = format; |
| 321 | imageCreateCI.extent.width = size.width; |
| 322 | imageCreateCI.extent.height = size.height; |
| 323 | imageCreateCI.extent.depth = 1; |
| 324 | imageCreateCI.arrayLayers = 1; |
| 325 | imageCreateCI.mipLevels = 1; |
| 326 | imageCreateCI.initialLayout = VK_IMAGE_LAYOUT_UNDEFINED; |
| 327 | imageCreateCI.samples = VK_SAMPLE_COUNT_1_BIT; |
| 328 | imageCreateCI.tiling = tiling; |
| 329 | imageCreateCI.usage = usage; |
| 330 | VK_CHECK_RESULTcxx . . $ `primus_vk.cpp:65:9`!(device_dispatch[GetKey(device)].CreateImage(device, &imageCreateCI, nullptr, &img)); |
| 331 | |
| 332 | VkMemoryRequirements memRequirements {}; |
| 333 | VkMemoryAllocateInfo memAllocInfo {.sType = VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO}; |
| 334 | device_dispatchcxx . . $ device_dispatch.[cxx . . $ std/map#`operator[]`(bbd415b616967878).GetKeycxx . . $ GetKey(d29c9e52fbefad67).(device)].GetImageMemoryRequirementscxx . . $ PvkDispatchTable#GetImageMemoryRequirements.(device, imgcxx . . $ FramebufferImage#img., &memRequirements); |
| 335 | memAllocInfo.allocationSize = memRequirements.size; |
| 336 | memAllocInfo.memoryTypeIndex = memoryTypeIndex(cxx . . $ std/function#`operator()`(39e0826ffb540481).memRequirements.memoryTypeBits); |
| 337 | VK_CHECK_RESULTcxx . . $ `primus_vk.cpp:65:9`!(device_dispatch[GetKey(device)].AllocateMemory(device, &memAllocInfo, nullptr, &mem)); |
| 338 | VK_CHECK_RESULTcxx . . $ `primus_vk.cpp:65:9`!(device_dispatch[GetKey(device)].BindImageMemory(device, img, mem, 0)); |
| 339 | } |
| 340 | stdcxx . . $ std/::shared_ptrcxx . . $ std/shared_ptr#<MappedMemorycxx . . $ MappedMemory#> getMappedcxx . . $ FramebufferImage#getMapped(eae2f623be7e328f).(){ |
| 341 | if(!mappedcxx . . $ FramebufferImage#mapped.){ |
| 342 | throw stdcxx . . $ std/::runtime_errorcxx . . $ std/runtime_error#("not mapped"); |
| 343 | } |
| 344 | return mappedcxx . . $ std/shared_ptr#shared_ptr(159b2ef84668bf93).; |
| 345 | } |
| 346 | void mapcxx . . $ FramebufferImage#map(49f6e7a06ebc5aa8).(){ |
| 347 | mappedcxx . . $ FramebufferImage#mapped. =cxx . . $ std/shared_ptr#`operator=`(3501e79a789ff953). stdcxx . . $ std/::make_sharedcxx . . $ std/make_shared(ffca0f3977536948).<MappedMemorycxx . . $ MappedMemory#>(devicecxx . . $ FramebufferImage#device., *this); |
| 348 | } |
| 349 | VkSubresourceLayout getLayoutcxx . . $ FramebufferImage#getLayout(4072efb97e26edeb).(){ |
| 350 | VkImageSubresource subResource { VK_IMAGE_ASPECT_COLOR_BIT, 0, 0 }; |
| 351 | VkSubresourceLayout subResourceLayout; |
| 352 | device_dispatchcxx . . $ device_dispatch.[cxx . . $ std/map#`operator[]`(bbd415b616967878).GetKeycxx . . $ GetKey(d29c9e52fbefad67).(devicecxx . . $ FramebufferImage#device.)].GetImageSubresourceLayoutcxx . . $ PvkDispatchTable#GetImageSubresourceLayout.(devicecxx . . $ FramebufferImage#device., imgcxx . . $ FramebufferImage#img., &subResource, &subResourceLayout); |
| 353 | return subResourceLayout; |
| 354 | } |
| 355 | ~cxx . . $ FramebufferImage#`~FramebufferImage`(ced63f7c635d850d).FramebufferImagecxx . . $ FramebufferImage#(){ |
| 356 | mappedcxx . . $ FramebufferImage#mapped..resetcxx . . $ std/__shared_ptr#reset(ced63f7c635d850d).(); |
| 357 | device_dispatchcxx . . $ device_dispatch.[cxx . . $ std/map#`operator[]`(bbd415b616967878).GetKeycxx . . $ GetKey(d29c9e52fbefad67).(devicecxx . . $ FramebufferImage#device.)].FreeMemorycxx . . $ PvkDispatchTable#FreeMemory.(devicecxx . . $ FramebufferImage#device., memcxx . . $ FramebufferImage#mem., nullptr); |
| 358 | device_dispatchcxx . . $ device_dispatch.[cxx . . $ std/map#`operator[]`(bbd415b616967878).GetKeycxx . . $ GetKey(d29c9e52fbefad67).(devicecxx . . $ FramebufferImage#device.)].DestroyImagecxx . . $ PvkDispatchTable#DestroyImage.(devicecxx . . $ FramebufferImage#device., imgcxx . . $ FramebufferImage#img., nullptr); |
| 359 | } |
| 360 | }; |
| 361 | MappedMemorycxx . . $ MappedMemory#::MappedMemorycxx . . $ MappedMemory#MappedMemory(def08832bc6ea019).(VkDevice device, FramebufferImagecxx . . $ FramebufferImage# &img): devicecxx . . $ MappedMemory#device.(device), memcxx . . $ MappedMemory#mem.(img.memcxx . . $ FramebufferImage#mem.){ |
| 362 | device_dispatchcxx . . $ device_dispatch.[cxx . . $ std/map#`operator[]`(bbd415b616967878).GetKeycxx . . $ GetKey(d29c9e52fbefad67).(device)].MapMemorycxx . . $ PvkDispatchTable#MapMemory.(device, img.memcxx . . $ FramebufferImage#mem., 0, VK_WHOLE_SIZEcxx . . $ `<external>/13734482859137699468/vulkan_core.h:130:9`!, 0, (void**)&datacxx . . $ MappedMemory#data.); |
| 363 | } |
| 364 | MappedMemorycxx . . $ MappedMemory#::~cxx . . $ MappedMemory#`~MappedMemory`(ced63f7c635d850d).MappedMemorycxx . . $ MappedMemory#(){ |
| 365 | device_dispatchcxx . . $ device_dispatch.[cxx . . $ std/map#`operator[]`(bbd415b616967878).GetKeycxx . . $ GetKey(d29c9e52fbefad67).(devicecxx . . $ MappedMemory#device.)].UnmapMemorycxx . . $ PvkDispatchTable#UnmapMemory.(devicecxx . . $ MappedMemory#device., memcxx . . $ MappedMemory#mem.); |
| 366 | } |
| 367 | class CommandBuffercxx . . $ CommandBuffer#; |
| 368 | class Fencecxx . . $ Fence#{ |
| 369 | VkDevice devicecxx . . $ Fence#device.; |
| 370 | public: |
| 371 | VkFence fencecxx . . $ Fence#fence.; |
| 372 | Fencecxx . . $ Fence#Fence(4612340e2b8d4e51).(VkDevice dev): devicecxx . . $ Fence#device.(dev){ |
| 373 | // Create fence to ensure that the command buffer has finished executing |
| 374 | VkFenceCreateInfo fenceInfo = {.sType=VK_STRUCTURE_TYPE_FENCE_CREATE_INFO}; |
| 375 | fenceInfo.flags = 0; |
| 376 | VK_CHECK_RESULTcxx . . $ `primus_vk.cpp:65:9`!(device_dispatch[GetKey(device)].CreateFence(device, &fenceInfo, nullptr, &fence)); |
| 377 | } |
| 378 | void awaitcxx . . $ Fence#await(49f6e7a06ebc5aa8).(){ |
| 379 | // Wait for the fence to signal that command buffer has finished executing |
| 380 | VK_CHECK_RESULTcxx . . $ `primus_vk.cpp:65:9`!(device_dispatch[GetKey(device)].WaitForFences(device, 1, &fence, VK_TRUEcxx . . $ `<external>/13734482859137699468/vulkan_core.h:129:9`!, 10000000000L)); |
| 381 | } |
| 382 | void resetcxx . . $ Fence#reset(49f6e7a06ebc5aa8).(){ |
| 383 | VK_CHECK_RESULTcxx . . $ `primus_vk.cpp:65:9`!(device_dispatch[GetKey(device)].ResetFences(device, 1, &fence)); |
| 384 | } |
| 385 | Fencecxx . . $ Fence#Fence(641ab110f8e0118a).(Fencecxx . . $ Fence# &&other): devicecxx . . $ Fence#device.(other.devicecxx . . $ Fence#device.), fencecxx . . $ Fence#fence.(other.fencecxx . . $ Fence#fence.){ |
| 386 | other.fencecxx . . $ Fence#fence. = VK_NULL_HANDLEcxx . . $ `<external>/13734482859137699468/vulkan_core.h:41:21`!; |
| 387 | } |
| 388 | ~cxx . . $ Fence#`~Fence`(ced63f7c635d850d).Fencecxx . . $ Fence#(){ |
| 389 | if(fencecxx . . $ Fence#fence. != VK_NULL_HANDLEcxx . . $ `<external>/13734482859137699468/vulkan_core.h:41:21`!){ |
| 390 | device_dispatchcxx . . $ device_dispatch.[cxx . . $ std/map#`operator[]`(bbd415b616967878).GetKeycxx . . $ GetKey(d29c9e52fbefad67).(devicecxx . . $ Fence#device.)].DestroyFencecxx . . $ PvkDispatchTable#DestroyFence.(devicecxx . . $ Fence#device., fencecxx . . $ Fence#fence., nullptr); |
| 391 | } |
| 392 | } |
| 393 | }; |
| 394 | class Semaphorecxx . . $ Semaphore#{ |
| 395 | VkDevice devicecxx . . $ Semaphore#device.; |
| 396 | public: |
| 397 | VkSemaphore semcxx . . $ Semaphore#sem.; |
| 398 | Semaphorecxx . . $ Semaphore#Semaphore(4612340e2b8d4e51).(VkDevice dev): devicecxx . . $ Semaphore#device.(dev){ |
| 399 | VkSemaphoreCreateInfo semInfo = {.sType=VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO}; |
| 400 | semInfo.flags = 0; |
| 401 | VK_CHECK_RESULTcxx . . $ `primus_vk.cpp:65:9`!(device_dispatch[GetKey(device)].CreateSemaphore(device, &semInfo, nullptr, &sem)); |
| 402 | } |
| 403 | Semaphorecxx . . $ Semaphore#Semaphore(dba8851005b5cbed).(Semaphorecxx . . $ Semaphore# &&other): devicecxx . . $ Semaphore#device.(other.devicecxx . . $ Semaphore#device.), semcxx . . $ Semaphore#sem.(other.semcxx . . $ Semaphore#sem.) { |
| 404 | other.semcxx . . $ Semaphore#sem. = VK_NULL_HANDLEcxx . . $ `<external>/13734482859137699468/vulkan_core.h:41:21`!; |
| 405 | other.devicecxx . . $ Semaphore#device. = VK_NULL_HANDLEcxx . . $ `<external>/13734482859137699468/vulkan_core.h:41:21`!; |
| 406 | } |
| 407 | ~cxx . . $ Semaphore#`~Semaphore`(ced63f7c635d850d).Semaphorecxx . . $ Semaphore#(){ |
| 408 | if(semcxx . . $ Semaphore#sem. != VK_NULL_HANDLEcxx . . $ `<external>/13734482859137699468/vulkan_core.h:41:21`!){ |
| 409 | device_dispatchcxx . . $ device_dispatch.[cxx . . $ std/map#`operator[]`(bbd415b616967878).GetKeycxx . . $ GetKey(d29c9e52fbefad67).(devicecxx . . $ Semaphore#device.)].DestroySemaphorecxx . . $ PvkDispatchTable#DestroySemaphore.(devicecxx . . $ Semaphore#device., semcxx . . $ Semaphore#sem., nullptr); |
| 410 | } |
| 411 | } |
| 412 | }; |
| 413 | enum class ImageTypecxx . . $ ImageType# : int{ |
| 414 | RENDER_TARGET_IMAGEcxx . . $ ImageType#RENDER_TARGET_IMAGE., |
| 415 | RENDER_COPY_IMAGEcxx . . $ ImageType#RENDER_COPY_IMAGE., |
| 416 | DISPLAY_IMAGEcxx . . $ ImageType#DISPLAY_IMAGE., |
| 417 | IMAGE_TYPE_COUNTcxx . . $ ImageType#IMAGE_TYPE_COUNT. |
| 418 | }; |
| 419 | stdcxx . . $ std/::ostreamcxx . . $ std/ostream# &operatorcxx . . $ `operator<<`(54e1fd5992f4ea2d).<<( stdcxx . . $ std/::ostreamcxx . . $ std/ostream# &output, const ImageTypecxx . . $ ImageType# &type ) { |
| 420 | switch(type){ |
| 421 | case ImageTypecxx . . $ ImageType#::RENDER_TARGET_IMAGEcxx . . $ ImageType#RENDER_TARGET_IMAGE.: |
| 422 | output <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). "Render Target Image"; |
| 423 | break; |
| 424 | case ImageTypecxx . . $ ImageType#::RENDER_COPY_IMAGEcxx . . $ ImageType#RENDER_COPY_IMAGE.: |
| 425 | output <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). "Render Copy Image"; |
| 426 | break; |
| 427 | case ImageTypecxx . . $ ImageType#::DISPLAY_IMAGEcxx . . $ ImageType#DISPLAY_IMAGE.: |
| 428 | output <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). "Display Image"; |
| 429 | break; |
| 430 | } |
| 431 | return output; |
| 432 | } |
| 433 | struct PrimusSwapchaincxx . . $ PrimusSwapchain#; |
| 434 | struct ImageWorkercxx . . $ ImageWorker# { |
| 435 | PrimusSwapchaincxx . . $ PrimusSwapchain# &swapchaincxx . . $ ImageWorker#swapchain.; |
| 436 | |
| 437 | stdcxx . . $ std/::shared_ptrcxx . . $ std/shared_ptr#<FramebufferImagecxx . . $ FramebufferImage#> render_imagecxx . . $ ImageWorker#render_image.; |
| 438 | stdcxx . . $ std/::shared_ptrcxx . . $ std/shared_ptr#<FramebufferImagecxx . . $ FramebufferImage#> render_copy_imagecxx . . $ ImageWorker#render_copy_image.; |
| 439 | stdcxx . . $ std/::shared_ptrcxx . . $ std/shared_ptr#<FramebufferImagecxx . . $ FramebufferImage#> display_src_imagecxx . . $ ImageWorker#display_src_image.; |
| 440 | Fencecxx . . $ Fence# render_copy_fencecxx . . $ ImageWorker#render_copy_fence.; |
| 441 | Semaphorecxx . . $ Semaphore# display_semaphorecxx . . $ ImageWorker#display_semaphore.; |
| 442 | VkImage display_imagecxx . . $ ImageWorker#display_image. = VK_NULL_HANDLEcxx . . $ `<external>/13734482859137699468/vulkan_core.h:41:21`!; |
| 443 | |
| 444 | stdcxx . . $ std/::shared_ptrcxx . . $ std/shared_ptr#<CommandBuffercxx . . $ CommandBuffer#> render_copy_commandcxx . . $ ImageWorker#render_copy_command.; |
| 445 | stdcxx . . $ std/::shared_ptrcxx . . $ std/shared_ptr#<CommandBuffercxx . . $ CommandBuffer#> display_commandcxx . . $ ImageWorker#display_command.; |
| 446 | stdcxx . . $ std/::unique_ptrcxx . . $ std/unique_ptr#<Fencecxx . . $ Fence#> display_command_fencecxx . . $ ImageWorker#display_command_fence.; |
| 447 | |
| 448 | ImageWorkercxx . . $ ImageWorker#ImageWorker(10cfd3889bea0b15).(PrimusSwapchaincxx . . $ PrimusSwapchain# &swapchain, VkImage display_image, const VkSwapchainCreateInfoKHR &createInfo); |
| 449 | ImageWorkercxx . . $ ImageWorker#ImageWorker(ea61ccf00cfcd33d).(ImageWorkercxx . . $ ImageWorker# &&other) = default; |
| 450 | ~cxx . . $ ImageWorker#`~ImageWorker`(ced63f7c635d850d).ImageWorkercxx . . $ ImageWorker#(); |
| 451 | void initImagescxx . . $ ImageWorker#initImages(1d5819dfaea312d5).( const VkSwapchainCreateInfoKHR &createInfo); |
| 452 | void createCommandBufferscxx . . $ ImageWorker#createCommandBuffers(49f6e7a06ebc5aa8).(); |
| 453 | void copyImageDatacxx . . $ ImageWorker#copyImageData(813df1c2663f4e59).(uint32_t idx, stdcxx . . $ std/::vectorcxx . . $ std/vector#<VkSemaphore> sems); |
| 454 | }; |
| 455 | struct PrimusSwapchaincxx . . $ PrimusSwapchain#{ |
| 456 | int max_fpscxx . . $ PrimusSwapchain#max_fps. = 0; |
| 457 | InstanceInfocxx . . $ InstanceInfo# &myInstancecxx . . $ PrimusSwapchain#myInstance.; |
| 458 | stdcxx . . $ std/::chronocxx . . $ std/chrono/::steady_clockcxx . . $ std/chrono/_V2/steady_clock#::time_pointcxx . . $ std/chrono/_V2/steady_clock#time_point# lastPresentcxx . . $ PrimusSwapchain#lastPresent. = stdcxx . . $ std/::chronocxx . . $ std/chrono/::steady_clockcxx . . $ std/chrono/_V2/steady_clock#::nowcxx . . $ std/chrono/_V2/steady_clock#now(edffc6b45db65c20).(); |
| 459 | VkDevice devicecxx . . $ PrimusSwapchain#device.; |
| 460 | VkQueue render_queuecxx . . $ PrimusSwapchain#render_queue.; |
| 461 | VkDevice display_devicecxx . . $ PrimusSwapchain#display_device.; |
| 462 | stdcxx . . $ std/::mutexcxx . . $ std/mutex# displayQueueMutexcxx . . $ PrimusSwapchain#displayQueueMutex.; |
| 463 | VkQueue display_queuecxx . . $ PrimusSwapchain#display_queue.; |
| 464 | VkSwapchainKHR backendcxx . . $ PrimusSwapchain#backend.; |
| 465 | stdcxx . . $ std/::vectorcxx . . $ std/vector#<ImageWorkercxx . . $ ImageWorker#> imagescxx . . $ PrimusSwapchain#images.; |
| 466 | VkExtent2D imgSizecxx . . $ PrimusSwapchain#imgSize.; |
| 467 | |
| 468 | VkSurfaceCapabilitiesKHR surfaceCapabilitiescxx . . $ PrimusSwapchain#surfaceCapabilities. = { }; |
| 469 | |
| 470 | stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::unique_ptrcxx . . $ std/unique_ptr#<stdcxx . . $ std/::threadcxx . . $ std/thread#>> threadscxx . . $ PrimusSwapchain#threads.; |
| 471 | |
| 472 | stdcxx . . $ std/::shared_ptrcxx . . $ std/shared_ptr#<CreateOtherDevicecxx . . $ CreateOtherDevice#> codcxx . . $ PrimusSwapchain#cod.; |
| 473 | |
| 474 | bool suppress_suboptimalcxx . . $ PrimusSwapchain#suppress_suboptimal. = false; |
| 475 | |
| 476 | PrimusSwapchaincxx . . $ PrimusSwapchain#PrimusSwapchain(450e902206c9c340).(PrimusSwapchaincxx . . $ PrimusSwapchain# &) = delete; |
| 477 | PrimusSwapchaincxx . . $ PrimusSwapchain#PrimusSwapchain(8cfb9630c4f2f05f).(InstanceInfocxx . . $ InstanceInfo# &myInstance, VkDevice device, VkDevice display_device, VkSwapchainKHR backend, const VkSwapchainCreateInfoKHR *pCreateInfo, stdcxx . . $ std/::shared_ptrcxx . . $ std/shared_ptr#<CreateOtherDevicecxx . . $ CreateOtherDevice#> &cod): |
| 478 | myInstancecxx . . $ PrimusSwapchain#myInstance.(myInstance), devicecxx . . $ PrimusSwapchain#device.(device), display_devicecxx . . $ PrimusSwapchain#display_device.(display_device), backendcxx . . $ PrimusSwapchain#backend.(backend), codcxx . . $ PrimusSwapchain#cod.(cod){ |
| 479 | // TODO automatically find correct queue and not choose 0 forcibly |
| 480 | device_dispatchcxx . . $ device_dispatch.[cxx . . $ std/map#`operator[]`(bbd415b616967878).GetKeycxx . . $ GetKey(d29c9e52fbefad67).(device)].GetDeviceQueuecxx . . $ PvkDispatchTable#GetDeviceQueue.(device, 0, 0, &render_queuecxx . . $ PrimusSwapchain#render_queue.); |
| 481 | device_dispatchcxx . . $ device_dispatch.[cxx . . $ std/map#`operator[]`(bbd415b616967878).GetKeycxx . . $ GetKey(d29c9e52fbefad67).(display_device)].GetDeviceQueuecxx . . $ PvkDispatchTable#GetDeviceQueue.(display_device, myInstance.displayQueueFamilyIndexcxx . . $ InstanceInfo#displayQueueFamilyIndex., 0, &display_queuecxx . . $ PrimusSwapchain#display_queue.); |
| 482 | GetKeycxx . . $ GetKey(d29c9e52fbefad67).(render_queuecxx . . $ PrimusSwapchain#render_queue.) = GetKeycxx . . $ GetKey(d29c9e52fbefad67).(device); // TODO, use vkSetDeviceLoaderData instead |
| 483 | GetKeycxx . . $ GetKey(d29c9e52fbefad67).(display_queuecxx . . $ PrimusSwapchain#display_queue.) = GetKeycxx . . $ GetKey(d29c9e52fbefad67).(display_device); |
| 484 | |
| 485 | instance_dispatchcxx . . $ instance_dispatch.[cxx . . $ std/map#`operator[]`(bbd415b616967878).GetKeycxx . . $ GetKey(d29c9e52fbefad67).(myInstance.instancecxx . . $ InstanceInfo#instance.)].GetPhysicalDeviceSurfaceCapabilitiesKHRcxx . . $ PvkInstanceDispatchTable#GetPhysicalDeviceSurfaceCapabilitiesKHR.(myInstance.displaycxx . . $ InstanceInfo#display., pCreateInfo->surface, &surfaceCapabilitiescxx . . $ PrimusSwapchain#surfaceCapabilities.); |
| 486 | TRACEcxx . . $ `primus_vk.cpp:57:9`!("Min Images: " << surfaceCapabilities.minImageCount); |
| 487 | char *max_fps_env = getenv("PRIMUS_VK_MAX_FPS"); |
| 488 | if(max_fps_env != nullptr){ |
| 489 | max_fpscxx . . $ PrimusSwapchain#max_fps. = stdcxx . . $ std/::stoicxx . . $ std/__cxx11/stoi(ffee248579a0a688).(stdcxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).::stringcxx . . $ std/string#{max_fps_env}); |
| 490 | } |
| 491 | if(getenv("PVK_SUPPRESS_SUBOPTIMAL")){ |
| 492 | suppress_suboptimalcxx . . $ PrimusSwapchain#suppress_suboptimal. = true; |
| 493 | } |
| 494 | |
| 495 | uint32_t image_count; |
| 496 | device_dispatchcxx . . $ device_dispatch.[cxx . . $ std/map#`operator[]`(bbd415b616967878).GetKeycxx . . $ GetKey(d29c9e52fbefad67).(display_device)].GetSwapchainImagesKHRcxx . . $ PvkDispatchTable#GetSwapchainImagesKHR.(display_device, backend, &image_count, nullptr); |
| 497 | TRACEcxx . . $ `primus_vk.cpp:57:9`!("Image aquiring: " << image_count); |
| 498 | stdcxx . . $ std/::vectorcxx . . $ std/vector#<VkImage> display_imagescxx . . $ std/vector#vector(49f6e7a06ebc5aa8).; |
| 499 | display_images.resizecxx . . $ std/vector#resize(2c44cd906ae4e829).(image_count); |
| 500 | device_dispatchcxx . . $ device_dispatch.[cxx . . $ std/map#`operator[]`(bbd415b616967878).GetKeycxx . . $ GetKey(d29c9e52fbefad67).(display_device)].GetSwapchainImagesKHRcxx . . $ PvkDispatchTable#GetSwapchainImagesKHR.(display_device, backend, &image_count, display_images.datacxx . . $ std/vector#data(258ee1c9e0a18a5c).()); |
| 501 | |
| 502 | imgSizecxx . . $ PrimusSwapchain#imgSize. = pCreateInfo->imageExtent; |
| 503 | |
| 504 | for(uint32_t i = 0; i < image_count; i++){ |
| 505 | imagescxx . . $ PrimusSwapchain#images..emplace_backcxx . . $ std/vector#emplace_back(a1bcdfdabc3a37df).(*this, display_images[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).i], *pCreateInfo); |
| 506 | } |
| 507 | |
| 508 | TRACEcxx . . $ `primus_vk.cpp:57:9`!("Creating a Swapchain thread."); |
| 509 | size_t thread_count = 1; |
| 510 | char *m_env = getenv("PRIMUS_VK_MULTITHREADING"); |
| 511 | if(m_env == nullptr || stdcxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).::stringcxx . . $ std/string#{m_env} !=cxx . . $ std/`operator!=`(4b17aa87c9f300c6). "1"){ |
| 512 | thread_count = image_count; |
| 513 | } |
| 514 | threadscxx . . $ PrimusSwapchain#threads..resizecxx . . $ std/vector#resize(2c44cd906ae4e829).(thread_count); |
| 515 | for(auto &thread: threadscxx . . $ PrimusSwapchain#threads.){ |
| 516 | thread =cxx . . $ std/unique_ptr#`operator=`(1b63e42eaa758a73). stdcxx . . $ std/::unique_ptrcxx . . $ std/unique_ptr#<stdcxx . . $ std/::threadcxx . . $ std/thread#>(new stdcxx . . $ std/::threadcxx . . $ std/thread#([this](){this->runcxx . . $ PrimusSwapchain#run(49f6e7a06ebc5aa8).();})); |
| 517 | pthread_setname_np(thread->cxx . . $ std/unique_ptr#`operator->`(ea7391e9eeeaf20e).native_handlecxx . . $ std/thread#native_handle(f708dce9a8856c70).(), "swapchain-thread"); |
| 518 | } |
| 519 | } |
| 520 | |
| 521 | uint32_t getImageMemorycxx . . $ PrimusSwapchain#getImageMemory(1b2a2449d0ed1053).(ImageTypecxx . . $ ImageType# type, uint32_t memory_type_bits); |
| 522 | |
| 523 | void storeImagecxx . . $ PrimusSwapchain#storeImage(becaf869902be12d).(uint32_t index, VkQueue queue, stdcxx . . $ std/::vectorcxx . . $ std/vector#<VkSemaphore> wait_on, Fencecxx . . $ Fence# ¬ify); |
| 524 | |
| 525 | void queuecxx . . $ PrimusSwapchain#queue(37781134286668e7).(VkQueue queue, const VkPresentInfoKHR *pPresentInfo); |
| 526 | |
| 527 | stdcxx . . $ std/::mutexcxx . . $ std/mutex# queueMutexcxx . . $ PrimusSwapchain#queueMutex.; |
| 528 | stdcxx . . $ std/::condition_variablecxx . . $ std/condition_variable# has_workcxx . . $ PrimusSwapchain#has_work.; |
| 529 | bool activecxx . . $ PrimusSwapchain#active. = true; |
| 530 | struct QueueItemcxx . . $ PrimusSwapchain#QueueItem# { |
| 531 | VkQueue queuecxx . . $ PrimusSwapchain#QueueItem#queue.; |
| 532 | VkPresentInfoKHR pPresentInfocxx . . $ PrimusSwapchain#QueueItem#pPresentInfo.; |
| 533 | uint32_t imgIndexcxx . . $ PrimusSwapchain#QueueItem#imgIndex.; |
| 534 | }; |
| 535 | stdcxx . . $ std/::listcxx . . $ std/__cxx11/list#<QueueItemcxx . . $ PrimusSwapchain#QueueItem#> workcxx . . $ PrimusSwapchain#work.; |
| 536 | stdcxx . . $ std/::listcxx . . $ std/__cxx11/list#<QueueItemcxx . . $ PrimusSwapchain#QueueItem#> in_progresscxx . . $ PrimusSwapchain#in_progress.; |
| 537 | void presentcxx . . $ PrimusSwapchain#present(bebef18ee3c082a9).(const QueueItemcxx . . $ PrimusSwapchain#QueueItem# &workItem); |
| 538 | void runcxx . . $ PrimusSwapchain#run(49f6e7a06ebc5aa8).(); |
| 539 | void stopcxx . . $ PrimusSwapchain#stop(49f6e7a06ebc5aa8).(); |
| 540 | void waitForReadycxx . . $ PrimusSwapchain#waitForReady(49f6e7a06ebc5aa8).(); |
| 541 | }; |
| 542 | |
| 543 | ImageWorkercxx . . $ ImageWorker#::ImageWorkercxx . . $ ImageWorker#ImageWorker(10cfd3889bea0b15).(PrimusSwapchaincxx . . $ PrimusSwapchain# &swapchain, VkImage display_image, const VkSwapchainCreateInfoKHR &createInfo): swapchaincxx . . $ ImageWorker#swapchain.(swapchain), render_copy_fencecxx . . $ ImageWorker#render_copy_fence.(swapchain.devicecxx . . $ PrimusSwapchain#device.), display_semaphorecxx . . $ ImageWorker#display_semaphore.(swapchain.display_devicecxx . . $ PrimusSwapchain#display_device.), display_imagecxx . . $ ImageWorker#display_image.(display_image){ |
| 544 | initImagescxx . . $ ImageWorker#initImages(1d5819dfaea312d5).(createInfo); |
| 545 | createCommandBufferscxx . . $ ImageWorker#createCommandBuffers(49f6e7a06ebc5aa8).(); |
| 546 | } |
| 547 | ImageWorkercxx . . $ ImageWorker#::~cxx . . $ ImageWorker#`~ImageWorker`(ced63f7c635d850d).ImageWorkercxx . . $ ImageWorker#(){ |
| 548 | if(display_command_fencecxx . . $ ImageWorker#display_command_fence.){ |
| 549 | display_command_fencecxx . . $ ImageWorker#display_command_fence.->cxx . . $ std/unique_ptr#`operator->`(ea7391e9eeeaf20e).awaitcxx . . $ Fence#await(49f6e7a06ebc5aa8).(); |
| 550 | } |
| 551 | } |
| 552 | |
| 553 | class CreateOtherDevicecxx . . $ CreateOtherDevice# { |
| 554 | public: |
| 555 | VkPhysicalDevice display_devcxx . . $ CreateOtherDevice#display_dev.; |
| 556 | VkPhysicalDevice render_devcxx . . $ CreateOtherDevice#render_dev.; |
| 557 | VkPhysicalDeviceMemoryProperties display_memcxx . . $ CreateOtherDevice#display_mem.; |
| 558 | VkPhysicalDeviceMemoryProperties render_memcxx . . $ CreateOtherDevice#render_mem.; |
| 559 | VkDevice render_gpucxx . . $ CreateOtherDevice#render_gpu. = VK_NULL_HANDLEcxx . . $ `<external>/13734482859137699468/vulkan_core.h:41:21`!; |
| 560 | VkDevice display_gpucxx . . $ CreateOtherDevice#display_gpu. = VK_NULL_HANDLEcxx . . $ `<external>/13734482859137699468/vulkan_core.h:41:21`!; |
| 561 | |
| 562 | CreateOtherDevicecxx . . $ CreateOtherDevice#CreateOtherDevice(54e6d70359a25ec3).(VkPhysicalDevice display_dev, VkPhysicalDevice render_dev): |
| 563 | display_devcxx . . $ CreateOtherDevice#display_dev.(display_dev), render_devcxx . . $ CreateOtherDevice#render_dev.(render_dev){ |
| 564 | } |
| 565 | void setRenderDevicecxx . . $ CreateOtherDevice#setRenderDevice(4612340e2b8d4e51).(VkDevice render_gpu){ |
| 566 | this->render_gpucxx . . $ CreateOtherDevice#render_gpu. = render_gpu; |
| 567 | } |
| 568 | void finishcxx . . $ CreateOtherDevice#finish(a35973bfe76eeac1).(stdcxx . . $ std/::functioncxx . . $ std/function#<VkResult(VkDeviceCreateInfo &createInfo, VkDevice &dev)> creator){ |
| 569 | auto &minstance_info = instance_infocxx . . $ instance_info.[cxx . . $ std/map#`operator[]`(bbd415b616967878).GetKeycxx . . $ GetKey(d29c9e52fbefad67).(render_devcxx . . $ CreateOtherDevice#render_dev.)]; |
| 570 | auto &minstance_dispatch = instance_dispatchcxx . . $ instance_dispatch.[cxx . . $ std/map#`operator[]`(bbd415b616967878).GetKeycxx . . $ GetKey(d29c9e52fbefad67).(minstance_info.instancecxx . . $ InstanceInfo#instance.)]; |
| 571 | minstance_dispatch.GetPhysicalDeviceMemoryPropertiescxx . . $ PvkInstanceDispatchTable#GetPhysicalDeviceMemoryProperties.(display_devcxx . . $ CreateOtherDevice#display_dev., &display_memcxx . . $ CreateOtherDevice#display_mem.); |
| 572 | minstance_dispatch.GetPhysicalDeviceMemoryPropertiescxx . . $ PvkInstanceDispatchTable#GetPhysicalDeviceMemoryProperties.(render_devcxx . . $ CreateOtherDevice#render_dev., &render_memcxx . . $ CreateOtherDevice#render_mem.); |
| 573 | |
| 574 | createDisplayDevcxx . . $ CreateOtherDevice#createDisplayDev(44594ce4ffa87205).(minstance_info, creatorcxx . . $ std/function#function(ec20bd20f4acba43).); |
| 575 | } |
| 576 | void createDisplayDevcxx . . $ CreateOtherDevice#createDisplayDev(44594ce4ffa87205).(InstanceInfocxx . . $ InstanceInfo# &my_instance, stdcxx . . $ std/::functioncxx . . $ std/function#<VkResult(VkDeviceCreateInfo &createInfo, VkDevice &dev)> creator){ |
| 577 | VkDeviceCreateInfo createInfo = {}; |
| 578 | createInfo.sType = VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO; |
| 579 | |
| 580 | VkDeviceQueueCreateInfo queueInfo{}; |
| 581 | queueInfo.sType = VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO; |
| 582 | queueInfo.queueFamilyIndex = my_instance.displayQueueFamilyIndexcxx . . $ InstanceInfo#displayQueueFamilyIndex.; |
| 583 | queueInfo.queueCount = 1; |
| 584 | const float defaultQueuePriority(0.0f); |
| 585 | queueInfo.pQueuePriorities = &defaultQueuePriority; |
| 586 | |
| 587 | createInfo.queueCreateInfoCount = 1; |
| 588 | createInfo.pQueueCreateInfos = &queueInfo; |
| 589 | createInfo.enabledExtensionCount = 1; |
| 590 | const char *swap[] = {VK_KHR_SWAPCHAIN_EXTENSION_NAMEcxx . . $ `<external>/13734482859137699468/vulkan_core.h:8949:9`!}; |
| 591 | createInfo.ppEnabledExtensionNames = swap; |
| 592 | VkResult ret = creator(cxx . . $ std/function#`operator()`(39e0826ffb540481).createInfo, display_gpucxx . . $ CreateOtherDevice#display_gpu.); |
| 593 | TRACEcxx . . $ `primus_vk.cpp:57:9`!("Creating display device finished!: " << ret); |
| 594 | if(ret != VK_SUCCESS){ |
| 595 | throw stdcxx . . $ std/::runtime_errorcxx . . $ std/runtime_error#("Display device creation failed"); |
| 596 | } |
| 597 | } |
| 598 | }; |
| 599 | |
| 600 | |
| 601 | class CommandBuffercxx . . $ CommandBuffer# { |
| 602 | VkCommandPool commandPoolcxx . . $ CommandBuffer#commandPool.; |
| 603 | VkDevice devicecxx . . $ CommandBuffer#device.; |
| 604 | public: |
| 605 | VkCommandBuffer cmdcxx . . $ CommandBuffer#cmd.; |
| 606 | CommandBuffercxx . . $ CommandBuffer#CommandBuffer(92c582ea3404ae83).(VkDevice device, uint32_t queueFamilyIndex) : devicecxx . . $ CommandBuffer#device.(device) { |
| 607 | VkCommandPoolCreateInfo poolInfo = {.sType = VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO}; |
| 608 | poolInfo.flags = VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT; |
| 609 | poolInfo.queueFamilyIndex = queueFamilyIndex; |
| 610 | VK_CHECK_RESULTcxx . . $ `primus_vk.cpp:65:9`!(device_dispatch[GetKey(device)].CreateCommandPool(device, &poolInfo, nullptr, &commandPool)); |
| 611 | VkCommandBufferAllocateInfo cmdBufAllocateInfo = {.sType=VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO}; |
| 612 | cmdBufAllocateInfo.commandPool = commandPoolcxx . . $ CommandBuffer#commandPool.; |
| 613 | cmdBufAllocateInfo.level = VK_COMMAND_BUFFER_LEVEL_PRIMARY; |
| 614 | cmdBufAllocateInfo.commandBufferCount = 1; |
| 615 | |
| 616 | VK_CHECK_RESULTcxx . . $ `primus_vk.cpp:65:9`!(device_dispatch[GetKey(device)].AllocateCommandBuffers(device, &cmdBufAllocateInfo, &cmd)); |
| 617 | GetKeycxx . . $ GetKey(d29c9e52fbefad67).(cmdcxx . . $ CommandBuffer#cmd.) = GetKeycxx . . $ GetKey(d29c9e52fbefad67).(device); |
| 618 | |
| 619 | VkCommandBufferBeginInfo cmdBufInfo = {.sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO}; |
| 620 | VK_CHECK_RESULTcxx . . $ `primus_vk.cpp:65:9`!(device_dispatch[GetKey(device)].BeginCommandBuffer(cmd, &cmdBufInfo)); |
| 621 | } |
| 622 | ~cxx . . $ CommandBuffer#`~CommandBuffer`(ced63f7c635d850d).CommandBuffercxx . . $ CommandBuffer#(){ |
| 623 | device_dispatchcxx . . $ device_dispatch.[cxx . . $ std/map#`operator[]`(bbd415b616967878).GetKeycxx . . $ GetKey(d29c9e52fbefad67).(devicecxx . . $ CommandBuffer#device.)].FreeCommandBufferscxx . . $ PvkDispatchTable#FreeCommandBuffers.(devicecxx . . $ CommandBuffer#device., commandPoolcxx . . $ CommandBuffer#commandPool., 1, &cmdcxx . . $ CommandBuffer#cmd.); |
| 624 | device_dispatchcxx . . $ device_dispatch.[cxx . . $ std/map#`operator[]`(bbd415b616967878).GetKeycxx . . $ GetKey(d29c9e52fbefad67).(devicecxx . . $ CommandBuffer#device.)].DestroyCommandPoolcxx . . $ PvkDispatchTable#DestroyCommandPool.(devicecxx . . $ CommandBuffer#device., commandPoolcxx . . $ CommandBuffer#commandPool., nullptr); |
| 625 | } |
| 626 | void insertImageMemoryBarriercxx . . $ CommandBuffer#insertImageMemoryBarrier(5649e16850c51200).( |
| 627 | VkImage image, |
| 628 | VkAccessFlags srcAccessMask, |
| 629 | VkAccessFlags dstAccessMask, |
| 630 | VkImageLayout oldImageLayout, |
| 631 | VkImageLayout newImageLayout, |
| 632 | VkPipelineStageFlags srcStageMask, |
| 633 | VkPipelineStageFlags dstStageMask, |
| 634 | VkImageSubresourceRange subresourceRange) { |
| 635 | VkImageMemoryBarrier imageMemoryBarrier{.sType=VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER}; |
| 636 | imageMemoryBarrier.srcAccessMask = srcAccessMask; |
| 637 | imageMemoryBarrier.dstAccessMask = dstAccessMask; |
| 638 | imageMemoryBarrier.oldLayout = oldImageLayout; |
| 639 | imageMemoryBarrier.newLayout = newImageLayout; |
| 640 | imageMemoryBarrier.image = image; |
| 641 | imageMemoryBarrier.subresourceRange = subresourceRange; |
| 642 | |
| 643 | device_dispatchcxx . . $ device_dispatch.[cxx . . $ std/map#`operator[]`(bbd415b616967878).GetKeycxx . . $ GetKey(d29c9e52fbefad67).(devicecxx . . $ CommandBuffer#device.)].CmdPipelineBarriercxx . . $ PvkDispatchTable#CmdPipelineBarrier.( |
| 644 | cmdcxx . . $ CommandBuffer#cmd., |
| 645 | srcStageMask, |
| 646 | dstStageMask, |
| 647 | 0, |
| 648 | 0, nullptr, |
| 649 | 0, nullptr, |
| 650 | 1, &imageMemoryBarrier); |
| 651 | } |
| 652 | void copyImagecxx . . $ CommandBuffer#copyImage(45df9c11f54db9d1).(VkImage src, VkImage dst, VkExtent2D imgSize){ |
| 653 | VkImageCopy imageCopyRegion{}; |
| 654 | imageCopyRegion.srcSubresource.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; |
| 655 | imageCopyRegion.srcSubresource.layerCount = 1; |
| 656 | imageCopyRegion.dstSubresource.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; |
| 657 | imageCopyRegion.dstSubresource.layerCount = 1; |
| 658 | imageCopyRegion.extent.width = imgSize.width; |
| 659 | imageCopyRegion.extent.height = imgSize.height; |
| 660 | imageCopyRegion.extent.depth = 1; |
| 661 | |
| 662 | // Issue the copy command |
| 663 | device_dispatchcxx . . $ device_dispatch.[cxx . . $ std/map#`operator[]`(bbd415b616967878).GetKeycxx . . $ GetKey(d29c9e52fbefad67).(devicecxx . . $ CommandBuffer#device.)].CmdCopyImagecxx . . $ PvkDispatchTable#CmdCopyImage.( |
| 664 | cmdcxx . . $ CommandBuffer#cmd., |
| 665 | src, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, |
| 666 | dst, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, |
| 667 | 1, |
| 668 | &imageCopyRegion); |
| 669 | } |
| 670 | void endcxx . . $ CommandBuffer#end(49f6e7a06ebc5aa8).(){ |
| 671 | VK_CHECK_RESULTcxx . . $ `primus_vk.cpp:65:9`!(device_dispatch[GetKey(device)].EndCommandBuffer(cmd)); |
| 672 | } |
| 673 | void submitcxx . . $ CommandBuffer#submit(2f0502f7da89316a).(VkQueue queue, VkFence fence, stdcxx . . $ std/::vectorcxx . . $ std/vector#<VkSemaphore> wait =cxx . . $ std/vector#vector(49f6e7a06ebc5aa8). {}, stdcxx . . $ std/::vectorcxx . . $ std/vector#<VkSemaphore> signal =cxx . . $ std/vector#vector(49f6e7a06ebc5aa8). {}){ |
| 674 | VkSubmitInfo submitInfo = {.sType=VK_STRUCTURE_TYPE_SUBMIT_INFO}; |
| 675 | submitInfo.commandBufferCount = 1; |
| 676 | submitInfo.pCommandBuffers = &cmdcxx . . $ CommandBuffer#cmd.; |
| 677 | VkPipelineStageFlags waitStage = VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT; |
| 678 | submitInfo.pWaitDstStageMask = &waitStage; |
| 679 | submitInfo.waitSemaphoreCount = wait.sizecxx . . $ std/vector#size(c9b1e749b64d5edc).(); |
| 680 | submitInfo.pWaitSemaphores = wait.datacxx . . $ std/vector#data(258ee1c9e0a18a5c).(); |
| 681 | submitInfo.signalSemaphoreCount = signal.sizecxx . . $ std/vector#size(c9b1e749b64d5edc).(); |
| 682 | submitInfo.pSignalSemaphores = signal.datacxx . . $ std/vector#data(258ee1c9e0a18a5c).(); |
| 683 | |
| 684 | // Submit to the queue |
| 685 | VK_CHECK_RESULTcxx . . $ `primus_vk.cpp:65:9`!(device_dispatch[GetKey(device)].QueueSubmit(queue, 1, &submitInfo, fence)); |
| 686 | } |
| 687 | }; |
| 688 | |
| 689 | void ImageWorkercxx . . $ ImageWorker#::initImagescxx . . $ ImageWorker#initImages(1d5819dfaea312d5).( const VkSwapchainCreateInfoKHR &createInfo){ |
| 690 | auto imgSize = createInfo.imageExtent; |
| 691 | auto format = createInfo.imageFormat; |
| 692 | |
| 693 | auto &renderImage = render_imagecxx . . $ ImageWorker#render_image.; |
| 694 | auto &renderCopyImage = render_copy_imagecxx . . $ ImageWorker#render_copy_image.; |
| 695 | auto &displaySrcImage = display_src_imagecxx . . $ ImageWorker#display_src_image.; |
| 696 | renderImage =cxx . . $ std/shared_ptr#`operator=`(3501e79a789ff953). stdcxx . . $ std/::make_sharedcxx . . $ std/make_shared(ffca0f3977536948).<FramebufferImagecxx . . $ FramebufferImage#>(swapchaincxx . . $ ImageWorker#swapchain..devicecxx . . $ PrimusSwapchain#device., imgSize, |
| 697 | VK_IMAGE_TILING_OPTIMAL, VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_TRANSFER_SRC_BIT, format, |
| 698 | [this](uint32_t memoryTypeBits){ return swapchaincxx . . $ ImageWorker#swapchain..getImageMemorycxx . . $ PrimusSwapchain#getImageMemory(1b2a2449d0ed1053).(ImageTypecxx . . $ ImageType#::RENDER_TARGET_IMAGEcxx . . $ ImageType#RENDER_TARGET_IMAGE., memoryTypeBits); }); |
| 699 | renderCopyImage =cxx . . $ std/shared_ptr#`operator=`(3501e79a789ff953). stdcxx . . $ std/::make_sharedcxx . . $ std/make_shared(ffca0f3977536948).<FramebufferImagecxx . . $ FramebufferImage#>(swapchaincxx . . $ ImageWorker#swapchain..devicecxx . . $ PrimusSwapchain#device., imgSize, |
| 700 | VK_IMAGE_TILING_LINEAR, VK_IMAGE_USAGE_TRANSFER_DST_BIT, format, |
| 701 | [this](uint32_t memoryTypeBits){ return swapchaincxx . . $ ImageWorker#swapchain..getImageMemorycxx . . $ PrimusSwapchain#getImageMemory(1b2a2449d0ed1053).(ImageTypecxx . . $ ImageType#::RENDER_COPY_IMAGEcxx . . $ ImageType#RENDER_COPY_IMAGE., memoryTypeBits); }); |
| 702 | displaySrcImage =cxx . . $ std/shared_ptr#`operator=`(3501e79a789ff953). stdcxx . . $ std/::make_sharedcxx . . $ std/make_shared(ffca0f3977536948).<FramebufferImagecxx . . $ FramebufferImage#>(swapchaincxx . . $ ImageWorker#swapchain..display_devicecxx . . $ PrimusSwapchain#display_device., imgSize, |
| 703 | VK_IMAGE_TILING_LINEAR, VK_IMAGE_USAGE_TRANSFER_SRC_BIT, format, |
| 704 | [this](uint32_t memoryTypeBits){ return swapchaincxx . . $ ImageWorker#swapchain..getImageMemorycxx . . $ PrimusSwapchain#getImageMemory(1b2a2449d0ed1053).(ImageTypecxx . . $ ImageType#::DISPLAY_IMAGEcxx . . $ ImageType#DISPLAY_IMAGE., memoryTypeBits); }); |
| 705 | |
| 706 | renderCopyImage->cxx . . $ std/__shared_ptr_access#`operator->`(34d6acfd341ba7ab).mapcxx . . $ FramebufferImage#map(49f6e7a06ebc5aa8).(); |
| 707 | displaySrcImage->cxx . . $ std/__shared_ptr_access#`operator->`(34d6acfd341ba7ab).mapcxx . . $ FramebufferImage#map(49f6e7a06ebc5aa8).(); |
| 708 | |
| 709 | CommandBuffercxx . . $ CommandBuffer# cmdcxx . . $ CommandBuffer#CommandBuffer(92c582ea3404ae83).{swapchaincxx . . $ ImageWorker#swapchain..display_devicecxx . . $ PrimusSwapchain#display_device., swapchaincxx . . $ ImageWorker#swapchain..myInstancecxx . . $ PrimusSwapchain#myInstance..displayQueueFamilyIndexcxx . . $ InstanceInfo#displayQueueFamilyIndex.}; |
| 710 | cmd.insertImageMemoryBarriercxx . . $ CommandBuffer#insertImageMemoryBarrier(5649e16850c51200).( |
| 711 | displaySrcImage->cxx . . $ std/__shared_ptr_access#`operator->`(34d6acfd341ba7ab).imgcxx . . $ FramebufferImage#img., |
| 712 | 0, |
| 713 | VK_ACCESS_MEMORY_WRITE_BIT, |
| 714 | VK_IMAGE_LAYOUT_UNDEFINED, |
| 715 | VK_IMAGE_LAYOUT_GENERAL, |
| 716 | VK_PIPELINE_STAGE_TRANSFER_BIT, |
| 717 | VK_PIPELINE_STAGE_TRANSFER_BIT, |
| 718 | VkImageSubresourceRange{ VK_IMAGE_ASPECT_COLOR_BIT, 0, 1, 0, 1 }); |
| 719 | cmd.endcxx . . $ CommandBuffer#end(49f6e7a06ebc5aa8).(); |
| 720 | Fencecxx . . $ Fence# fcxx . . $ Fence#Fence(4612340e2b8d4e51).{swapchaincxx . . $ ImageWorker#swapchain..display_devicecxx . . $ PrimusSwapchain#display_device.}; |
| 721 | cmd.submitcxx . . $ CommandBuffer#submit(2f0502f7da89316a).(swapchaincxx . . $ ImageWorker#swapchain..display_queuecxx . . $ PrimusSwapchain#display_queue., f.fencecxx . . $ Fence#fence.); |
| 722 | f.awaitcxx . . $ Fence#await(49f6e7a06ebc5aa8).(); |
| 723 | } |
| 724 | |
| 725 | |
| 726 | |
| 727 | VkResult VKAPI_CALLcxx . . $ `<external>/12100432684025345130/vk_platform.h:57:13`! PrimusVK_CreateDevicecxx . . $ PrimusVK_CreateDevice(b6838f66b650b666).( |
| 728 | VkPhysicalDevice physicalDevice, |
| 729 | const VkDeviceCreateInfo* pCreateInfo, |
| 730 | const VkAllocationCallbacks* pAllocator, |
| 731 | VkDevice* pDevice) |
| 732 | { |
| 733 | auto &my_instance_info = instance_infocxx . . $ instance_info.[cxx . . $ std/map#`operator[]`(bbd415b616967878).GetKeycxx . . $ GetKey(d29c9e52fbefad67).(physicalDevice)]; |
| 734 | VkLayerDeviceCreateInfocxx . . $ VkLayerDeviceCreateInfo# *layerCreateInfo = (VkLayerDeviceCreateInfocxx . . $ VkLayerDeviceCreateInfo# *)pCreateInfo->pNext; |
| 735 | |
| 736 | // step through the chain of pNext until we get to the link info |
| 737 | while(layerCreateInfo && (layerCreateInfo->sTypecxx . . $ $anonymous_type_f61a1b97f973f0b1_3#sType. != VK_STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO || |
| 738 | layerCreateInfo->functioncxx . . $ $anonymous_type_f61a1b97f973f0b1_3#function. != VK_LAYER_LINK_INFOcxx . . $ VK_LAYER_LINK_INFO.)) |
| 739 | { |
| 740 | layerCreateInfo = (VkLayerDeviceCreateInfocxx . . $ VkLayerDeviceCreateInfo# *)layerCreateInfo->pNextcxx . . $ $anonymous_type_f61a1b97f973f0b1_3#pNext.; |
| 741 | } |
| 742 | |
| 743 | if(layerCreateInfo == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!) |
| 744 | { |
| 745 | // No loader instance create info |
| 746 | return VK_ERROR_INITIALIZATION_FAILED; |
| 747 | } |
| 748 | |
| 749 | PFN_vkGetInstanceProcAddr gipa = layerCreateInfo->ucxx . . $ $anonymous_type_f61a1b97f973f0b1_3#u..pLayerInfocxx . . $ $anonymous_type_f61a1b97f973f0b1_3#$anonymous_type_4#pLayerInfo.->pfnNextGetInstanceProcAddrcxx . . $ VkLayerDeviceLink_#pfnNextGetInstanceProcAddr.; |
| 750 | PFN_vkGetDeviceProcAddr gdpa = layerCreateInfo->ucxx . . $ $anonymous_type_f61a1b97f973f0b1_3#u..pLayerInfocxx . . $ $anonymous_type_f61a1b97f973f0b1_3#$anonymous_type_4#pLayerInfo.->pfnNextGetDeviceProcAddrcxx . . $ VkLayerDeviceLink_#pfnNextGetDeviceProcAddr.; |
| 751 | // move chain on for next layer |
| 752 | layerCreateInfo->ucxx . . $ $anonymous_type_f61a1b97f973f0b1_3#u..pLayerInfocxx . . $ $anonymous_type_f61a1b97f973f0b1_3#$anonymous_type_4#pLayerInfo. = layerCreateInfo->ucxx . . $ $anonymous_type_f61a1b97f973f0b1_3#u..pLayerInfocxx . . $ $anonymous_type_f61a1b97f973f0b1_3#$anonymous_type_4#pLayerInfo.->pNextcxx . . $ VkLayerDeviceLink_#pNext.; |
| 753 | |
| 754 | auto display_dev = my_instance_info.displaycxx . . $ InstanceInfo#display.; |
| 755 | stdcxx . . $ std/::shared_ptrcxx . . $ std/shared_ptr#<CreateOtherDevicecxx . . $ CreateOtherDevice#> cod = nullptrcxx . . $ std/shared_ptr#shared_ptr(6d988fd07f070dfc).; |
| 756 | { |
| 757 | scoped_lockcxx . . $ scoped_lock# lcxx . . $ std/lock_guard#lock_guard(8e935d9c2e576e3a).(global_lockcxx . . $ global_lock.); |
| 758 | cod =cxx . . $ std/shared_ptr#`operator=`(3501e79a789ff953). stdcxx . . $ std/::make_sharedcxx . . $ std/make_shared(ffca0f3977536948).<CreateOtherDevicecxx . . $ CreateOtherDevice#>(display_dev, physicalDevice); |
| 759 | } |
| 760 | auto createDevice = my_instance_info.layerCreateDevicecxx . . $ InstanceInfo#layerCreateDevice.; |
| 761 | cod->cxx . . $ std/__shared_ptr_access#`operator->`(34d6acfd341ba7ab).finishcxx . . $ CreateOtherDevice#finish(a35973bfe76eeac1).([cxx . . $ std/function#function(bdc3712e480e4d04).createDevice,&my_instance_info](VkDeviceCreateInfo &createInfo, VkDevice &dev){ |
| 762 | PFN_vkGetDeviceProcAddr gdpa = nullptr; |
| 763 | auto ret = createDevice(my_instance_info.instancecxx . . $ InstanceInfo#instance., my_instance_info.displaycxx . . $ InstanceInfo#display., &createInfo, nullptr, &dev, PrimusVK_GetInstanceProcAddr, &gdpa); |
| 764 | { |
| 765 | scoped_lockcxx . . $ scoped_lock# lcxx . . $ std/lock_guard#lock_guard(8e935d9c2e576e3a).(global_lockcxx . . $ global_lock.); |
| 766 | device_instance_infocxx . . $ device_instance_info.[cxx . . $ std/map#`operator[]`(bbd415b616967878).GetKeycxx . . $ GetKey(d29c9e52fbefad67).(dev)] = &my_instance_info; |
| 767 | device_dispatchcxx . . $ device_dispatch..insertcxx . . $ std/map#insert(274b9441a76f0de8).({cxx . . $ std/pair#pair(14d64bafa7379ebc).GetKeycxx . . $ GetKey(d29c9e52fbefad67).(dev),fetchDispatchTablecxx . . $ fetchDispatchTable(a881f2b8dd7c0546).(gdpa, &dev)}); |
| 768 | } |
| 769 | return ret; |
| 770 | }); |
| 771 | PFN_vkCreateDevice createFunc = (PFN_vkCreateDevice)gipa(VK_NULL_HANDLEcxx . . $ `<external>/13734482859137699468/vulkan_core.h:41:21`!, "vkCreateDevice"); |
| 772 | VkResult ret = createFunc(physicalDevice, pCreateInfo, pAllocator, pDevice); |
| 773 | cod->cxx . . $ std/__shared_ptr_access#`operator->`(34d6acfd341ba7ab).setRenderDevicecxx . . $ CreateOtherDevice#setRenderDevice(4612340e2b8d4e51).(*pDevice); |
| 774 | my_instance_info.codcxx . . $ InstanceInfo#cod.[cxx . . $ std/map#`operator[]`(bbd415b616967878).GetKeycxx . . $ GetKey(d29c9e52fbefad67).(*pDevice)] =cxx . . $ std/shared_ptr#`operator=`(7563df7e21f73290). cod; |
| 775 | if(ret != VK_SUCCESS){ |
| 776 | TRACEcxx . . $ `primus_vk.cpp:57:9`!("Render Device creation failed: " << ret); |
| 777 | return VK_ERROR_INITIALIZATION_FAILED; |
| 778 | } |
| 779 | // store the table by key |
| 780 | { |
| 781 | scoped_lockcxx . . $ scoped_lock# lcxx . . $ std/lock_guard#lock_guard(8e935d9c2e576e3a).(global_lockcxx . . $ global_lock.); |
| 782 | device_instance_infocxx . . $ device_instance_info.[cxx . . $ std/map#`operator[]`(bbd415b616967878).GetKeycxx . . $ GetKey(d29c9e52fbefad67).(*pDevice)] = &my_instance_info; |
| 783 | device_dispatchcxx . . $ device_dispatch..insertcxx . . $ std/map#insert(274b9441a76f0de8).({cxx . . $ std/pair#pair(14d64bafa7379ebc).GetKeycxx . . $ GetKey(d29c9e52fbefad67).(*pDevice), fetchDispatchTablecxx . . $ fetchDispatchTable(a881f2b8dd7c0546).(gdpa, pDevice)}); |
| 784 | } |
| 785 | TRACEcxx . . $ `primus_vk.cpp:57:9`!("CreateDevice done"); |
| 786 | |
| 787 | return ret; |
| 788 | |
| 789 | } |
| 790 | |
| 791 | PvkDispatchTablecxx . . $ PvkDispatchTable# fetchDispatchTablecxx . . $ fetchDispatchTable(a881f2b8dd7c0546).(PFN_vkGetDeviceProcAddr gdpa, VkDevice *pDevice){ |
| 792 | TRACEcxx . . $ `primus_vk.cpp:57:9`!("fetching dispatch for " << GetKey(*pDevice)); |
| 793 | // fetch our own dispatch table for the functions we need, into the next layer |
| 794 | PvkDispatchTablecxx . . $ PvkDispatchTable# dispatchTable = {cxx . . $ PvkDispatchTable#PvkDispatchTable(c93808dbff24023f).pDevice, gdpa}; |
| 795 | return dispatchTable; |
| 796 | } |
| 797 | |
| 798 | void VKAPI_CALLcxx . . $ `<external>/12100432684025345130/vk_platform.h:57:13`! PrimusVK_DestroyDevicecxx . . $ PrimusVK_DestroyDevice(728eba3f33242499).(VkDevice device, const VkAllocationCallbacks* pAllocator) |
| 799 | { |
| 800 | scoped_lockcxx . . $ scoped_lock# lcxx . . $ std/lock_guard#lock_guard(8e935d9c2e576e3a).(global_lockcxx . . $ global_lock.); |
| 801 | auto &my_instance = *device_instance_infocxx . . $ device_instance_info.[cxx . . $ std/map#`operator[]`(bbd415b616967878).GetKeycxx . . $ GetKey(d29c9e52fbefad67).(device)]; |
| 802 | auto &display_device = my_instance.codcxx . . $ InstanceInfo#cod.[cxx . . $ std/map#`operator[]`(bbd415b616967878).GetKeycxx . . $ GetKey(d29c9e52fbefad67).(device)]->cxx . . $ std/__shared_ptr_access#`operator->`(34d6acfd341ba7ab).display_gpucxx . . $ CreateOtherDevice#display_gpu.; |
| 803 | auto device_key = GetKeycxx . . $ GetKey(d29c9e52fbefad67).(device); |
| 804 | auto display_device_key = GetKeycxx . . $ GetKey(d29c9e52fbefad67).(display_device); |
| 805 | my_instance.layerDestroyDevicecxx . . $ InstanceInfo#layerDestroyDevice.(display_device, nullptr, device_dispatchcxx . . $ device_dispatch.[cxx . . $ std/map#`operator[]`(bbd415b616967878).GetKeycxx . . $ GetKey(d29c9e52fbefad67).(display_device)].DestroyDevicecxx . . $ PvkDispatchTable#DestroyDevice.); |
| 806 | device_dispatchcxx . . $ device_dispatch.[cxx . . $ std/map#`operator[]`(bbd415b616967878).GetKeycxx . . $ GetKey(d29c9e52fbefad67).(device)].DestroyDevicecxx . . $ PvkDispatchTable#DestroyDevice.(device, pAllocator); |
| 807 | my_instance.codcxx . . $ InstanceInfo#cod..erasecxx . . $ std/map#erase(a7de169f3ef4bfb3).(device_key); |
| 808 | device_dispatchcxx . . $ device_dispatch..erasecxx . . $ std/map#erase(a7de169f3ef4bfb3).(device_key); |
| 809 | device_dispatchcxx . . $ device_dispatch..erasecxx . . $ std/map#erase(a7de169f3ef4bfb3).(display_device_key); |
| 810 | } |
| 811 | |
| 812 | VkResult VKAPI_CALLcxx . . $ `<external>/12100432684025345130/vk_platform.h:57:13`! PrimusVK_CreateSwapchainKHRcxx . . $ PrimusVK_CreateSwapchainKHR(a5b481f1c539bc83).(VkDevice device, const VkSwapchainCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSwapchainKHR* pSwapchain) { |
| 813 | auto &my_instance = *device_instance_infocxx . . $ device_instance_info.[cxx . . $ std/map#`operator[]`(bbd415b616967878).GetKeycxx . . $ GetKey(d29c9e52fbefad67).(device)]; |
| 814 | TRACEcxx . . $ `primus_vk.cpp:57:9`!("Application requested " << pCreateInfo->minImageCount << " images."); |
| 815 | VkDevice render_gpu = device; |
| 816 | VkSwapchainCreateInfoKHR info2 = *pCreateInfo; |
| 817 | info2.minImageCount = stdcxx . . $ std/::maxcxx . . $ std/max(2a338fce5842aa6a).(3u, pCreateInfo->minImageCount); |
| 818 | info2.imageUsage |= VK_IMAGE_USAGE_TRANSFER_DST_BIT; |
| 819 | pCreateInfo = &info2; |
| 820 | |
| 821 | VkSwapchainKHR old = pCreateInfo->oldSwapchain; |
| 822 | if(old != VK_NULL_HANDLEcxx . . $ `<external>/13734482859137699468/vulkan_core.h:41:21`!){ |
| 823 | PrimusSwapchaincxx . . $ PrimusSwapchain# *ch = reinterpret_cast<PrimusSwapchaincxx . . $ PrimusSwapchain#*>(old); |
| 824 | info2.oldSwapchain = ch->backendcxx . . $ PrimusSwapchain#backend.; |
| 825 | TRACEcxx . . $ `primus_vk.cpp:57:9`!("Old Swapchain: " << ch->backend); |
| 826 | } |
| 827 | TRACEcxx . . $ `primus_vk.cpp:57:9`!("Creating Swapchain for size: " << pCreateInfo->imageExtent.width << "x" << pCreateInfo->imageExtent.height); |
| 828 | TRACEcxx . . $ `primus_vk.cpp:57:9`!("MinImageCount: " << pCreateInfo->minImageCount); |
| 829 | TRACEcxx . . $ `primus_vk.cpp:57:9`!("fetching device for: " << GetKey(render_gpu)); |
| 830 | VkDevice display_gpu = my_instance.codcxx . . $ InstanceInfo#cod.[cxx . . $ std/map#`operator[]`(bbd415b616967878).GetKeycxx . . $ GetKey(d29c9e52fbefad67).(device)]->cxx . . $ std/__shared_ptr_access#`operator->`(34d6acfd341ba7ab).display_gpucxx . . $ CreateOtherDevice#display_gpu.; |
| 831 | |
| 832 | TRACEcxx . . $ `primus_vk.cpp:57:9`!("FamilyIndexCount: " << pCreateInfo->queueFamilyIndexCount); |
| 833 | TRACEcxx . . $ `primus_vk.cpp:57:9`!("Dev: " << GetKey(display_gpu)); |
| 834 | TRACEcxx . . $ `primus_vk.cpp:57:9`!("Swapchainfunc: " << (void*) device_dispatch[GetKey(display_gpu)].CreateSwapchainKHR); |
| 835 | |
| 836 | VkSwapchainKHR backend; |
| 837 | VkResult rc = device_dispatchcxx . . $ device_dispatch.[cxx . . $ std/map#`operator[]`(bbd415b616967878).GetKeycxx . . $ GetKey(d29c9e52fbefad67).(display_gpu)].CreateSwapchainKHRcxx . . $ PvkDispatchTable#CreateSwapchainKHR.(display_gpu, pCreateInfo, pAllocator, &backend); |
| 838 | TRACEcxx . . $ `primus_vk.cpp:57:9`!(">> Swapchain create done " << rc << ";" << (void*) backend); |
| 839 | if(rc != VK_SUCCESS){ |
| 840 | return rc; |
| 841 | } |
| 842 | try { |
| 843 | PrimusSwapchaincxx . . $ PrimusSwapchain# *ch = new PrimusSwapchaincxx . . $ PrimusSwapchain#PrimusSwapchain(8cfb9630c4f2f05f).(my_instance, render_gpu, display_gpu, backend, pCreateInfo, my_instance.codcxx . . $ InstanceInfo#cod.[cxx . . $ std/map#`operator[]`(bbd415b616967878).GetKeycxx . . $ GetKey(d29c9e52fbefad67).(device)]); |
| 844 | *pSwapchain = reinterpret_cast<VkSwapchainKHR>(ch); |
| 845 | }catch(const stdcxx . . $ std/::exception &e){ |
| 846 | return VK_ERROR_UNKNOWN; |
| 847 | } |
| 848 | |
| 849 | |
| 850 | |
| 851 | return rc; |
| 852 | } |
| 853 | |
| 854 | void VKAPI_CALLcxx . . $ `<external>/12100432684025345130/vk_platform.h:57:13`! PrimusVK_DestroySwapchainKHRcxx . . $ PrimusVK_DestroySwapchainKHR(85876bb8834e3627).(VkDevice device, VkSwapchainKHR swapchain, const VkAllocationCallbacks* pAllocator) { |
| 855 | if(swapchain == VK_NULL_HANDLEcxx . . $ `<external>/13734482859137699468/vulkan_core.h:41:21`!) { return;} |
| 856 | PrimusSwapchaincxx . . $ PrimusSwapchain# *ch = reinterpret_cast<PrimusSwapchaincxx . . $ PrimusSwapchain#*>(swapchain); |
| 857 | TRACEcxx . . $ `primus_vk.cpp:57:9`!(">> Destroy swapchain: " << (void*) ch->backend); |
| 858 | ch->stopcxx . . $ PrimusSwapchain#stop(49f6e7a06ebc5aa8).(); |
| 859 | device_dispatchcxx . . $ device_dispatch.[cxx . . $ std/map#`operator[]`(bbd415b616967878).GetKeycxx . . $ GetKey(d29c9e52fbefad67).(ch->display_devicecxx . . $ PrimusSwapchain#display_device.)].DestroySwapchainKHRcxx . . $ PvkDispatchTable#DestroySwapchainKHR.(ch->display_devicecxx . . $ PrimusSwapchain#display_device., ch->backendcxx . . $ PrimusSwapchain#backend., pAllocator); |
| 860 | delete ch; |
| 861 | } |
| 862 | VkResult VKAPI_CALLcxx . . $ `<external>/12100432684025345130/vk_platform.h:57:13`! PrimusVK_GetSwapchainImagesKHRcxx . . $ PrimusVK_GetSwapchainImagesKHR(f4576b5bbddf48e0).(VkDevice device, VkSwapchainKHR swapchain, uint32_t* pSwapchainImageCount, VkImage* pSwapchainImages) { |
| 863 | PrimusSwapchaincxx . . $ PrimusSwapchain# *ch = reinterpret_cast<PrimusSwapchaincxx . . $ PrimusSwapchain#*>(swapchain); |
| 864 | |
| 865 | *pSwapchainImageCount = ch->imagescxx . . $ PrimusSwapchain#images..sizecxx . . $ std/vector#size(c9b1e749b64d5edc).(); |
| 866 | VkResult res = VK_SUCCESS; |
| 867 | if(pSwapchainImages != nullptr) { |
| 868 | res = VK_SUCCESS; |
| 869 | for(size_t i = 0; i < *pSwapchainImageCount; i++){ |
| 870 | pSwapchainImages[i] = ch->imagescxx . . $ PrimusSwapchain#images.[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).i].render_imagecxx . . $ ImageWorker#render_image.->cxx . . $ std/__shared_ptr_access#`operator->`(34d6acfd341ba7ab).imgcxx . . $ FramebufferImage#img.; |
| 871 | } |
| 872 | TRACEcxx . . $ `primus_vk.cpp:57:9`!("Count: " << *pSwapchainImageCount); |
| 873 | } |
| 874 | return res; |
| 875 | } |
| 876 | |
| 877 | const auto primus_startcxx . . $ primus_start. = stdcxx . . $ std/::chronocxx . . $ std/chrono/::steady_clockcxx . . $ std/chrono/_V2/steady_clock#::nowcxx . . $ std/chrono/_V2/steady_clock#now(edffc6b45db65c20).(); |
| 878 | VkResult VKAPI_CALLcxx . . $ `<external>/12100432684025345130/vk_platform.h:57:13`! PrimusVK_AcquireNextImage2KHRcxx . . $ PrimusVK_AcquireNextImage2KHR(cd7f727b81f66d44).(VkDevice device, const VkAcquireNextImageInfoKHR* pAcquireInfo, uint32_t* pImageIndex) { |
| 879 | TRACE_PROFILING_EVENTcxx . . $ `primus_vk.cpp:60:9`!(-1, "Acquire starting"); |
| 880 | PrimusSwapchaincxx . . $ PrimusSwapchain# *ch = reinterpret_cast<PrimusSwapchaincxx . . $ PrimusSwapchain#*>(pAcquireInfo->swapchain); |
| 881 | |
| 882 | auto timeout = pAcquireInfo->timeout; |
| 883 | VkResult res; |
| 884 | { |
| 885 | Fencecxx . . $ Fence# myfencecxx . . $ Fence#Fence(4612340e2b8d4e51).{ch->display_devicecxx . . $ PrimusSwapchain#display_device.}; |
| 886 | |
| 887 | ch->waitForReadycxx . . $ PrimusSwapchain#waitForReady(49f6e7a06ebc5aa8).(); |
| 888 | res = device_dispatchcxx . . $ device_dispatch.[cxx . . $ std/map#`operator[]`(bbd415b616967878).GetKeycxx . . $ GetKey(d29c9e52fbefad67).(ch->display_devicecxx . . $ PrimusSwapchain#display_device.)].AcquireNextImageKHRcxx . . $ PvkDispatchTable#AcquireNextImageKHR.(ch->display_devicecxx . . $ PrimusSwapchain#display_device., ch->backendcxx . . $ PrimusSwapchain#backend., timeout, VK_NULL_HANDLEcxx . . $ `<external>/13734482859137699468/vulkan_core.h:41:21`!, myfence.fencecxx . . $ Fence#fence., pImageIndex); |
| 889 | TRACE_PROFILING_EVENTcxx . . $ `primus_vk.cpp:60:9`!(*pImageIndex, "got image"); |
| 890 | myfence.awaitcxx . . $ Fence#await(49f6e7a06ebc5aa8).(); |
| 891 | } |
| 892 | VkSubmitInfo qsi{}; |
| 893 | qsi.sType = VK_STRUCTURE_TYPE_SUBMIT_INFO; |
| 894 | if(pAcquireInfo->semaphore != VK_NULL_HANDLEcxx . . $ `<external>/13734482859137699468/vulkan_core.h:41:21`!){ |
| 895 | qsi.signalSemaphoreCount = 1; |
| 896 | qsi.pSignalSemaphores = &pAcquireInfo->semaphore; |
| 897 | } |
| 898 | scoped_lockcxx . . $ scoped_lock# lockcxx . . $ std/lock_guard#lock_guard(8e935d9c2e576e3a).(*cxx . . $ std/__shared_ptr_access#`operator*`(d426bc7b625886b7).device_instance_infocxx . . $ device_instance_info.[cxx . . $ std/map#`operator[]`(bbd415b616967878).GetKeycxx . . $ GetKey(d29c9e52fbefad67).(ch->render_queuecxx . . $ PrimusSwapchain#render_queue.)]->renderQueueMutexcxx . . $ InstanceInfo#renderQueueMutex.); |
| 899 | device_dispatchcxx . . $ device_dispatch.[cxx . . $ std/map#`operator[]`(bbd415b616967878).GetKeycxx . . $ GetKey(d29c9e52fbefad67).(ch->render_queuecxx . . $ PrimusSwapchain#render_queue.)].QueueSubmitcxx . . $ PvkDispatchTable#QueueSubmit.(ch->render_queuecxx . . $ PrimusSwapchain#render_queue., 1, &qsi, pAcquireInfo->fence); |
| 900 | TRACE_PROFILING_EVENTcxx . . $ `primus_vk.cpp:60:9`!(*pImageIndex, "Acquire done"); |
| 901 | |
| 902 | if(ch->suppress_suboptimalcxx . . $ PrimusSwapchain#suppress_suboptimal. && res == VK_SUBOPTIMAL_KHR){ |
| 903 | res = VK_SUCCESS; |
| 904 | } |
| 905 | |
| 906 | return res; |
| 907 | } |
| 908 | VkResult VKAPI_CALLcxx . . $ `<external>/12100432684025345130/vk_platform.h:57:13`! PrimusVK_AcquireNextImageKHRcxx . . $ PrimusVK_AcquireNextImageKHR(ad25e04ca1de5afd).(VkDevice device, VkSwapchainKHR swapchain, uint64_t timeout, VkSemaphore semaphore, VkFence fence, uint32_t* pImageIndex) { |
| 909 | auto acquireInfo = VkAcquireNextImageInfoKHR{}; |
| 910 | |
| 911 | acquireInfo.sType = VK_STRUCTURE_TYPE_ACQUIRE_NEXT_IMAGE_INFO_KHR; |
| 912 | acquireInfo.swapchain = swapchain; |
| 913 | acquireInfo.timeout = timeout; |
| 914 | acquireInfo.semaphore = semaphore; |
| 915 | acquireInfo.fence = fence; |
| 916 | |
| 917 | return PrimusVK_AcquireNextImage2KHRcxx . . $ PrimusVK_AcquireNextImage2KHR(cd7f727b81f66d44).(device, &acquireInfo, pImageIndex); |
| 918 | } |
| 919 | VkResult VKAPI_CALLcxx . . $ `<external>/12100432684025345130/vk_platform.h:57:13`! PrimusVK_GetSwapchainStatusKHRcxx . . $ PrimusVK_GetSwapchainStatusKHR(7d861c9310b1fb27).(VkDevice device, VkSwapchainKHR swapchain){ |
| 920 | PrimusSwapchaincxx . . $ PrimusSwapchain# *ch = reinterpret_cast<PrimusSwapchaincxx . . $ PrimusSwapchain#*>(swapchain); |
| 921 | return device_dispatchcxx . . $ device_dispatch.[cxx . . $ std/map#`operator[]`(bbd415b616967878).GetKeycxx . . $ GetKey(d29c9e52fbefad67).(ch->display_devicecxx . . $ PrimusSwapchain#display_device.)].GetSwapchainStatusKHRcxx . . $ PvkDispatchTable#GetSwapchainStatusKHR.(device, ch->backendcxx . . $ PrimusSwapchain#backend.); |
| 922 | } |
| 923 | |
| 924 | uint32_t PrimusSwapchaincxx . . $ PrimusSwapchain#::getImageMemorycxx . . $ PrimusSwapchain#getImageMemory(1b2a2449d0ed1053).(ImageTypecxx . . $ ImageType# image_type, uint32_t memoryTypeBits){ |
| 925 | const VkPhysicalDeviceMemoryProperties *mem_props = &codcxx . . $ PrimusSwapchain#cod.->cxx . . $ std/__shared_ptr_access#`operator->`(34d6acfd341ba7ab).render_memcxx . . $ CreateOtherDevice#render_mem.; |
| 926 | stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::paircxx . . $ std/pair#<VkMemoryPropertyFlags, VkMemoryPropertyFlags>> propertyPreferencescxx . . $ std/vector#vector(49f6e7a06ebc5aa8).; |
| 927 | switch(image_type){ |
| 928 | case ImageTypecxx . . $ ImageType#::RENDER_TARGET_IMAGEcxx . . $ ImageType#RENDER_TARGET_IMAGE.: |
| 929 | propertyPreferences =cxx . . $ std/vector#`operator=`(134e05886416f404). { |
| 930 | {VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT, VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT}, |
| 931 | {VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT, 0} |
| 932 | }; |
| 933 | break; |
| 934 | case ImageTypecxx . . $ ImageType#::RENDER_COPY_IMAGEcxx . . $ ImageType#RENDER_COPY_IMAGE.: |
| 935 | propertyPreferences =cxx . . $ std/vector#`operator=`(134e05886416f404). { |
| 936 | {VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_CACHED_BIT, VK_MEMORY_PROPERTY_HOST_COHERENT_BIT}, |
| 937 | {VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_CACHED_BIT, 0}, |
| 938 | {VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT, 0} |
| 939 | }; |
| 940 | break; |
| 941 | case ImageTypecxx . . $ ImageType#::DISPLAY_IMAGEcxx . . $ ImageType#DISPLAY_IMAGE.: |
| 942 | mem_props = &codcxx . . $ PrimusSwapchain#cod.->cxx . . $ std/__shared_ptr_access#`operator->`(34d6acfd341ba7ab).display_memcxx . . $ CreateOtherDevice#display_mem.; |
| 943 | propertyPreferences =cxx . . $ std/vector#`operator=`(134e05886416f404). { |
| 944 | {VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT, 0} |
| 945 | }; |
| 946 | break; |
| 947 | } |
| 948 | for( const auto &requested : propertyPreferences ){ |
| 949 | for(size_t j = 0; j < mem_props->memoryTypeCount; j++){ |
| 950 | if( (memoryTypeBits & (1 << j)) == 0) { |
| 951 | continue; |
| 952 | } |
| 953 | auto flags = mem_props->memoryTypes[j].propertyFlags; |
| 954 | if((flags & requested.firstcxx . . $ std/pair#first.) == requested.firstcxx . . $ std/pair#first. && (flags & requested.secondcxx . . $ std/pair#second.) == 0) { |
| 955 | return j; |
| 956 | } |
| 957 | } |
| 958 | } |
| 959 | TRACEcxx . . $ `primus_vk.cpp:57:9`!("ERROR, no suitable image memory found for " << image_type); |
| 960 | throw stdcxx . . $ std/::runtime_errorcxx . . $ std/runtime_error#("No suitable image memory found."); |
| 961 | } |
| 962 | |
| 963 | void ImageWorkercxx . . $ ImageWorker#::createCommandBufferscxx . . $ ImageWorker#createCommandBuffers(49f6e7a06ebc5aa8).(){ |
| 964 | { |
| 965 | auto cpyImage = render_copy_imagecxx . . $ std/shared_ptr#shared_ptr(159b2ef84668bf93).; |
| 966 | auto srcImage = render_imagecxx . . $ ImageWorker#render_image.->cxx . . $ std/__shared_ptr_access#`operator->`(34d6acfd341ba7ab).imgcxx . . $ FramebufferImage#img.; |
| 967 | render_copy_commandcxx . . $ ImageWorker#render_copy_command. =cxx . . $ std/shared_ptr#`operator=`(3501e79a789ff953). stdcxx . . $ std/::make_sharedcxx . . $ std/make_shared(ffca0f3977536948).<CommandBuffercxx . . $ CommandBuffer#>(swapchaincxx . . $ ImageWorker#swapchain..devicecxx . . $ PrimusSwapchain#device., swapchaincxx . . $ ImageWorker#swapchain..myInstancecxx . . $ PrimusSwapchain#myInstance..renderQueueFamilyIndexcxx . . $ InstanceInfo#renderQueueFamilyIndex.); |
| 968 | CommandBuffercxx . . $ CommandBuffer# &cmd = *cxx . . $ std/__shared_ptr_access#`operator*`(d426bc7b625886b7).render_copy_commandcxx . . $ ImageWorker#render_copy_command.; |
| 969 | cmd.insertImageMemoryBarriercxx . . $ CommandBuffer#insertImageMemoryBarrier(5649e16850c51200).( |
| 970 | cpyImage->cxx . . $ std/__shared_ptr_access#`operator->`(34d6acfd341ba7ab).imgcxx . . $ FramebufferImage#img., |
| 971 | VK_ACCESS_HOST_READ_BIT, VK_ACCESS_TRANSFER_WRITE_BIT, |
| 972 | VK_IMAGE_LAYOUT_UNDEFINED, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, |
| 973 | VK_PIPELINE_STAGE_HOST_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT, |
| 974 | VkImageSubresourceRange{ VK_IMAGE_ASPECT_COLOR_BIT, 0, 1, 0, 1 }); |
| 975 | cmd.insertImageMemoryBarriercxx . . $ CommandBuffer#insertImageMemoryBarrier(5649e16850c51200).( |
| 976 | srcImage, |
| 977 | VK_ACCESS_MEMORY_READ_BIT, VK_ACCESS_TRANSFER_READ_BIT, |
| 978 | VK_IMAGE_LAYOUT_PRESENT_SRC_KHR, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, |
| 979 | VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT, |
| 980 | VkImageSubresourceRange{ VK_IMAGE_ASPECT_COLOR_BIT, 0, 1, 0, 1 }); |
| 981 | |
| 982 | cmd.copyImagecxx . . $ CommandBuffer#copyImage(45df9c11f54db9d1).(srcImage, cpyImage->cxx . . $ std/__shared_ptr_access#`operator->`(34d6acfd341ba7ab).imgcxx . . $ FramebufferImage#img., swapchaincxx . . $ ImageWorker#swapchain..imgSizecxx . . $ PrimusSwapchain#imgSize.); |
| 983 | |
| 984 | cmd.insertImageMemoryBarriercxx . . $ CommandBuffer#insertImageMemoryBarrier(5649e16850c51200).( |
| 985 | cpyImage->cxx . . $ std/__shared_ptr_access#`operator->`(34d6acfd341ba7ab).imgcxx . . $ FramebufferImage#img., |
| 986 | VK_ACCESS_TRANSFER_WRITE_BIT, VK_ACCESS_HOST_READ_BIT, |
| 987 | VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, VK_IMAGE_LAYOUT_GENERAL, |
| 988 | VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_HOST_BIT, |
| 989 | VkImageSubresourceRange{ VK_IMAGE_ASPECT_COLOR_BIT, 0, 1, 0, 1 }); |
| 990 | cmd.insertImageMemoryBarriercxx . . $ CommandBuffer#insertImageMemoryBarrier(5649e16850c51200).( |
| 991 | srcImage, |
| 992 | VK_ACCESS_TRANSFER_READ_BIT, VK_ACCESS_MEMORY_READ_BIT, |
| 993 | VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, VK_IMAGE_LAYOUT_PRESENT_SRC_KHR, |
| 994 | VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT, |
| 995 | VkImageSubresourceRange{ VK_IMAGE_ASPECT_COLOR_BIT, 0, 1, 0, 1 }); |
| 996 | |
| 997 | cmd.endcxx . . $ CommandBuffer#end(49f6e7a06ebc5aa8).(); |
| 998 | } |
| 999 | |
| 1000 | { |
| 1001 | display_commandcxx . . $ ImageWorker#display_command. =cxx . . $ std/shared_ptr#`operator=`(3501e79a789ff953). stdcxx . . $ std/::make_sharedcxx . . $ std/make_shared(ffca0f3977536948).<CommandBuffercxx . . $ CommandBuffer#>(swapchaincxx . . $ ImageWorker#swapchain..display_devicecxx . . $ PrimusSwapchain#display_device., swapchaincxx . . $ ImageWorker#swapchain..myInstancecxx . . $ PrimusSwapchain#myInstance..displayQueueFamilyIndexcxx . . $ InstanceInfo#displayQueueFamilyIndex.); |
| 1002 | CommandBuffercxx . . $ CommandBuffer# &cmd = *cxx . . $ std/__shared_ptr_access#`operator*`(d426bc7b625886b7).display_commandcxx . . $ ImageWorker#display_command.; |
| 1003 | cmd.insertImageMemoryBarriercxx . . $ CommandBuffer#insertImageMemoryBarrier(5649e16850c51200).( |
| 1004 | display_src_imagecxx . . $ ImageWorker#display_src_image.->cxx . . $ std/__shared_ptr_access#`operator->`(34d6acfd341ba7ab).imgcxx . . $ FramebufferImage#img., |
| 1005 | VK_ACCESS_HOST_WRITE_BIT, VK_ACCESS_TRANSFER_READ_BIT, |
| 1006 | VK_IMAGE_LAYOUT_GENERAL, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, |
| 1007 | VK_PIPELINE_STAGE_HOST_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT, |
| 1008 | VkImageSubresourceRange{ VK_IMAGE_ASPECT_COLOR_BIT, 0, 1, 0, 1 }); |
| 1009 | cmd.insertImageMemoryBarriercxx . . $ CommandBuffer#insertImageMemoryBarrier(5649e16850c51200).( |
| 1010 | display_imagecxx . . $ ImageWorker#display_image., |
| 1011 | VK_ACCESS_MEMORY_READ_BIT, VK_ACCESS_TRANSFER_WRITE_BIT, |
| 1012 | VK_IMAGE_LAYOUT_UNDEFINED, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, |
| 1013 | VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT, |
| 1014 | VkImageSubresourceRange{ VK_IMAGE_ASPECT_COLOR_BIT, 0, 1, 0, 1 }); |
| 1015 | cmd.copyImagecxx . . $ CommandBuffer#copyImage(45df9c11f54db9d1).(display_src_imagecxx . . $ ImageWorker#display_src_image.->cxx . . $ std/__shared_ptr_access#`operator->`(34d6acfd341ba7ab).imgcxx . . $ FramebufferImage#img., display_imagecxx . . $ ImageWorker#display_image., swapchaincxx . . $ ImageWorker#swapchain..imgSizecxx . . $ PrimusSwapchain#imgSize.); |
| 1016 | |
| 1017 | cmd.insertImageMemoryBarriercxx . . $ CommandBuffer#insertImageMemoryBarrier(5649e16850c51200).( |
| 1018 | display_src_imagecxx . . $ ImageWorker#display_src_image.->cxx . . $ std/__shared_ptr_access#`operator->`(34d6acfd341ba7ab).imgcxx . . $ FramebufferImage#img., |
| 1019 | VK_ACCESS_TRANSFER_READ_BIT, VK_ACCESS_HOST_WRITE_BIT, |
| 1020 | VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, VK_IMAGE_LAYOUT_GENERAL, |
| 1021 | VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_HOST_BIT, |
| 1022 | VkImageSubresourceRange{ VK_IMAGE_ASPECT_COLOR_BIT, 0, 1, 0, 1 }); |
| 1023 | cmd.insertImageMemoryBarriercxx . . $ CommandBuffer#insertImageMemoryBarrier(5649e16850c51200).( |
| 1024 | display_imagecxx . . $ ImageWorker#display_image., |
| 1025 | VK_ACCESS_TRANSFER_WRITE_BIT, VK_ACCESS_MEMORY_READ_BIT, |
| 1026 | VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, VK_IMAGE_LAYOUT_PRESENT_SRC_KHR, |
| 1027 | VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT, |
| 1028 | VkImageSubresourceRange{ VK_IMAGE_ASPECT_COLOR_BIT, 0, 1, 0, 1 }); |
| 1029 | cmd.endcxx . . $ CommandBuffer#end(49f6e7a06ebc5aa8).(); |
| 1030 | } |
| 1031 | } |
| 1032 | |
| 1033 | void PrimusSwapchaincxx . . $ PrimusSwapchain#::storeImagecxx . . $ PrimusSwapchain#storeImage(becaf869902be12d).(uint32_t index, VkQueue queue, stdcxx . . $ std/::vectorcxx . . $ std/vector#<VkSemaphore> wait_on, Fencecxx . . $ Fence# ¬ify){ |
| 1034 | imagescxx . . $ PrimusSwapchain#images.[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).index].render_copy_commandcxx . . $ ImageWorker#render_copy_command.->cxx . . $ std/__shared_ptr_access#`operator->`(34d6acfd341ba7ab).submitcxx . . $ CommandBuffer#submit(2f0502f7da89316a).(queue, notify.fencecxx . . $ Fence#fence., wait_oncxx . . $ std/vector#vector(a1201200cf0efa42).); |
| 1035 | } |
| 1036 | |
| 1037 | void ImageWorkercxx . . $ ImageWorker#::copyImageDatacxx . . $ ImageWorker#copyImageData(813df1c2663f4e59).(uint32_t index, stdcxx . . $ std/::vectorcxx . . $ std/vector#<VkSemaphore> sems){ |
| 1038 | { |
| 1039 | auto rendered = render_copy_imagecxx . . $ ImageWorker#render_copy_image.->cxx . . $ std/__shared_ptr_access#`operator->`(34d6acfd341ba7ab).getMappedcxx . . $ FramebufferImage#getMapped(eae2f623be7e328f).(); |
| 1040 | auto display = display_src_imagecxx . . $ ImageWorker#display_src_image.->cxx . . $ std/__shared_ptr_access#`operator->`(34d6acfd341ba7ab).getMappedcxx . . $ FramebufferImage#getMapped(eae2f623be7e328f).(); |
| 1041 | auto rendered_layout = render_copy_imagecxx . . $ ImageWorker#render_copy_image.->cxx . . $ std/__shared_ptr_access#`operator->`(34d6acfd341ba7ab).getLayoutcxx . . $ FramebufferImage#getLayout(4072efb97e26edeb).(); |
| 1042 | auto display_layout = display_src_imagecxx . . $ ImageWorker#display_src_image.->cxx . . $ std/__shared_ptr_access#`operator->`(34d6acfd341ba7ab).getLayoutcxx . . $ FramebufferImage#getLayout(4072efb97e26edeb).(); |
| 1043 | auto rendered_start = rendered->cxx . . $ std/__shared_ptr_access#`operator->`(34d6acfd341ba7ab).datacxx . . $ MappedMemory#data. + rendered_layout.offset; |
| 1044 | auto display_start = display->cxx . . $ std/__shared_ptr_access#`operator->`(34d6acfd341ba7ab).datacxx . . $ MappedMemory#data. + display_layout.offset; |
| 1045 | if(rendered_layout.size/rendered_layout.rowPitch != display_layout.size/display_layout.rowPitch){ |
| 1046 | TRACEcxx . . $ `primus_vk.cpp:57:9`!("Layouts don't match at all"); |
| 1047 | throw stdcxx . . $ std/::runtime_errorcxx . . $ std/runtime_error#("Layouts don't match at all"); |
| 1048 | } |
| 1049 | TRACE_PROFILING_EVENTcxx . . $ `primus_vk.cpp:60:9`!(index, "memcpy start"); |
| 1050 | VkMappedMemoryRange rendered_range { |
| 1051 | .sType = VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE, |
| 1052 | .pNext = VK_NULL_HANDLEcxx . . $ `<external>/13734482859137699468/vulkan_core.h:41:21`!, |
| 1053 | .memory = render_copy_imagecxx . . $ ImageWorker#render_copy_image.->cxx . . $ std/__shared_ptr_access#`operator->`(34d6acfd341ba7ab).memcxx . . $ FramebufferImage#mem., |
| 1054 | .offset = 0, |
| 1055 | .size = VK_WHOLE_SIZEcxx . . $ `<external>/13734482859137699468/vulkan_core.h:130:9`! |
| 1056 | }; |
| 1057 | VK_CHECK_RESULTcxx . . $ `primus_vk.cpp:65:9`!(device_dispatch[GetKey(swapchain.device)].InvalidateMappedMemoryRanges(swapchain.device, 1, &rendered_range)); |
| 1058 | |
| 1059 | if(rendered_layout.rowPitch == display_layout.rowPitch){ |
| 1060 | stdcxx . . $ std/::memcpy(display_start, rendered_start, rendered_layout.size); |
| 1061 | }else{ |
| 1062 | VkDeviceSize display_offset = 0; |
| 1063 | VkDeviceSize minRowPitch = rendered_layout.rowPitch; |
| 1064 | if(display_layout.rowPitch < minRowPitch){ |
| 1065 | minRowPitch = display_layout.rowPitch; |
| 1066 | } |
| 1067 | for(VkDeviceSize offset = 0; offset < rendered_layout.size; offset += rendered_layout.rowPitch){ |
| 1068 | stdcxx . . $ std/::memcpy(display_start + display_offset, rendered_start + offset, minRowPitch); |
| 1069 | display_offset += display_layout.rowPitch; |
| 1070 | } |
| 1071 | } |
| 1072 | TRACE_PROFILING_EVENTcxx . . $ `primus_vk.cpp:60:9`!(index, "memcpy done"); |
| 1073 | } |
| 1074 | { |
| 1075 | stdcxx . . $ std/::unique_lockcxx . . $ std/unique_lock#<stdcxx . . $ std/::mutexcxx . . $ std/mutex#> lockcxx . . $ std/unique_lock#unique_lock(8e935d9c2e576e3a).(swapchaincxx . . $ ImageWorker#swapchain..queueMutexcxx . . $ PrimusSwapchain#queueMutex.); |
| 1076 | if(display_command_fencecxx . . $ ImageWorker#display_command_fence.){ |
| 1077 | display_command_fencecxx . . $ ImageWorker#display_command_fence.->cxx . . $ std/unique_ptr#`operator->`(ea7391e9eeeaf20e).awaitcxx . . $ Fence#await(49f6e7a06ebc5aa8).(); |
| 1078 | display_command_fencecxx . . $ ImageWorker#display_command_fence.->cxx . . $ std/unique_ptr#`operator->`(ea7391e9eeeaf20e).resetcxx . . $ Fence#reset(49f6e7a06ebc5aa8).(); |
| 1079 | }else{ |
| 1080 | display_command_fencecxx . . $ ImageWorker#display_command_fence. =cxx . . $ std/unique_ptr#`operator=`(1b63e42eaa758a73). stdcxx . . $ std/::unique_ptrcxx . . $ std/unique_ptr#<Fencecxx . . $ Fence#>(new Fencecxx . . $ Fence#(swapchaincxx . . $ ImageWorker#swapchain..display_devicecxx . . $ PrimusSwapchain#display_device.)); |
| 1081 | } |
| 1082 | display_commandcxx . . $ ImageWorker#display_command.->cxx . . $ std/__shared_ptr_access#`operator->`(34d6acfd341ba7ab).submitcxx . . $ CommandBuffer#submit(2f0502f7da89316a).(swapchaincxx . . $ ImageWorker#swapchain..display_queuecxx . . $ PrimusSwapchain#display_queue., display_command_fencecxx . . $ ImageWorker#display_command_fence.->cxx . . $ std/unique_ptr#`operator->`(ea7391e9eeeaf20e).fencecxx . . $ Fence#fence., {cxx . . $ std/vector#vector(49f6e7a06ebc5aa8).}, semscxx . . $ std/vector#vector(a1201200cf0efa42).); |
| 1083 | } |
| 1084 | } |
| 1085 | |
| 1086 | void PrimusSwapchaincxx . . $ PrimusSwapchain#::queuecxx . . $ PrimusSwapchain#queue(37781134286668e7).(VkQueue queue, const VkPresentInfoKHR* pPresentInfo){ |
| 1087 | stdcxx . . $ std/::unique_lockcxx . . $ std/unique_lock#<stdcxx . . $ std/::mutexcxx . . $ std/mutex#> lockcxx . . $ std/unique_lock#unique_lock(8e935d9c2e576e3a).(queueMutexcxx . . $ PrimusSwapchain#queueMutex.); |
| 1088 | |
| 1089 | auto workItem = QueueItemcxx . . $ PrimusSwapchain#QueueItem#{queue, *pPresentInfo, pPresentInfo->pImageIndices[0]}; |
| 1090 | storeImagecxx . . $ PrimusSwapchain#storeImage(becaf869902be12d).(workItem.imgIndexcxx . . $ PrimusSwapchain#QueueItem#imgIndex., render_queuecxx . . $ PrimusSwapchain#render_queue., stdcxx . . $ std/vector#vector(13e0640cd3842f28).::vectorcxx . . $ std/vector#<VkSemaphore>{pPresentInfo->pWaitSemaphores, pPresentInfo->pWaitSemaphores + pPresentInfo->waitSemaphoreCount}, imagescxx . . $ PrimusSwapchain#images.[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).workItem.imgIndexcxx . . $ PrimusSwapchain#QueueItem#imgIndex.].render_copy_fencecxx . . $ ImageWorker#render_copy_fence.); |
| 1091 | |
| 1092 | workcxx . . $ PrimusSwapchain#work..push_backcxx . . $ std/__cxx11/list#push_back(fe7a8a4d1eddb70).(stdcxx . . $ std/::movecxx . . $ std/move(e35c19a1ba7baa26).(workItem)); |
| 1093 | has_workcxx . . $ PrimusSwapchain#has_work..notify_allcxx . . $ std/condition_variable#notify_all(ced63f7c635d850d).(); |
| 1094 | } |
| 1095 | |
| 1096 | void PrimusSwapchaincxx . . $ PrimusSwapchain#::waitForReadycxx . . $ PrimusSwapchain#waitForReady(49f6e7a06ebc5aa8).() { |
| 1097 | stdcxx . . $ std/::unique_lockcxx . . $ std/unique_lock#<stdcxx . . $ std/::mutexcxx . . $ std/mutex#> lockcxx . . $ std/unique_lock#unique_lock(8e935d9c2e576e3a).(queueMutexcxx . . $ PrimusSwapchain#queueMutex.); |
| 1098 | has_workcxx . . $ PrimusSwapchain#has_work..waitcxx . . $ std/condition_variable#wait(a0ab87b4e01b5210).(lock, [this](){return workcxx . . $ PrimusSwapchain#work..sizecxx . . $ std/__cxx11/list#size(c9b1e749b64d5edc).() + in_progresscxx . . $ PrimusSwapchain#in_progress..sizecxx . . $ std/__cxx11/list#size(c9b1e749b64d5edc).() <= imagescxx . . $ PrimusSwapchain#images..sizecxx . . $ std/vector#size(c9b1e749b64d5edc).() - surfaceCapabilitiescxx . . $ PrimusSwapchain#surfaceCapabilities..minImageCount;}); |
| 1099 | } |
| 1100 | |
| 1101 | void PrimusSwapchaincxx . . $ PrimusSwapchain#::stopcxx . . $ PrimusSwapchain#stop(49f6e7a06ebc5aa8).(){ |
| 1102 | { |
| 1103 | stdcxx . . $ std/::unique_lockcxx . . $ std/unique_lock#<stdcxx . . $ std/::mutexcxx . . $ std/mutex#> lockcxx . . $ std/unique_lock#unique_lock(8e935d9c2e576e3a).(queueMutexcxx . . $ PrimusSwapchain#queueMutex.); |
| 1104 | activecxx . . $ PrimusSwapchain#active. = false; |
| 1105 | has_workcxx . . $ PrimusSwapchain#has_work..notify_allcxx . . $ std/condition_variable#notify_all(ced63f7c635d850d).(); |
| 1106 | } |
| 1107 | for(auto &thread: threadscxx . . $ PrimusSwapchain#threads.){ |
| 1108 | thread->cxx . . $ std/unique_ptr#`operator->`(ea7391e9eeeaf20e).joincxx . . $ std/thread#join(49f6e7a06ebc5aa8).(); |
| 1109 | thread.resetcxx . . $ std/unique_ptr#reset(c8c3025d73122d7d).(); |
| 1110 | } |
| 1111 | } |
| 1112 | void PrimusSwapchaincxx . . $ PrimusSwapchain#::presentcxx . . $ PrimusSwapchain#present(bebef18ee3c082a9).(const QueueItemcxx . . $ PrimusSwapchain#QueueItem# &workItem){ |
| 1113 | const auto index = workItem.imgIndexcxx . . $ PrimusSwapchain#QueueItem#imgIndex.; |
| 1114 | imagescxx . . $ PrimusSwapchain#images.[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).index].render_copy_fencecxx . . $ ImageWorker#render_copy_fence..awaitcxx . . $ Fence#await(49f6e7a06ebc5aa8).(); |
| 1115 | imagescxx . . $ PrimusSwapchain#images.[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).index].render_copy_fencecxx . . $ ImageWorker#render_copy_fence..resetcxx . . $ Fence#reset(49f6e7a06ebc5aa8).(); |
| 1116 | imagescxx . . $ PrimusSwapchain#images.[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).index].copyImageDatacxx . . $ ImageWorker#copyImageData(813df1c2663f4e59).(index, {cxx . . $ std/vector#vector(9619226211e5a241).imagescxx . . $ PrimusSwapchain#images.[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).index].display_semaphorecxx . . $ ImageWorker#display_semaphore..semcxx . . $ Semaphore#sem.}); |
| 1117 | |
| 1118 | TRACE_PROFILING_EVENTcxx . . $ `primus_vk.cpp:60:9`!(index, "copy queued"); |
| 1119 | |
| 1120 | VkPresentInfoKHR p2 = {.sType=VK_STRUCTURE_TYPE_PRESENT_INFO_KHR}; |
| 1121 | p2.pSwapchains = &backendcxx . . $ PrimusSwapchain#backend.; |
| 1122 | p2.swapchainCount = 1; |
| 1123 | p2.pWaitSemaphores = &imagescxx . . $ PrimusSwapchain#images.[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).workItem.imgIndexcxx . . $ PrimusSwapchain#QueueItem#imgIndex.].display_semaphorecxx . . $ ImageWorker#display_semaphore..semcxx . . $ Semaphore#sem.; |
| 1124 | p2.waitSemaphoreCount = 1; |
| 1125 | p2.pImageIndices = &index; |
| 1126 | |
| 1127 | { |
| 1128 | stdcxx . . $ std/::unique_lockcxx . . $ std/unique_lock#<stdcxx . . $ std/::mutexcxx . . $ std/mutex#> lockcxx . . $ std/unique_lock#unique_lock(8e935d9c2e576e3a).(queueMutexcxx . . $ PrimusSwapchain#queueMutex.); |
| 1129 | has_workcxx . . $ PrimusSwapchain#has_work..waitcxx . . $ std/condition_variable#wait(a0ab87b4e01b5210).(lock, [this,&workItem](){return &workItem == &in_progresscxx . . $ PrimusSwapchain#in_progress..frontcxx . . $ std/__cxx11/list#front(d5f1ba0ed5a2655c).();}); |
| 1130 | TRACE_PROFILING_EVENTcxx . . $ `primus_vk.cpp:60:9`!(index, "submitting"); |
| 1131 | VkResult res = device_dispatchcxx . . $ device_dispatch.[cxx . . $ std/map#`operator[]`(bbd415b616967878).GetKeycxx . . $ GetKey(d29c9e52fbefad67).(display_devicecxx . . $ PrimusSwapchain#display_device.)].QueuePresentKHRcxx . . $ PvkDispatchTable#QueuePresentKHR.(display_queuecxx . . $ PrimusSwapchain#display_queue., &p2); |
| 1132 | if(suppress_suboptimalcxx . . $ PrimusSwapchain#suppress_suboptimal. && res == VK_SUBOPTIMAL_KHR){ |
| 1133 | res = VK_SUCCESS; |
| 1134 | } |
| 1135 | if(res != VK_SUCCESS && res != VK_SUBOPTIMAL_KHR) { |
| 1136 | TRACEcxx . . $ `primus_vk.cpp:57:9`!("ERROR, Queue Present failed: " << res << "\n"); |
| 1137 | } |
| 1138 | in_progresscxx . . $ PrimusSwapchain#in_progress..pop_frontcxx . . $ std/__cxx11/list#pop_front(ced63f7c635d850d).(); |
| 1139 | has_workcxx . . $ PrimusSwapchain#has_work..notify_allcxx . . $ std/condition_variable#notify_all(ced63f7c635d850d).(); |
| 1140 | } |
| 1141 | } |
| 1142 | void PrimusSwapchaincxx . . $ PrimusSwapchain#::runcxx . . $ PrimusSwapchain#run(49f6e7a06ebc5aa8).(){ |
| 1143 | while(true){ |
| 1144 | QueueItemcxx . . $ PrimusSwapchain#QueueItem# *workItem = nullptr; |
| 1145 | { |
| 1146 | stdcxx . . $ std/::unique_lockcxx . . $ std/unique_lock#<stdcxx . . $ std/::mutexcxx . . $ std/mutex#> lockcxx . . $ std/unique_lock#unique_lock(8e935d9c2e576e3a).(queueMutexcxx . . $ PrimusSwapchain#queueMutex.); |
| 1147 | has_workcxx . . $ PrimusSwapchain#has_work..waitcxx . . $ std/condition_variable#wait(a0ab87b4e01b5210).(lock, [this](){return !activecxx . . $ PrimusSwapchain#active. || workcxx . . $ PrimusSwapchain#work..sizecxx . . $ std/__cxx11/list#size(c9b1e749b64d5edc).() > 0;}); |
| 1148 | if(!activecxx . . $ PrimusSwapchain#active.) return; |
| 1149 | in_progresscxx . . $ PrimusSwapchain#in_progress..push_backcxx . . $ std/__cxx11/list#push_back(fe7a8a4d1eddb70).(stdcxx . . $ std/::movecxx . . $ std/move(e35c19a1ba7baa26).(workcxx . . $ PrimusSwapchain#work..frontcxx . . $ std/__cxx11/list#front(d5f1ba0ed5a2655c).())); |
| 1150 | workItem = &in_progresscxx . . $ PrimusSwapchain#in_progress..backcxx . . $ std/__cxx11/list#back(d5f1ba0ed5a2655c).(); |
| 1151 | workcxx . . $ PrimusSwapchain#work..pop_frontcxx . . $ std/__cxx11/list#pop_front(ced63f7c635d850d).(); |
| 1152 | } |
| 1153 | presentcxx . . $ PrimusSwapchain#present(bebef18ee3c082a9).(*workItem); |
| 1154 | } |
| 1155 | } |
| 1156 | |
| 1157 | VkResult VKAPI_CALLcxx . . $ `<external>/12100432684025345130/vk_platform.h:57:13`! PrimusVK_QueueSubmitcxx . . $ PrimusVK_QueueSubmit(6d1a85fc5477fe55).(VkQueue queue, uint32_t submitCount, |
| 1158 | const VkSubmitInfo* pSubmits, |
| 1159 | VkFence fence) { |
| 1160 | scoped_lockcxx . . $ scoped_lock# lockcxx . . $ std/lock_guard#lock_guard(8e935d9c2e576e3a).(*cxx . . $ std/__shared_ptr_access#`operator*`(d426bc7b625886b7).device_instance_infocxx . . $ device_instance_info.[cxx . . $ std/map#`operator[]`(bbd415b616967878).GetKeycxx . . $ GetKey(d29c9e52fbefad67).(queue)]->renderQueueMutexcxx . . $ InstanceInfo#renderQueueMutex.); |
| 1161 | return device_dispatchcxx . . $ device_dispatch.[cxx . . $ std/map#`operator[]`(bbd415b616967878).GetKeycxx . . $ GetKey(d29c9e52fbefad67).(queue)].QueueSubmitcxx . . $ PvkDispatchTable#QueueSubmit.(queue, submitCount, pSubmits, fence); |
| 1162 | } |
| 1163 | |
| 1164 | VkResult VKAPI_CALLcxx . . $ `<external>/12100432684025345130/vk_platform.h:57:13`! PrimusVK_QueuePresentKHRcxx . . $ PrimusVK_QueuePresentKHR(3f1be578d4d01ffd).(VkQueue queue, const VkPresentInfoKHR* pPresentInfo) { |
| 1165 | scoped_lockcxx . . $ scoped_lock# lockcxx . . $ std/lock_guard#lock_guard(8e935d9c2e576e3a).(*cxx . . $ std/__shared_ptr_access#`operator*`(d426bc7b625886b7).device_instance_infocxx . . $ device_instance_info.[cxx . . $ std/map#`operator[]`(bbd415b616967878).GetKeycxx . . $ GetKey(d29c9e52fbefad67).(queue)]->renderQueueMutexcxx . . $ InstanceInfo#renderQueueMutex.); |
| 1166 | auto start = stdcxx . . $ std/::chronocxx . . $ std/chrono/::steady_clockcxx . . $ std/chrono/_V2/steady_clock#::nowcxx . . $ std/chrono/_V2/steady_clock#now(edffc6b45db65c20).(); |
| 1167 | if(pPresentInfo->swapchainCount != 1){ |
| 1168 | TRACEcxx . . $ `primus_vk.cpp:57:9`!("Warning, presenting with multiple swapchains not implemented, ignoring"); |
| 1169 | } |
| 1170 | |
| 1171 | PrimusSwapchaincxx . . $ PrimusSwapchain# *ch = reinterpret_cast<PrimusSwapchaincxx . . $ PrimusSwapchain#*>(pPresentInfo->pSwapchains[0]); |
| 1172 | double secs = stdcxx . . $ std/::chronocxx . . $ std/chrono/::duration_castcxx . . $ std/chrono/duration_cast(b7f67bf9c2f19806).<stdcxx . . $ std/::chronocxx . . $ std/chrono/::durationcxx . . $ std/chrono/duration#<double>>(start -cxx . . $ std/chrono/operator-(37d29b8d7121dc12). ch->lastPresentcxx . . $ PrimusSwapchain#lastPresent.).countcxx . . $ std/chrono/duration#count(8f5363d873dd4781).(); |
| 1173 | TRACE_PROFILING_EVENTcxx . . $ `primus_vk.cpp:60:9`!(pPresentInfo->pImageIndices[0], "QueuePresent"); |
| 1174 | TRACE_PROFILINGcxx . . $ `primus_vk.cpp:58:9`!(" === Time between VkQueuePresents: " << secs << " -> " << 1/secs << " FPS"); |
| 1175 | if(ch->max_fpscxx . . $ PrimusSwapchain#max_fps. != 0) { |
| 1176 | const auto timeBetweenFrame = stdcxx . . $ std/::chronocxx . . $ std/chrono/::millisecondscxx . . $ std/chrono/milliseconds#(1000) /cxx . . $ std/chrono/`operator/`(9c3b53ef8d140c3a). ch->max_fpscxx . . $ PrimusSwapchain#max_fps.; |
| 1177 | const auto toSleep = ch->lastPresentcxx . . $ PrimusSwapchain#lastPresent. +cxx . . $ std/chrono/operator+(ddf880cf2436a4d3). timeBetweenFrame -cxx . . $ std/chrono/operator-(37d29b8d7121dc12). start; |
| 1178 | if(toSleep >cxx . . $ std/chrono/`operator>`(8e29d67f61fb35ca). stdcxx . . $ std/::chronocxx . . $ std/chrono/::secondscxx . . $ std/chrono/seconds#(0)){ |
| 1179 | stdcxx . . $ std/::this_threadcxx . . $ std/this_thread/::sleep_forcxx . . $ std/this_thread/sleep_for(fb2140da9187dddf).(toSleep); |
| 1180 | start =cxx . . $ std/chrono/time_point#`operator=`(8cf69a9a2c3bd270). stdcxx . . $ std/::chronocxx . . $ std/chrono/::steady_clockcxx . . $ std/chrono/_V2/steady_clock#::nowcxx . . $ std/chrono/_V2/steady_clock#now(edffc6b45db65c20).(); |
| 1181 | } |
| 1182 | ch->lastPresentcxx . . $ PrimusSwapchain#lastPresent. =cxx . . $ std/chrono/time_point#`operator=`(1e7cd61cdbf1dd6e). start; |
| 1183 | } |
| 1184 | |
| 1185 | ch->queuecxx . . $ PrimusSwapchain#queue(37781134286668e7).(queue, pPresentInfo); |
| 1186 | |
| 1187 | return VK_SUCCESS; |
| 1188 | } |
| 1189 | |
| 1190 | void VKAPI_CALLcxx . . $ `<external>/12100432684025345130/vk_platform.h:57:13`! PrimusVK_GetPhysicalDeviceQueueFamilyPropertiescxx . . $ PrimusVK_GetPhysicalDeviceQueueFamilyProperties(1a3e5e74accccb7e).(VkPhysicalDevice physicalDevice, uint32_t* pQueueFamilyPropertyCount, VkQueueFamilyProperties* pQueueFamilyProperties) { |
| 1191 | VkPhysicalDevice phy = physicalDevice; |
| 1192 | instance_dispatchcxx . . $ instance_dispatch.[cxx . . $ std/map#`operator[]`(bbd415b616967878).GetKeycxx . . $ GetKey(d29c9e52fbefad67).(phy)].GetPhysicalDeviceQueueFamilyPropertiescxx . . $ PvkInstanceDispatchTable#GetPhysicalDeviceQueueFamilyProperties.(phy, pQueueFamilyPropertyCount, pQueueFamilyProperties); |
| 1193 | } |
| 1194 | VkResult VKAPI_CALLcxx . . $ `<external>/12100432684025345130/vk_platform.h:57:13`! PrimusVK_GetPhysicalDeviceSurfaceSupportKHRcxx . . $ PrimusVK_GetPhysicalDeviceSurfaceSupportKHR(f6ee3c4049dd6ae5).( |
| 1195 | VkPhysicalDevice physicalDevice, |
| 1196 | uint32_t queueFamilyIndex, |
| 1197 | VkSurfaceKHR surface, |
| 1198 | VkBool32* pSupported) { |
| 1199 | auto &instance = instance_infocxx . . $ instance_info.[cxx . . $ std/map#`operator[]`(bbd415b616967878).GetKeycxx . . $ GetKey(d29c9e52fbefad67).(physicalDevice)]; |
| 1200 | VkPhysicalDevice phy = instance.displaycxx . . $ InstanceInfo#display.; |
| 1201 | return instance_dispatchcxx . . $ instance_dispatch.[cxx . . $ std/map#`operator[]`(bbd415b616967878).GetKeycxx . . $ GetKey(d29c9e52fbefad67).(phy)].GetPhysicalDeviceSurfaceSupportKHRcxx . . $ PvkInstanceDispatchTable#GetPhysicalDeviceSurfaceSupportKHR.(phy, instance.displayQueueFamilyIndexcxx . . $ InstanceInfo#displayQueueFamilyIndex., surface, pSupported); |
| 1202 | } |
| 1203 | #ifdef VK_USE_PLATFORM_XCB_KHRcxx . . $ `primus_vk.cpp:1:9`! |
| 1204 | VkBool32 VKAPI_CALLcxx . . $ `<external>/12100432684025345130/vk_platform.h:57:13`! PrimusVK_GetPhysicalDeviceXcbPresentationSupportKHRcxx . . $ PrimusVK_GetPhysicalDeviceXcbPresentationSupportKHR(238de9237ae34290).( |
| 1205 | VkPhysicalDevice physicalDevice, |
| 1206 | uint32_t queueFamilyIndex, |
| 1207 | xcb_connection_t* connection, |
| 1208 | xcb_visualid_t visual_id){ |
| 1209 | auto &instance = instance_infocxx . . $ instance_info.[cxx . . $ std/map#`operator[]`(bbd415b616967878).GetKeycxx . . $ GetKey(d29c9e52fbefad67).(physicalDevice)]; |
| 1210 | VkPhysicalDevice phy = instance.displaycxx . . $ InstanceInfo#display.; |
| 1211 | return instance_dispatchcxx . . $ instance_dispatch.[cxx . . $ std/map#`operator[]`(bbd415b616967878).GetKeycxx . . $ GetKey(d29c9e52fbefad67).(phy)].GetPhysicalDeviceXcbPresentationSupportKHRcxx . . $ PvkInstanceDispatchTable#GetPhysicalDeviceXcbPresentationSupportKHR.(phy, instance.displayQueueFamilyIndexcxx . . $ InstanceInfo#displayQueueFamilyIndex., connection, visual_id); |
| 1212 | } |
| 1213 | #endif |
| 1214 | #ifdef VK_USE_PLATFORM_XLIB_KHRcxx . . $ `primus_vk.cpp:2:9`! |
| 1215 | VkBool32 VKAPI_CALLcxx . . $ `<external>/12100432684025345130/vk_platform.h:57:13`! PrimusVK_GetPhysicalDeviceXlibPresentationSupportKHRcxx . . $ PrimusVK_GetPhysicalDeviceXlibPresentationSupportKHR(7a8dfe801ea23746).( |
| 1216 | VkPhysicalDevice physicalDevice, |
| 1217 | uint32_t queueFamilyIndex, |
| 1218 | Displaycxx . . $ Display#* dpy, |
| 1219 | VisualIDcxx . . $ VisualID# visualID){ |
| 1220 | auto &instance = instance_infocxx . . $ instance_info.[cxx . . $ std/map#`operator[]`(bbd415b616967878).GetKeycxx . . $ GetKey(d29c9e52fbefad67).(physicalDevice)]; |
| 1221 | VkPhysicalDevice phy = instance.displaycxx . . $ InstanceInfo#display.; |
| 1222 | return instance_dispatchcxx . . $ instance_dispatch.[cxx . . $ std/map#`operator[]`(bbd415b616967878).GetKeycxx . . $ GetKey(d29c9e52fbefad67).(phy)].GetPhysicalDeviceXlibPresentationSupportKHRcxx . . $ PvkInstanceDispatchTable#GetPhysicalDeviceXlibPresentationSupportKHR.(phy, instance.displayQueueFamilyIndexcxx . . $ InstanceInfo#displayQueueFamilyIndex., dpy, visualID); |
| 1223 | } |
| 1224 | #endif |
| 1225 | #ifdef VK_USE_PLATFORM_WAYLAND_KHRcxx . . $ `primus_vk.cpp:3:9`! |
| 1226 | VkBool32 VKAPI_CALLcxx . . $ `<external>/12100432684025345130/vk_platform.h:57:13`! PrimusVK_GetPhysicalDeviceWaylandPresentationSupportKHRcxx . . $ PrimusVK_GetPhysicalDeviceWaylandPresentationSupportKHR(1a48549e4d09a1ae).( |
| 1227 | VkPhysicalDevice physicalDevice, |
| 1228 | uint32_t queueFamilyIndex, |
| 1229 | struct wl_displaycxx . . $ wl_display#* display){ |
| 1230 | auto &instance = instance_infocxx . . $ instance_info.[cxx . . $ std/map#`operator[]`(bbd415b616967878).GetKeycxx . . $ GetKey(d29c9e52fbefad67).(physicalDevice)]; |
| 1231 | VkPhysicalDevice phy = instance.displaycxx . . $ InstanceInfo#display.; |
| 1232 | return instance_dispatchcxx . . $ instance_dispatch.[cxx . . $ std/map#`operator[]`(bbd415b616967878).GetKeycxx . . $ GetKey(d29c9e52fbefad67).(phy)].GetPhysicalDeviceWaylandPresentationSupportKHRcxx . . $ PvkInstanceDispatchTable#GetPhysicalDeviceWaylandPresentationSupportKHR.(phy, instance.displayQueueFamilyIndexcxx . . $ InstanceInfo#displayQueueFamilyIndex., display); |
| 1233 | } |
| 1234 | #endif |
| 1235 | |
| 1236 | void VKAPI_CALLcxx . . $ `<external>/12100432684025345130/vk_platform.h:57:13`! PrimusVK_QueueWaitIdlecxx . . $ PrimusVK_QueueWaitIdle(51c7cc4239ba79e7).(VkQueue queue){ |
| 1237 | scoped_lockcxx . . $ scoped_lock# lockcxx . . $ std/lock_guard#lock_guard(8e935d9c2e576e3a).(*cxx . . $ std/__shared_ptr_access#`operator*`(d426bc7b625886b7).device_instance_infocxx . . $ device_instance_info.[cxx . . $ std/map#`operator[]`(bbd415b616967878).GetKeycxx . . $ GetKey(d29c9e52fbefad67).(queue)]->renderQueueMutexcxx . . $ InstanceInfo#renderQueueMutex.); |
| 1238 | device_dispatchcxx . . $ device_dispatch.[cxx . . $ std/map#`operator[]`(bbd415b616967878).GetKeycxx . . $ GetKey(d29c9e52fbefad67).(queue)].QueueWaitIdlecxx . . $ PvkDispatchTable#QueueWaitIdle.(queue); |
| 1239 | } |
| 1240 | |
| 1241 | void VKAPI_CALLcxx . . $ `<external>/12100432684025345130/vk_platform.h:57:13`! PrimusVK_DeviceWaitIdlecxx . . $ PrimusVK_DeviceWaitIdle(4612340e2b8d4e51).(VkDevice device){ |
| 1242 | auto &my_instance = *device_instance_infocxx . . $ device_instance_info.[cxx . . $ std/map#`operator[]`(bbd415b616967878).GetKeycxx . . $ GetKey(d29c9e52fbefad67).(device)]; |
| 1243 | device_dispatchcxx . . $ device_dispatch.[cxx . . $ std/map#`operator[]`(bbd415b616967878).GetKeycxx . . $ GetKey(d29c9e52fbefad67).(device)].DeviceWaitIdlecxx . . $ PvkDispatchTable#DeviceWaitIdle.(device); |
| 1244 | auto display_gpu = my_instance.codcxx . . $ InstanceInfo#cod.[cxx . . $ std/map#`operator[]`(bbd415b616967878).GetKeycxx . . $ GetKey(d29c9e52fbefad67).(device)]->cxx . . $ std/__shared_ptr_access#`operator->`(34d6acfd341ba7ab).display_gpucxx . . $ CreateOtherDevice#display_gpu.; |
| 1245 | device_dispatchcxx . . $ device_dispatch.[cxx . . $ std/map#`operator[]`(bbd415b616967878).GetKeycxx . . $ GetKey(d29c9e52fbefad67).(display_gpu)].DeviceWaitIdlecxx . . $ PvkDispatchTable#DeviceWaitIdle.(display_gpu); |
| 1246 | } |
| 1247 | |
| 1248 | #include "primus_vk_forwarding_prototypes.h"cxx . . $ `<file>/primus_vk_forwarding_prototypes.h`/ |
| 1249 | |
| 1250 | /////////////////////////////////////////////////////////////////////////////////////////// |
| 1251 | // Enumeration function |
| 1252 | |
| 1253 | VkResult VKAPI_CALLcxx . . $ `<external>/12100432684025345130/vk_platform.h:57:13`! PrimusVK_EnumerateInstanceLayerPropertiescxx . . $ PrimusVK_EnumerateInstanceLayerProperties(3d615f32ed5c97c).(uint32_t *pPropertyCount, |
| 1254 | VkLayerProperties *pProperties) |
| 1255 | { |
| 1256 | if(pPropertyCount) *pPropertyCount = 1; |
| 1257 | |
| 1258 | if(pProperties) |
| 1259 | { |
| 1260 | strcpy(pProperties->layerName, "VK_LAYER_PRIMUS_PrimusVK"); |
| 1261 | strcpy(pProperties->description, "Primus-vk - https://github.com/felixdoerre/primus_vk"); |
| 1262 | pProperties->implementationVersion = 1; |
| 1263 | pProperties->specVersion = VK_API_VERSION_1_0cxx . . $ `<external>/13734482859137699468/vulkan_core.h:92:9`!; |
| 1264 | } |
| 1265 | |
| 1266 | return VK_SUCCESS; |
| 1267 | } |
| 1268 | |
| 1269 | VkResult VKAPI_CALLcxx . . $ `<external>/12100432684025345130/vk_platform.h:57:13`! PrimusVK_EnumerateDeviceLayerPropertiescxx . . $ PrimusVK_EnumerateDeviceLayerProperties(d88486ee48901e96).( |
| 1270 | VkPhysicalDevice physicalDevice, uint32_t *pPropertyCount, VkLayerProperties *pProperties) |
| 1271 | { |
| 1272 | return PrimusVK_EnumerateInstanceLayerPropertiescxx . . $ PrimusVK_EnumerateInstanceLayerProperties(3d615f32ed5c97c).(pPropertyCount, pProperties); |
| 1273 | } |
| 1274 | |
| 1275 | VkResult VKAPI_CALLcxx . . $ `<external>/12100432684025345130/vk_platform.h:57:13`! PrimusVK_EnumerateInstanceExtensionPropertiescxx . . $ PrimusVK_EnumerateInstanceExtensionProperties(27001f34b46d2a6d).( |
| 1276 | const char *pLayerName, uint32_t *pPropertyCount, VkExtensionProperties *pProperties) |
| 1277 | { |
| 1278 | if(pLayerName == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`! || strcmp(pLayerName, "VK_LAYER_PRIMUS_PrimusVK")) |
| 1279 | return VK_ERROR_LAYER_NOT_PRESENT; |
| 1280 | |
| 1281 | // don't expose any extensions |
| 1282 | if(pPropertyCount) *pPropertyCount = 0; |
| 1283 | return VK_SUCCESS; |
| 1284 | } |
| 1285 | |
| 1286 | VkResult VKAPI_CALLcxx . . $ `<external>/12100432684025345130/vk_platform.h:57:13`! PrimusVK_EnumerateDeviceExtensionPropertiescxx . . $ PrimusVK_EnumerateDeviceExtensionProperties(e0918f97db37b227).( |
| 1287 | VkPhysicalDevice physicalDevice, const char *pLayerName, |
| 1288 | uint32_t *pPropertyCount, VkExtensionProperties *pProperties) |
| 1289 | { |
| 1290 | // pass through any queries that aren't to us |
| 1291 | if(pLayerName == NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`! || strcmp(pLayerName, "VK_LAYER_PRIMUS_PrimusVK")) |
| 1292 | { |
| 1293 | if(physicalDevice == VK_NULL_HANDLEcxx . . $ `<external>/13734482859137699468/vulkan_core.h:41:21`!) { |
| 1294 | *pPropertyCount = 0; |
| 1295 | return VK_SUCCESS; |
| 1296 | } |
| 1297 | |
| 1298 | scoped_lockcxx . . $ scoped_lock# lcxx . . $ std/lock_guard#lock_guard(8e935d9c2e576e3a).(global_lockcxx . . $ global_lock.); |
| 1299 | return instance_dispatchcxx . . $ instance_dispatch.[cxx . . $ std/map#`operator[]`(bbd415b616967878).GetKeycxx . . $ GetKey(d29c9e52fbefad67).(physicalDevice)].EnumerateDeviceExtensionPropertiescxx . . $ PvkInstanceDispatchTable#EnumerateDeviceExtensionProperties.(physicalDevice, pLayerName, pPropertyCount, pProperties); |
| 1300 | } |
| 1301 | |
| 1302 | // don't expose any extensions |
| 1303 | if(pPropertyCount) *pPropertyCount = 0; |
| 1304 | return VK_SUCCESS; |
| 1305 | } |
| 1306 | |
| 1307 | VkResult VKAPI_CALLcxx . . $ `<external>/12100432684025345130/vk_platform.h:57:13`! PrimusVK_EnumeratePhysicalDevicescxx . . $ PrimusVK_EnumeratePhysicalDevices(175e58b8545e73ae).( |
| 1308 | VkInstance instance, |
| 1309 | uint32_t* pPhysicalDeviceCount, |
| 1310 | VkPhysicalDevice* pPhysicalDevices){ |
| 1311 | const int cnt = 1; |
| 1312 | scoped_lockcxx . . $ scoped_lock# lcxx . . $ std/lock_guard#lock_guard(8e935d9c2e576e3a).(global_lockcxx . . $ global_lock.); |
| 1313 | InstanceInfocxx . . $ InstanceInfo# &info = instance_infocxx . . $ instance_info.[cxx . . $ std/map#`operator[]`(bbd415b616967878).GetKeycxx . . $ GetKey(d29c9e52fbefad67).(instance)]; |
| 1314 | if(info.rendercxx . . $ InstanceInfo#render. == VK_NULL_HANDLEcxx . . $ `<external>/13734482859137699468/vulkan_core.h:41:21`!){ |
| 1315 | auto res = info.searchDevicescxx . . $ InstanceInfo#searchDevices(b9e637a8c2cacc95).(instance_dispatchcxx . . $ instance_dispatch.[cxx . . $ std/map#`operator[]`(bbd415b616967878).GetKeycxx . . $ GetKey(d29c9e52fbefad67).(instance)]); |
| 1316 | if(res != VK_SUCCESS) return res; |
| 1317 | } |
| 1318 | if(pPhysicalDevices == nullptr){ |
| 1319 | *pPhysicalDeviceCount = cnt; |
| 1320 | return VK_SUCCESS; |
| 1321 | } |
| 1322 | pPhysicalDevices[0] = info.rendercxx . . $ InstanceInfo#render.; |
| 1323 | *pPhysicalDeviceCount = cnt; |
| 1324 | return VK_SUCCESS; |
| 1325 | } |
| 1326 | VkResult VKAPI_CALLcxx . . $ `<external>/12100432684025345130/vk_platform.h:57:13`! PrimusVK_EnumeratePhysicalDeviceGroupscxx . . $ PrimusVK_EnumeratePhysicalDeviceGroups(18e92e16fc1d2cbb).( |
| 1327 | VkInstance instance, |
| 1328 | uint32_t* pPhysicalDeviceGroupCount, |
| 1329 | VkPhysicalDeviceGroupProperties* pPhysicalDeviceGroupProperties) { |
| 1330 | InstanceInfocxx . . $ InstanceInfo# &info = instance_infocxx . . $ instance_info.[cxx . . $ std/map#`operator[]`(bbd415b616967878).GetKeycxx . . $ GetKey(d29c9e52fbefad67).(instance)]; |
| 1331 | *pPhysicalDeviceGroupCount = 1; |
| 1332 | if(pPhysicalDeviceGroupProperties){ |
| 1333 | pPhysicalDeviceGroupProperties[0].sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GROUP_PROPERTIES; |
| 1334 | pPhysicalDeviceGroupProperties[0].pNext = nullptr; |
| 1335 | pPhysicalDeviceGroupProperties[0].physicalDeviceCount = 1; |
| 1336 | pPhysicalDeviceGroupProperties[0].physicalDevices[0] = info.rendercxx . . $ InstanceInfo#render.; |
| 1337 | pPhysicalDeviceGroupProperties[0].subsetAllocation = VK_FALSEcxx . . $ `<external>/13734482859137699468/vulkan_core.h:124:9`!; |
| 1338 | } |
| 1339 | return VK_SUCCESS; |
| 1340 | } |
| 1341 | VkResult VKAPI_CALLcxx . . $ `<external>/12100432684025345130/vk_platform.h:57:13`! PrimusVK_EnumeratePhysicalDeviceGroupsKHRcxx . . $ PrimusVK_EnumeratePhysicalDeviceGroupsKHR(18e92e16fc1d2cbb).( |
| 1342 | VkInstance instance, |
| 1343 | uint32_t* pPhysicalDeviceGroupCount, |
| 1344 | VkPhysicalDeviceGroupProperties* pPhysicalDeviceGroupProperties) { |
| 1345 | return PrimusVK_EnumeratePhysicalDeviceGroupscxx . . $ PrimusVK_EnumeratePhysicalDeviceGroups(18e92e16fc1d2cbb).(instance, pPhysicalDeviceGroupCount, pPhysicalDeviceGroupProperties); |
| 1346 | } |
| 1347 | |
| 1348 | VkResult VKAPI_CALLcxx . . $ `<external>/12100432684025345130/vk_platform.h:57:13`! PrimusVK_GetRandROutputDisplayEXTcxx . . $ PrimusVK_GetRandROutputDisplayEXT(f5811eb1d42acf9b).( |
| 1349 | VkPhysicalDevice physicalDevice, |
| 1350 | Displaycxx . . $ Display#* dpy, |
| 1351 | RROutput rrOutput, |
| 1352 | VkDisplayKHR* pDisplay){ |
| 1353 | TRACEcxx . . $ `primus_vk.cpp:57:9`!("Suppressing GetRandROutputDisplay"); |
| 1354 | *pDisplay = VK_NULL_HANDLEcxx . . $ `<external>/13734482859137699468/vulkan_core.h:41:21`!; |
| 1355 | return VK_SUCCESS; |
| 1356 | } |
| 1357 | |
| 1358 | /////////////////////////////////////////////////////////////////////////////////////////// |
| 1359 | // GetProcAddr functions, entry points of the layer |
| 1360 | |
| 1361 | #define GETPROCADDRcxx . . $ `primus_vk.cpp:1361:9`!(func) if(!strcmp(pName, "vk" #func)) return (PFN_vkVoidFunction)&PrimusVK_##func; |
| 1362 | |
| 1363 | VK_LAYER_EXPORTcxx . . $ `primus_vk.cpp:40:9`! PFN_vkVoidFunction VKAPI_CALLcxx . . $ `<external>/12100432684025345130/vk_platform.h:57:13`! PrimusVK_GetDeviceProcAddr(VkDevice device, const char *pName) |
| 1364 | { |
| 1365 | // device chain functions we intercept |
| 1366 | GETPROCADDRcxx . . $ `primus_vk.cpp:1361:9`!(GetDeviceProcAddr); |
| 1367 | GETPROCADDRcxx . . $ `primus_vk.cpp:1361:9`!(EnumerateDeviceLayerProperties); |
| 1368 | GETPROCADDRcxx . . $ `primus_vk.cpp:1361:9`!(EnumerateDeviceExtensionProperties); |
| 1369 | GETPROCADDRcxx . . $ `primus_vk.cpp:1361:9`!(CreateDevice); |
| 1370 | GETPROCADDRcxx . . $ `primus_vk.cpp:1361:9`!(DestroyDevice); |
| 1371 | |
| 1372 | GETPROCADDRcxx . . $ `primus_vk.cpp:1361:9`!(CreateSwapchainKHR); |
| 1373 | GETPROCADDRcxx . . $ `primus_vk.cpp:1361:9`!(DestroySwapchainKHR); |
| 1374 | GETPROCADDRcxx . . $ `primus_vk.cpp:1361:9`!(GetSwapchainImagesKHR); |
| 1375 | GETPROCADDRcxx . . $ `primus_vk.cpp:1361:9`!(AcquireNextImageKHR); |
| 1376 | GETPROCADDRcxx . . $ `primus_vk.cpp:1361:9`!(AcquireNextImage2KHR); |
| 1377 | GETPROCADDRcxx . . $ `primus_vk.cpp:1361:9`!(GetSwapchainStatusKHR); |
| 1378 | GETPROCADDRcxx . . $ `primus_vk.cpp:1361:9`!(QueuePresentKHR); |
| 1379 | |
| 1380 | GETPROCADDRcxx . . $ `primus_vk.cpp:1361:9`!(QueueSubmit); |
| 1381 | GETPROCADDRcxx . . $ `primus_vk.cpp:1361:9`!(DeviceWaitIdle); |
| 1382 | GETPROCADDRcxx . . $ `primus_vk.cpp:1361:9`!(QueueWaitIdle); |
| 1383 | GETPROCADDRcxx . . $ `primus_vk.cpp:1361:9`!(GetRandROutputDisplayEXT); |
| 1384 | #define FORWARDcxx . . $ `primus_vk.cpp:1384:9`!(func) GETPROCADDRcxx . . $ `primus_vk.cpp:1361:9`!(func) |
| 1385 | FORWARDcxx . . $ `primus_vk.cpp:1384:9`!(GetPhysicalDeviceSurfaceSupportKHR); |
| 1386 | #include "primus_vk_forwarding.h"cxx . . $ `<file>/primus_vk_forwarding.h`/ |
| 1387 | #undef FORWARDcxx . . $ `primus_vk.cpp:1384:9`! |
| 1388 | { |
| 1389 | scoped_lockcxx . . $ scoped_lock# lcxx . . $ std/lock_guard#lock_guard(8e935d9c2e576e3a).(global_lockcxx . . $ global_lock.); |
| 1390 | return device_dispatchcxx . . $ device_dispatch.[cxx . . $ std/map#`operator[]`(bbd415b616967878).GetKeycxx . . $ GetKey(d29c9e52fbefad67).(device)].GetDeviceProcAddrcxx . . $ PvkDispatchTable#GetDeviceProcAddr.(device, pName); |
| 1391 | } |
| 1392 | } |
| 1393 | |
| 1394 | VK_LAYER_EXPORTcxx . . $ `primus_vk.cpp:40:9`! PFN_vkVoidFunction VKAPI_CALLcxx . . $ `<external>/12100432684025345130/vk_platform.h:57:13`! PrimusVK_GetInstanceProcAddr(VkInstance instance, const char *pName) |
| 1395 | { |
| 1396 | // instance chain functions we intercept |
| 1397 | GETPROCADDRcxx . . $ `primus_vk.cpp:1361:9`!(GetInstanceProcAddr); |
| 1398 | GETPROCADDRcxx . . $ `primus_vk.cpp:1361:9`!(EnumeratePhysicalDevices); |
| 1399 | GETPROCADDRcxx . . $ `primus_vk.cpp:1361:9`!(EnumeratePhysicalDeviceGroups); |
| 1400 | GETPROCADDRcxx . . $ `primus_vk.cpp:1361:9`!(EnumeratePhysicalDeviceGroupsKHR); |
| 1401 | GETPROCADDRcxx . . $ `primus_vk.cpp:1361:9`!(EnumerateInstanceLayerProperties); |
| 1402 | GETPROCADDRcxx . . $ `primus_vk.cpp:1361:9`!(EnumerateInstanceExtensionProperties); |
| 1403 | GETPROCADDRcxx . . $ `primus_vk.cpp:1361:9`!(CreateInstance); |
| 1404 | GETPROCADDRcxx . . $ `primus_vk.cpp:1361:9`!(DestroyInstance); |
| 1405 | |
| 1406 | // device chain functions we intercept |
| 1407 | GETPROCADDRcxx . . $ `primus_vk.cpp:1361:9`!(GetDeviceProcAddr); |
| 1408 | GETPROCADDRcxx . . $ `primus_vk.cpp:1361:9`!(EnumerateDeviceLayerProperties); |
| 1409 | GETPROCADDRcxx . . $ `primus_vk.cpp:1361:9`!(EnumerateDeviceExtensionProperties); |
| 1410 | GETPROCADDRcxx . . $ `primus_vk.cpp:1361:9`!(CreateDevice); |
| 1411 | GETPROCADDRcxx . . $ `primus_vk.cpp:1361:9`!(DestroyDevice); |
| 1412 | |
| 1413 | GETPROCADDRcxx . . $ `primus_vk.cpp:1361:9`!(CreateSwapchainKHR); |
| 1414 | GETPROCADDRcxx . . $ `primus_vk.cpp:1361:9`!(DestroySwapchainKHR); |
| 1415 | GETPROCADDRcxx . . $ `primus_vk.cpp:1361:9`!(GetSwapchainImagesKHR); |
| 1416 | GETPROCADDRcxx . . $ `primus_vk.cpp:1361:9`!(AcquireNextImageKHR); |
| 1417 | GETPROCADDRcxx . . $ `primus_vk.cpp:1361:9`!(AcquireNextImage2KHR); |
| 1418 | GETPROCADDRcxx . . $ `primus_vk.cpp:1361:9`!(GetSwapchainStatusKHR); |
| 1419 | GETPROCADDRcxx . . $ `primus_vk.cpp:1361:9`!(QueuePresentKHR); |
| 1420 | |
| 1421 | GETPROCADDRcxx . . $ `primus_vk.cpp:1361:9`!(QueueSubmit); |
| 1422 | GETPROCADDRcxx . . $ `primus_vk.cpp:1361:9`!(DeviceWaitIdle); |
| 1423 | GETPROCADDRcxx . . $ `primus_vk.cpp:1361:9`!(QueueWaitIdle); |
| 1424 | GETPROCADDRcxx . . $ `primus_vk.cpp:1361:9`!(GetRandROutputDisplayEXT); |
| 1425 | GETPROCADDRcxx . . $ `primus_vk.cpp:1361:9`!(GetPhysicalDeviceQueueFamilyProperties); |
| 1426 | #ifdef VK_USE_PLATFORM_XCB_KHRcxx . . $ `primus_vk.cpp:1:9`! |
| 1427 | GETPROCADDRcxx . . $ `primus_vk.cpp:1361:9`!(GetPhysicalDeviceXcbPresentationSupportKHR); |
| 1428 | #endif |
| 1429 | #ifdef VK_USE_PLATFORM_XLIB_KHRcxx . . $ `primus_vk.cpp:2:9`! |
| 1430 | GETPROCADDRcxx . . $ `primus_vk.cpp:1361:9`!(GetPhysicalDeviceXlibPresentationSupportKHR); |
| 1431 | #endif |
| 1432 | #ifdef VK_USE_PLATFORM_WAYLAND_KHRcxx . . $ `primus_vk.cpp:3:9`! |
| 1433 | GETPROCADDRcxx . . $ `primus_vk.cpp:1361:9`!(GetPhysicalDeviceWaylandPresentationSupportKHR); |
| 1434 | #endif |
| 1435 | #define FORWARDcxx . . $ `primus_vk.cpp:1435:9`!(func) GETPROCADDRcxx . . $ `primus_vk.cpp:1361:9`!(func) |
| 1436 | FORWARDcxx . . $ `primus_vk.cpp:1435:9`!(GetPhysicalDeviceSurfaceSupportKHR); |
| 1437 | #include "primus_vk_forwarding.h"cxx . . $ `<file>/primus_vk_forwarding.h`/ |
| 1438 | #undef FORWARDcxx . . $ `primus_vk.cpp:1435:9`! |
| 1439 | { |
| 1440 | scoped_lockcxx . . $ scoped_lock# lcxx . . $ std/lock_guard#lock_guard(8e935d9c2e576e3a).(global_lockcxx . . $ global_lock.); |
| 1441 | return instance_dispatchcxx . . $ instance_dispatch.[cxx . . $ std/map#`operator[]`(bbd415b616967878).GetKeycxx . . $ GetKey(d29c9e52fbefad67).(instance)].GetInstanceProcAddrcxx . . $ PvkInstanceDispatchTable#GetInstanceProcAddr.(instance, pName); |
| 1442 | } |
| 1443 | } |