mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-04 05:51:27 +12:00
vk: Fix extension initialization during device creation
- Fix crash when using device_fault extension - Fix spec violation when using conditional rendering
This commit is contained in:
parent
f3e913b56a
commit
26d85e53a4
2 changed files with 26 additions and 30 deletions
|
@ -752,7 +752,16 @@ namespace vk
|
||||||
device_fault_info.pNext = const_cast<void*>(device.pNext);
|
device_fault_info.pNext = const_cast<void*>(device.pNext);
|
||||||
device_fault_info.deviceFault = VK_TRUE;
|
device_fault_info.deviceFault = VK_TRUE;
|
||||||
device_fault_info.deviceFaultVendorBinary = VK_FALSE;
|
device_fault_info.deviceFaultVendorBinary = VK_FALSE;
|
||||||
device_fault_info.pNext = &device_fault_info;
|
device.pNext = &device_fault_info;
|
||||||
|
}
|
||||||
|
|
||||||
|
VkPhysicalDeviceConditionalRenderingFeaturesEXT conditional_rendering_info{};
|
||||||
|
if (pgpu->optional_features_support.conditional_rendering)
|
||||||
|
{
|
||||||
|
conditional_rendering_info.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONDITIONAL_RENDERING_FEATURES_EXT;
|
||||||
|
conditional_rendering_info.pNext = const_cast<void*>(device.pNext);
|
||||||
|
conditional_rendering_info.conditionalRendering = VK_TRUE;
|
||||||
|
device.pNext = &conditional_rendering_info;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (auto error = vkCreateDevice(*pgpu, &device, nullptr, &dev))
|
if (auto error = vkCreateDevice(*pgpu, &device, nullptr, &dev))
|
||||||
|
|
|
@ -29,37 +29,24 @@ namespace vk
|
||||||
std::vector<u8> vendor_binary_data;
|
std::vector<u8> vendor_binary_data;
|
||||||
std::string fault_description;
|
std::string fault_description;
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
// Retrieve sizes
|
||||||
__try
|
g_render_device->_vkGetDeviceFaultInfoEXT(*g_render_device, &fault_counts, nullptr);
|
||||||
|
|
||||||
|
// Resize arrays and fill
|
||||||
|
address_info.resize(fault_counts.addressInfoCount);
|
||||||
|
vendor_info.resize(fault_counts.vendorInfoCount);
|
||||||
|
vendor_binary_data.resize(fault_counts.vendorBinarySize);
|
||||||
|
|
||||||
|
VkDeviceFaultInfoEXT fault_info
|
||||||
{
|
{
|
||||||
#endif
|
.sType = VK_STRUCTURE_TYPE_DEVICE_FAULT_INFO_EXT,
|
||||||
// Retrieve sizes
|
.pAddressInfos = address_info.data(),
|
||||||
g_render_device->_vkGetDeviceFaultInfoEXT(*g_render_device, &fault_counts, nullptr);
|
.pVendorInfos = vendor_info.data(),
|
||||||
|
.pVendorBinaryData = vendor_binary_data.data()
|
||||||
// Resize arrays and fill
|
};
|
||||||
address_info.resize(fault_counts.addressInfoCount);
|
g_render_device->_vkGetDeviceFaultInfoEXT(*g_render_device, &fault_counts, &fault_info);
|
||||||
vendor_info.resize(fault_counts.vendorInfoCount);
|
|
||||||
vendor_binary_data.resize(fault_counts.vendorBinarySize);
|
|
||||||
|
|
||||||
VkDeviceFaultInfoEXT fault_info
|
|
||||||
{
|
|
||||||
.sType = VK_STRUCTURE_TYPE_DEVICE_FAULT_INFO_EXT,
|
|
||||||
.pAddressInfos = address_info.data(),
|
|
||||||
.pVendorInfos = vendor_info.data(),
|
|
||||||
.pVendorBinaryData = vendor_binary_data.data()
|
|
||||||
};
|
|
||||||
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
|
|
||||||
|
|
||||||
|
fault_description = fault_info.description;
|
||||||
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"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue