mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-04 22:11:26 +12:00
vk: Wrap device fault handler in SEH2
This commit is contained in:
parent
e3df7bccac
commit
b2949f114b
1 changed files with 36 additions and 14 deletions
|
@ -23,11 +23,24 @@ namespace vk
|
||||||
{
|
{
|
||||||
.sType = VK_STRUCTURE_TYPE_DEVICE_FAULT_COUNTS_EXT
|
.sType = VK_STRUCTURE_TYPE_DEVICE_FAULT_COUNTS_EXT
|
||||||
};
|
};
|
||||||
|
|
||||||
|
std::vector<VkDeviceFaultAddressInfoEXT> address_info;
|
||||||
|
std::vector<VkDeviceFaultVendorInfoEXT> vendor_info;
|
||||||
|
std::vector<u8> vendor_binary_data;
|
||||||
|
std::string fault_description;
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
__try
|
||||||
|
{
|
||||||
|
#endif
|
||||||
|
// Retrieve sizes
|
||||||
g_render_device->_vkGetDeviceFaultInfoEXT(*g_render_device, &fault_counts, nullptr);
|
g_render_device->_vkGetDeviceFaultInfoEXT(*g_render_device, &fault_counts, nullptr);
|
||||||
|
|
||||||
std::vector<VkDeviceFaultAddressInfoEXT> address_info(fault_counts.addressInfoCount, VkDeviceFaultAddressInfoEXT{});
|
// Resize arrays and fill
|
||||||
std::vector<VkDeviceFaultVendorInfoEXT> vendor_info(fault_counts.vendorInfoCount, VkDeviceFaultVendorInfoEXT{});
|
address_info.resize(fault_counts.addressInfoCount);
|
||||||
std::vector<u8> vendor_binary_data(fault_counts.vendorBinarySize);
|
vendor_info.resize(fault_counts.vendorInfoCount);
|
||||||
|
vendor_binary_data.resize(fault_counts.vendorBinarySize);
|
||||||
|
|
||||||
VkDeviceFaultInfoEXT fault_info
|
VkDeviceFaultInfoEXT fault_info
|
||||||
{
|
{
|
||||||
.sType = VK_STRUCTURE_TYPE_DEVICE_FAULT_INFO_EXT,
|
.sType = VK_STRUCTURE_TYPE_DEVICE_FAULT_INFO_EXT,
|
||||||
|
@ -35,18 +48,27 @@ namespace vk
|
||||||
.pVendorInfos = vendor_info.data(),
|
.pVendorInfos = vendor_info.data(),
|
||||||
.pVendorBinaryData = vendor_binary_data.data()
|
.pVendorBinaryData = vendor_binary_data.data()
|
||||||
};
|
};
|
||||||
|
|
||||||
g_render_device->_vkGetDeviceFaultInfoEXT(*g_render_device, &fault_counts, &fault_info);
|
g_render_device->_vkGetDeviceFaultInfoEXT(*g_render_device, &fault_counts, &fault_info);
|
||||||
|
|
||||||
|
fault_description = fault_info.description;
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
}
|
||||||
|
__except (EXCEPTION_EXECUTE_HANDLER)
|
||||||
|
{
|
||||||
|
rsx_log.error("Driver crashed retrieving extended crash information. Are you running on an NVIDIA card?");
|
||||||
|
return "Extended fault information is not available. The driver crashed when retrieving the details.";
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
std::string fault_message = fmt::format(
|
std::string fault_message = fmt::format(
|
||||||
"Device Fault Information:\n"
|
"Device Fault Information:\n"
|
||||||
"Fault Summary:\n"
|
"Fault Summary:\n"
|
||||||
" %s\n\n",
|
" %s\n\n",
|
||||||
fault_info.description);
|
fault_description);
|
||||||
|
|
||||||
if (!address_info.empty())
|
if (!address_info.empty())
|
||||||
{
|
{
|
||||||
fmt::append(fault_message, " Address Fault Information:\n", fault_info.description);
|
fmt::append(fault_message, " Address Fault Information:\n", fault_description);
|
||||||
|
|
||||||
for (const auto& fault : address_info)
|
for (const auto& fault : address_info)
|
||||||
{
|
{
|
||||||
|
@ -78,7 +100,7 @@ namespace vk
|
||||||
|
|
||||||
if (!vendor_info.empty())
|
if (!vendor_info.empty())
|
||||||
{
|
{
|
||||||
fmt::append(fault_message, " Vendor Fault Information:\n", fault_info.description);
|
fmt::append(fault_message, " Vendor Fault Information:\n", fault_description);
|
||||||
|
|
||||||
for (const auto& fault : vendor_info)
|
for (const auto& fault : vendor_info)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue