diff --git a/renderdoc/driver/vulkan/vk_common.cpp b/renderdoc/driver/vulkan/vk_common.cpp index 8041e4000..a5eb99db9 100644 --- a/renderdoc/driver/vulkan/vk_common.cpp +++ b/renderdoc/driver/vulkan/vk_common.cpp @@ -865,11 +865,29 @@ rdcstr HumanDriverName(VkDriverId driverId) { switch(driverId) { - case VK_DRIVER_ID_AMD_PROPRIETARY: return "AMD Propriertary"; + case VK_DRIVER_ID_AMD_PROPRIETARY: return "AMD Proprietary"; case VK_DRIVER_ID_AMD_OPEN_SOURCE: return "AMD Open-source"; case VK_DRIVER_ID_MESA_RADV: return "AMD RADV"; - case VK_DRIVER_ID_INTEL_PROPRIETARY_WINDOWS: return "Intel Propriertary"; + case VK_DRIVER_ID_NVIDIA_PROPRIETARY: return "NVIDIA Proprietary"; + case VK_DRIVER_ID_INTEL_PROPRIETARY_WINDOWS: return "Intel Proprietary"; case VK_DRIVER_ID_INTEL_OPEN_SOURCE_MESA: return "Intel Open-source"; + case VK_DRIVER_ID_IMAGINATION_PROPRIETARY: return "NVIDIA Proprietary"; + case VK_DRIVER_ID_QUALCOMM_PROPRIETARY: return "NVIDIA Proprietary"; + case VK_DRIVER_ID_ARM_PROPRIETARY: return "NVIDIA Proprietary"; + case VK_DRIVER_ID_GOOGLE_SWIFTSHADER: return "Swiftshader"; + case VK_DRIVER_ID_GGP_PROPRIETARY: return "GGP Proprietary"; + case VK_DRIVER_ID_BROADCOM_PROPRIETARY: return "Broadcom Proprietary"; + case VK_DRIVER_ID_MESA_LLVMPIPE: return "Mesa LLVMPipe"; + case VK_DRIVER_ID_MOLTENVK: return "MoltenVK"; + case VK_DRIVER_ID_COREAVI_PROPRIETARY: return "Coreavi Proprietary"; + case VK_DRIVER_ID_JUICE_PROPRIETARY: return "Juice Proprietary"; + case VK_DRIVER_ID_VERISILICON_PROPRIETARY: return "Verisilicon Proprietary"; + case VK_DRIVER_ID_MESA_TURNIP: return "Mesa Turnip"; + case VK_DRIVER_ID_MESA_V3DV: return "Mesa V3DV"; + case VK_DRIVER_ID_MESA_PANVK: return "Mesa Panvk"; + case VK_DRIVER_ID_SAMSUNG_PROPRIETARY: return "Samsung Proprietary"; + case VK_DRIVER_ID_MESA_VENUS: return "Mesa Venus"; + case VK_DRIVER_ID_MESA_DOZEN: return "Mesa Dozen"; default: break; } @@ -895,7 +913,40 @@ void DoSerialise(SerialiserType &ser, VkInitParams &el) INSTANTIATE_SERIALISE_TYPE(VkInitParams); -VkDriverInfo::VkDriverInfo(const VkPhysicalDeviceProperties &physProps, bool active) +void GetPhysicalDeviceDriverProperties(VkInstDispatchTable *instDispatchTable, + VkPhysicalDevice unwrappedPhysicalDevice, + VkPhysicalDeviceDriverProperties &driverProps) +{ + uint32_t count = 0; + instDispatchTable->EnumerateDeviceExtensionProperties(unwrappedPhysicalDevice, NULL, &count, NULL); + + VkExtensionProperties *props = new VkExtensionProperties[count]; + instDispatchTable->EnumerateDeviceExtensionProperties(unwrappedPhysicalDevice, NULL, &count, props); + + RDCEraseEl(driverProps); + driverProps.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES; + + for(uint32_t e = 0; e < count; e++) + { + // GPDP2 must be available if the driver properties extension is, and we always enable it if + // available, so we can unconditionally query here + if(!strcmp(props[e].extensionName, VK_KHR_DRIVER_PROPERTIES_EXTENSION_NAME)) + { + VkPhysicalDeviceProperties2 physProps2 = { + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2, + }; + + physProps2.pNext = &driverProps; + instDispatchTable->GetPhysicalDeviceProperties2(unwrappedPhysicalDevice, &physProps2); + break; + } + } + + SAFE_DELETE_ARRAY(props); +} + +VkDriverInfo::VkDriverInfo(const VkPhysicalDeviceProperties &physProps, + const VkPhysicalDeviceDriverProperties &origDriverProps, bool active) { m_Vendor = GPUVendorFromPCIVendor(physProps.vendorID); @@ -911,18 +962,63 @@ VkDriverInfo::VkDriverInfo(const VkPhysicalDeviceProperties &physProps, bool act if(physProps.vendorID == VK_VENDOR_ID_MESA) m_Vendor = GPUVendor::Software; - m_Major = VK_VERSION_MAJOR(physProps.driverVersion); - m_Minor = VK_VERSION_MINOR(physProps.driverVersion); - m_Patch = VK_VERSION_PATCH(physProps.driverVersion); + // take a copy so we can patch the driverID + VkPhysicalDeviceDriverProperties driverProps = origDriverProps; + switch(driverProps.driverID) + { + case VK_DRIVER_ID_GOOGLE_SWIFTSHADER: + case VK_DRIVER_ID_MESA_LLVMPIPE: m_Vendor = GPUVendor::Software; + case VK_DRIVER_ID_MOLTENVK: metalBackend = true; + default: break; + } + +// true by definition #if ENABLED(RDOC_APPLE) metalBackend = true; #endif - // nvidia uses its own version packing: + // guess driver by OS & vendor, if we don't have a driver ID. This is mostly for cases where only + // the proprietary driver exists + if(driverProps.driverID == 0) + { + RDCWARN("Estimating driver based on OS & vendor ID - may be inaccurate"); + switch(m_Vendor) + { +#if ENABLED(RDOC_WIN32) + case GPUVendor::AMD: + case GPUVendor::Samsung: driverProps.driverID = VK_DRIVER_ID_AMD_PROPRIETARY; break; +#elif ENABLED(RDOC_LINUX) + // this could be radv, but we expect radv to provide the driverID + case GPUVendor::AMD: + case GPUVendor::Samsung: driverProps.driverID = VK_DRIVER_ID_AMD_OPEN_SOURCE; break; +#endif + +#if ENABLED(RDOC_WIN32) + case GPUVendor::Intel: driverProps.driverID = VK_DRIVER_ID_INTEL_PROPRIETARY_WINDOWS; break; +#elif ENABLED(RDOC_LINUX) + case GPUVendor::Intel: driverProps.driverID = VK_DRIVER_ID_INTEL_OPEN_SOURCE_MESA; break; +#endif + + case GPUVendor::nVidia: driverProps.driverID = VK_DRIVER_ID_NVIDIA_PROPRIETARY; break; + case GPUVendor::Qualcomm: driverProps.driverID = VK_DRIVER_ID_QUALCOMM_PROPRIETARY; break; + case GPUVendor::ARM: driverProps.driverID = VK_DRIVER_ID_ARM_PROPRIETARY; break; + case GPUVendor::Imagination: + driverProps.driverID = VK_DRIVER_ID_IMAGINATION_PROPRIETARY; + break; + case GPUVendor::Broadcom: driverProps.driverID = VK_DRIVER_ID_BROADCOM_PROPRIETARY; break; + default: break; + } + } + + m_Major = VK_VERSION_MAJOR(physProps.driverVersion); + m_Minor = VK_VERSION_MINOR(physProps.driverVersion); + m_Patch = VK_VERSION_PATCH(physProps.driverVersion); + + // nvidia proprietary uses its own version packing: // 10 | 8 | 8 | 6 // major|minor|secondary_branch|tertiary_branch - if(m_Vendor == GPUVendor::nVidia) + if(driverProps.driverID == VK_DRIVER_ID_NVIDIA_PROPRIETARY) { m_Major = ((uint32_t)(physProps.driverVersion) >> (8 + 8 + 6)) & 0x3ff; m_Minor = ((uint32_t)(physProps.driverVersion) >> (8 + 6)) & 0x0ff; @@ -933,19 +1029,17 @@ VkDriverInfo::VkDriverInfo(const VkPhysicalDeviceProperties &physProps, bool act m_Patch = (secondary << 8) | tertiary; } -#if ENABLED(RDOC_WIN32) - // Ditto for Intel on windows + // Ditto for Intel proprietary // 18 | 14 // major|minor - if(m_Vendor == GPUVendor::Intel) + if(driverProps.driverID == VK_DRIVER_ID_INTEL_PROPRIETARY_WINDOWS) { m_Major = ((uint32_t)(physProps.driverVersion) >> 14) & 0x3fff; m_Minor = (uint32_t)(physProps.driverVersion) & 0x3fff; m_Patch = 0; } -#endif - if(m_Vendor == GPUVendor::nVidia) + if(driverProps.driverID == VK_DRIVER_ID_NVIDIA_PROPRIETARY) { // drivers before 372.54 did not handle a glslang bugfix about separated samplers, // and disabling texelFetch works as a workaround. @@ -958,11 +1052,8 @@ VkDriverInfo::VkDriverInfo(const VkPhysicalDeviceProperties &physProps, bool act } } -// only check this on windows. This is a bit of a hack, as really we want to check if we're -// using the AMD official driver, but there's not a great other way to distinguish it from -// the RADV open source driver. -#if ENABLED(RDOC_WIN32) - if(m_Vendor == GPUVendor::AMD || m_Vendor == GPUVendor::Samsung) + if(driverProps.driverID == VK_DRIVER_ID_AMD_PROPRIETARY || + driverProps.driverID == VK_DRIVER_ID_AMD_OPEN_SOURCE) { // for AMD the bugfix version isn't clear as version numbering wasn't strong for a while, but // any driver that reports a version of >= 1.0.0 is fine, as previous versions all reported @@ -1000,11 +1091,8 @@ VkDriverInfo::VkDriverInfo(const VkPhysicalDeviceProperties &physProps, bool act bdaBrokenDriver = true; } } -#endif -// Intel windows workarounds -#if ENABLED(RDOC_WIN32) - if(m_Vendor == GPUVendor::Intel) + if(driverProps.driverID == VK_DRIVER_ID_INTEL_PROPRIETARY_WINDOWS) { // buffer device address doesn't work well on older drivers, even using it internally we get // VK_ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS thrown when creating multiple buffers, even though we @@ -1024,9 +1112,8 @@ VkDriverInfo::VkDriverInfo(const VkPhysicalDeviceProperties &physProps, bool act // Only affects windows drivers, linux drivers are unaffected. intelBrokenOcclusionQueries = true; } -#endif - if(m_Vendor == GPUVendor::Qualcomm) + if(driverProps.driverID == VK_DRIVER_ID_QUALCOMM_PROPRIETARY) { if(active) RDCLOG("Enabling Qualcomm driver workarounds"); diff --git a/renderdoc/driver/vulkan/vk_common.h b/renderdoc/driver/vulkan/vk_common.h index 771fe288e..e83b6e285 100644 --- a/renderdoc/driver/vulkan/vk_common.h +++ b/renderdoc/driver/vulkan/vk_common.h @@ -235,6 +235,10 @@ struct GPUBuffer // in vk_.cpp extern void *LoadVulkanLibrary(); +void GetPhysicalDeviceDriverProperties(VkInstDispatchTable *instDispatchTable, + VkPhysicalDevice unwrappedPhysicalDevice, + VkPhysicalDeviceDriverProperties &driverProps); + class VkDriverInfo { public: @@ -242,7 +246,9 @@ public: uint32_t Major() const { return m_Major; } uint32_t Minor() const { return m_Minor; } uint32_t Patch() const { return m_Patch; } - VkDriverInfo(const VkPhysicalDeviceProperties &physProps, bool active = false); + VkDriverInfo(bool){}; + VkDriverInfo(const VkPhysicalDeviceProperties &physProps, + const VkPhysicalDeviceDriverProperties &driverProps, bool active = false); bool operator==(const VkDriverInfo &o) const { diff --git a/renderdoc/driver/vulkan/vk_core.h b/renderdoc/driver/vulkan/vk_core.h index 4fe1f7815..242f04d78 100644 --- a/renderdoc/driver/vulkan/vk_core.h +++ b/renderdoc/driver/vulkan/vk_core.h @@ -424,9 +424,10 @@ private: VkPhysicalDeviceFeatures availFeatures = {}; VkPhysicalDeviceFeatures enabledFeatures = {}; VkPhysicalDeviceProperties props = {}; + VkPhysicalDeviceDriverProperties driverProps = {}; VkPhysicalDeviceMemoryProperties memProps = {}; std::map fmtProps = {}; - VkDriverInfo driverInfo = VkDriverInfo(props); + VkDriverInfo driverInfo = VkDriverInfo(false); VkPhysicalDevicePerformanceQueryFeaturesKHR performanceQueryFeatures = {}; @@ -1227,7 +1228,7 @@ public: { return m_PhysicalDeviceData.performanceQueryFeatures; } - VkDriverInfo GetDriverInfo() { return m_PhysicalDeviceData.driverInfo; } + const VkDriverInfo &GetDriverInfo() const { return m_PhysicalDeviceData.driverInfo; } uint32_t FindCommandQueueFamily(ResourceId cmdId); void InsertCommandQueueFamily(ResourceId cmdId, uint32_t queueFamilyIndex); VkQueueFlags GetCommandType(ResourceId cmdId); diff --git a/renderdoc/driver/vulkan/vk_replay.cpp b/renderdoc/driver/vulkan/vk_replay.cpp index 38b153407..0e47503dc 100644 --- a/renderdoc/driver/vulkan/vk_replay.cpp +++ b/renderdoc/driver/vulkan/vk_replay.cpp @@ -132,34 +132,8 @@ rdcarray VulkanReplay::GetAvailableGPUs() VkPhysicalDeviceProperties props = {}; ObjDisp(instance)->GetPhysicalDeviceProperties(devices[p], &props); - VkPhysicalDeviceDriverProperties driverProps = { - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES, - }; - - VkPhysicalDeviceProperties2 physProps2 = { - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2, &driverProps, - }; - - // get driver properties if available - if(m_pDriver->GetExtensions(GetRecord(instance)).ext_KHR_get_physical_device_properties2) - { - uint32_t extCount = 0; - ObjDisp(instance)->EnumerateDeviceExtensionProperties(devices[p], NULL, &extCount, NULL); - - VkExtensionProperties *extProps = new VkExtensionProperties[extCount]; - ObjDisp(instance)->EnumerateDeviceExtensionProperties(devices[p], NULL, &extCount, extProps); - - for(uint32_t e = 0; e < extCount; e++) - { - if(!strcmp(extProps[e].extensionName, VK_KHR_DRIVER_PROPERTIES_EXTENSION_NAME)) - { - ObjDisp(instance)->GetPhysicalDeviceProperties2(devices[p], &physProps2); - break; - } - } - - SAFE_DELETE_ARRAY(extProps); - } + VkPhysicalDeviceDriverProperties driverProps = {}; + GetPhysicalDeviceDriverProperties(ObjDisp(instance), devices[p], driverProps); GPUDevice dev; dev.vendor = GPUVendorFromPCIVendor(props.vendorID); @@ -1018,15 +992,19 @@ void VulkanReplay::GetInitialDriverVersion() return; } - VkPhysicalDeviceProperties props; + VkPhysicalDeviceProperties props = {}; ObjDisp(inst)->GetPhysicalDeviceProperties(firstDevice, &props); - SetDriverInformation(props); + VkPhysicalDeviceDriverProperties driverProps = {}; + GetPhysicalDeviceDriverProperties(ObjDisp(inst), firstDevice, driverProps); + + SetDriverInformation(props, driverProps); } -void VulkanReplay::SetDriverInformation(const VkPhysicalDeviceProperties &props) +void VulkanReplay::SetDriverInformation(const VkPhysicalDeviceProperties &props, + const VkPhysicalDeviceDriverProperties &driverProps) { - VkDriverInfo info(props); + VkDriverInfo info(props, driverProps); m_DriverInfo.vendor = info.Vendor(); rdcstr versionString = StringFormat::Fmt("%s %u.%u.%u", props.deviceName, info.Major(), info.Minor(), info.Patch()); diff --git a/renderdoc/driver/vulkan/vk_replay.h b/renderdoc/driver/vulkan/vk_replay.h index 483f6b819..ab768e193 100644 --- a/renderdoc/driver/vulkan/vk_replay.h +++ b/renderdoc/driver/vulkan/vk_replay.h @@ -441,7 +441,8 @@ public: rdcarray &otherJSONs); static void InstallVulkanLayer(bool systemLevel); void GetInitialDriverVersion(); - void SetDriverInformation(const VkPhysicalDeviceProperties &props); + void SetDriverInformation(const VkPhysicalDeviceProperties &props, + const VkPhysicalDeviceDriverProperties &driverProps); AMDCounters *GetAMDCounters() { return m_pAMDCounters; } void CopyPixelForPixelHistory(VkCommandBuffer cmd, VkOffset2D offset, uint32_t sample, diff --git a/renderdoc/driver/vulkan/vk_shader_cache.cpp b/renderdoc/driver/vulkan/vk_shader_cache.cpp index e99fe4db4..22b46c00e 100644 --- a/renderdoc/driver/vulkan/vk_shader_cache.cpp +++ b/renderdoc/driver/vulkan/vk_shader_cache.cpp @@ -229,7 +229,7 @@ VulkanShaderCache::VulkanShaderCache(WrappedVulkan *driver) SetCaching(true); - VkDriverInfo driverVersion = driver->GetDriverInfo(); + const VkDriverInfo &driverVersion = driver->GetDriverInfo(); const VkPhysicalDeviceFeatures &enabledFeatures = driver->GetDeviceEnabledFeatures(); const VkPhysicalDeviceFeatures &availFeatures = driver->GetDeviceAvailableFeatures(); diff --git a/renderdoc/driver/vulkan/wrappers/vk_device_funcs.cpp b/renderdoc/driver/vulkan/wrappers/vk_device_funcs.cpp index ea13b980c..61478581f 100644 --- a/renderdoc/driver/vulkan/wrappers/vk_device_funcs.cpp +++ b/renderdoc/driver/vulkan/wrappers/vk_device_funcs.cpp @@ -634,9 +634,9 @@ VkResult WrappedVulkan::vkCreateInstance(const VkInstanceCreateInfo *pCreateInfo if(!internalInstance) { - addedExts = new const char *[modifiedCreateInfo.enabledExtensionCount + 1]; + addedExts = new const char *[modifiedCreateInfo.enabledExtensionCount + 2]; - bool hasDebugReport = false, hasDebugUtils = false; + bool hasDebugReport = false, hasDebugUtils = false, hasGPDP2 = false; for(uint32_t i = 0; i < modifiedCreateInfo.enabledExtensionCount; i++) { addedExts[i] = modifiedCreateInfo.ppEnabledExtensionNames[i]; @@ -644,6 +644,8 @@ VkResult WrappedVulkan::vkCreateInstance(const VkInstanceCreateInfo *pCreateInfo hasDebugReport = true; if(!strcmp(addedExts[i], VK_EXT_DEBUG_UTILS_EXTENSION_NAME)) hasDebugUtils = true; + if(!strcmp(addedExts[i], VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME)) + hasGPDP2 = true; } rdcarray supportedExts; @@ -671,6 +673,20 @@ VkResult WrappedVulkan::vkCreateInstance(const VkInstanceCreateInfo *pCreateInfo "Couldn't load vkEnumerateInstanceExtensionProperties in vkCreateInstance to enumerate " "instance extensions"); + // always enable GPDP2 if it's available + if(!hasGPDP2) + { + for(const VkExtensionProperties &ext : supportedExts) + { + if(!strcmp(ext.extensionName, VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME)) + { + addedExts[modifiedCreateInfo.enabledExtensionCount++] = + VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME; + break; + } + } + } + // always enable debug report/utils, if it's available if(!hasDebugUtils) { @@ -1050,32 +1066,7 @@ bool WrappedVulkan::Serialise_vkEnumeratePhysicalDevices(SerialiserType &ser, Vk ObjDisp(instance)->GetPhysicalDeviceQueueFamilyProperties(Unwrap(*pPhysicalDevices), &queueCount, queueProps); - if(GetExtensions(GetRecord(instance)).ext_KHR_get_physical_device_properties2) - { - uint32_t count = 0; - ObjDisp(*pPhysicalDevices) - ->EnumerateDeviceExtensionProperties(Unwrap(*pPhysicalDevices), NULL, &count, NULL); - - VkExtensionProperties *props = new VkExtensionProperties[count]; - ObjDisp(*pPhysicalDevices) - ->EnumerateDeviceExtensionProperties(Unwrap(*pPhysicalDevices), NULL, &count, props); - - for(uint32_t e = 0; e < count; e++) - { - if(!strcmp(props[e].extensionName, VK_KHR_DRIVER_PROPERTIES_EXTENSION_NAME)) - { - VkPhysicalDeviceProperties2 physProps2 = { - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2, - }; - - physProps2.pNext = &driverProps; - ObjDisp(instance)->GetPhysicalDeviceProperties2(Unwrap(*pPhysicalDevices), &physProps2); - break; - } - } - - SAFE_DELETE_ARRAY(props); - } + GetPhysicalDeviceDriverProperties(ObjDisp(instance), Unwrap(*pPhysicalDevices), driverProps); } SERIALISE_ELEMENT(legacyUnused_memIdxMap).Hidden(); // was never used @@ -1111,6 +1102,7 @@ bool WrappedVulkan::Serialise_vkEnumeratePhysicalDevices(SerialiserType &ser, Vk m_OriginalPhysicalDevices.resize(PhysicalDeviceIndex + 1); m_OriginalPhysicalDevices[PhysicalDeviceIndex].props = physProps; + m_OriginalPhysicalDevices[PhysicalDeviceIndex].driverProps = driverProps; m_OriginalPhysicalDevices[PhysicalDeviceIndex].memProps = memProps; m_OriginalPhysicalDevices[PhysicalDeviceIndex].availFeatures = physFeatures; m_OriginalPhysicalDevices[PhysicalDeviceIndex].queueCount = queueCount; @@ -1150,34 +1142,11 @@ bool WrappedVulkan::Serialise_vkEnumeratePhysicalDevices(SerialiserType &ser, Vk // find the best possible match for this physical device ObjDisp(pd)->GetPhysicalDeviceProperties(Unwrap(pd), &compPhysProps); - if(m_EnabledExtensions.ext_KHR_get_physical_device_properties2) - { - uint32_t count = 0; - ObjDisp(pd)->EnumerateDeviceExtensionProperties(Unwrap(pd), NULL, &count, NULL); - - VkExtensionProperties *props = new VkExtensionProperties[count]; - ObjDisp(pd)->EnumerateDeviceExtensionProperties(Unwrap(pd), NULL, &count, props); - - for(uint32_t e = 0; e < count; e++) - { - if(!strcmp(props[e].extensionName, VK_KHR_DRIVER_PROPERTIES_EXTENSION_NAME)) - { - VkPhysicalDeviceProperties2 physProps2 = { - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2, - }; - - physProps2.pNext = &compDriverProps; - ObjDisp(pd)->GetPhysicalDeviceProperties2(Unwrap(pd), &physProps2); - break; - } - } - - SAFE_DELETE_ARRAY(props); - } + GetPhysicalDeviceDriverProperties(ObjDisp(pd), Unwrap(pd), compDriverProps); if(firstTime) { - VkDriverInfo runningVersion(compPhysProps); + VkDriverInfo runningVersion(compPhysProps, compDriverProps); RDCLOG("Replay has physical device %u available:", i); RDCLOG(" - %s (ver %u.%u patch 0x%x) - %04x:%04x", compPhysProps.deviceName, @@ -1204,8 +1173,8 @@ bool WrappedVulkan::Serialise_vkEnumeratePhysicalDevices(SerialiserType &ser, Vk const VkPhysicalDeviceProperties &compPhysProps = compPhysPropsArray[i]; const VkPhysicalDeviceDriverProperties &compDriverProps = compDriverPropsArray[i]; - VkDriverInfo bestInfo(bestPhysProps); - VkDriverInfo compInfo(compPhysProps); + VkDriverInfo bestInfo(bestPhysProps, bestDriverProps); + VkDriverInfo compInfo(compPhysProps, compDriverProps); // an exact vendorID match is a better match than not if(compInfo.Vendor() == m_ReplayOptions.forceGPUVendor && @@ -1357,7 +1326,7 @@ bool WrappedVulkan::Serialise_vkEnumeratePhysicalDevices(SerialiserType &ser, Vk } { - VkDriverInfo capturedVersion(physProps); + VkDriverInfo capturedVersion(physProps, driverProps); RDCLOG("Found capture physical device %u:", PhysicalDeviceIndex); RDCLOG(" - %s (ver %u.%u patch 0x%x) - %04x:%04x", physProps.deviceName, @@ -1459,11 +1428,16 @@ VkResult WrappedVulkan::vkEnumeratePhysicalDevices(VkInstance instance, VkResourceRecord *record = GetResourceManager()->AddResourceRecord(devices[i]); RDCASSERT(record); + VkResourceRecord *instrecord = GetRecord(instance); + VkPhysicalDeviceProperties physProps; ObjDisp(devices[i])->GetPhysicalDeviceProperties(Unwrap(devices[i]), &physProps); - VkDriverInfo capturedVersion(physProps); + VkPhysicalDeviceDriverProperties driverProps = {}; + GetPhysicalDeviceDriverProperties(ObjDisp(devices[i]), Unwrap(devices[i]), driverProps); + + VkDriverInfo capturedVersion(physProps, driverProps); RDCLOG("physical device %u: %s (ver %u.%u patch 0x%x) - %04x:%04x", i, physProps.deviceName, capturedVersion.Major(), capturedVersion.Minor(), capturedVersion.Patch(), @@ -1480,8 +1454,6 @@ VkResult WrappedVulkan::vkEnumeratePhysicalDevices(VkInstance instance, record->AddChunk(scope.Get()); } - VkResourceRecord *instrecord = GetRecord(instance); - instrecord->AddParent(record); // copy the instance's setup directly @@ -1655,7 +1627,11 @@ bool WrappedVulkan::Serialise_vkCreateDevice(SerialiserType &ser, VkPhysicalDevi ObjDisp(physicalDevice) ->GetPhysicalDeviceFeatures(Unwrap(physicalDevice), &m_PhysicalDeviceData.availFeatures); - m_PhysicalDeviceData.driverInfo = VkDriverInfo(m_PhysicalDeviceData.props, true); + GetPhysicalDeviceDriverProperties(ObjDisp(physicalDevice), Unwrap(physicalDevice), + m_PhysicalDeviceData.driverProps); + + m_PhysicalDeviceData.driverInfo = + VkDriverInfo(m_PhysicalDeviceData.props, m_PhysicalDeviceData.driverProps, true); rdcarray queuePriorities; @@ -1673,7 +1649,7 @@ bool WrappedVulkan::Serialise_vkCreateDevice(SerialiserType &ser, VkPhysicalDevi const PhysicalDeviceData &origData = m_OriginalPhysicalDevices[physicalDeviceIndex]; m_OrigPhysicalDeviceData = origData; - m_OrigPhysicalDeviceData.driverInfo = VkDriverInfo(origData.props, false); + m_OrigPhysicalDeviceData.driverInfo = VkDriverInfo(origData.props, origData.driverProps, false); // we must make any modifications locally, so the free of pointers // in the serialised VkDeviceCreateInfo don't double-free @@ -3678,7 +3654,7 @@ bool WrappedVulkan::Serialise_vkCreateDevice(SerialiserType &ser, VkPhysicalDevi } } - m_Replay->SetDriverInformation(m_PhysicalDeviceData.props); + m_Replay->SetDriverInformation(m_PhysicalDeviceData.props, m_PhysicalDeviceData.driverProps); m_PhysicalDeviceData.enabledFeatures = enabledFeatures; @@ -4134,7 +4110,11 @@ VkResult WrappedVulkan::vkCreateDevice(VkPhysicalDevice physicalDevice, ->GetPhysicalDeviceFeatures(Unwrap(physicalDevice), &m_PhysicalDeviceData.availFeatures); m_PhysicalDeviceData.enabledFeatures = enabledFeatures; - m_PhysicalDeviceData.driverInfo = VkDriverInfo(m_PhysicalDeviceData.props, true); + GetPhysicalDeviceDriverProperties(ObjDisp(physicalDevice), Unwrap(physicalDevice), + m_PhysicalDeviceData.driverProps); + + m_PhysicalDeviceData.driverInfo = + VkDriverInfo(m_PhysicalDeviceData.props, m_PhysicalDeviceData.driverProps, true); ChooseMemoryIndices();