mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-04-20 11:36:13 +00: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
11484a32c1
commit
aa29a25c1f
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.deviceFault = VK_TRUE;
|
||||
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))
|
||||
|
|
|
@ -29,37 +29,24 @@ namespace vk
|
|||
std::vector<u8> vendor_binary_data;
|
||||
std::string fault_description;
|
||||
|
||||
#ifdef _MSC_VER
|
||||
__try
|
||||
// Retrieve sizes
|
||||
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
|
||||
// Retrieve sizes
|
||||
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
|
||||
{
|
||||
.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
|
||||
.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;
|
||||
std::string fault_message = fmt::format(
|
||||
"Device Fault Information:\n"
|
||||
"Fault Summary:\n"
|
||||
|
|
Loading…
Add table
Reference in a new issue