vk: Make more features "optional"

- This allows some non-conformant drivers to at least finish swapchain creation.
This commit is contained in:
kd-11 2024-02-11 03:33:13 +03:00 committed by kd-11
parent 7f602937a3
commit a54f1970f1

View file

@ -509,6 +509,13 @@ namespace vk
enabled_features.shaderStorageBufferArrayDynamicIndexing = VK_TRUE; enabled_features.shaderStorageBufferArrayDynamicIndexing = VK_TRUE;
// Optionally disable unsupported stuff // Optionally disable unsupported stuff
if (!pgpu->features.fullDrawIndexUint32)
{
// There's really nothing we can do about PS3 draw indices, just pray your GPU doesn't crash.
rsx_log.error("Your GPU driver does not fully support 32-bit vertex indices. This may result in graphical corruption or crashes in some cases.");
enabled_features.fullDrawIndexUint32 = VK_FALSE;
}
if (!pgpu->features.shaderStorageImageMultisample || !pgpu->features.shaderStorageImageWriteWithoutFormat) if (!pgpu->features.shaderStorageImageMultisample || !pgpu->features.shaderStorageImageWriteWithoutFormat)
{ {
// Disable MSAA if any of these two features are unsupported // Disable MSAA if any of these two features are unsupported
@ -554,6 +561,12 @@ namespace vk
enabled_features.depthBounds = VK_FALSE; enabled_features.depthBounds = VK_FALSE;
} }
if (!pgpu->features.largePoints)
{
rsx_log.error("Your GPU does not support large points. Graphics may not render correctly.");
enabled_features.largePoints = VK_FALSE;
}
if (!pgpu->features.wideLines) if (!pgpu->features.wideLines)
{ {
rsx_log.error("Your GPU does not support wide lines. Graphics may not render correctly."); rsx_log.error("Your GPU does not support wide lines. Graphics may not render correctly.");
@ -579,13 +592,11 @@ namespace vk
enabled_features.occlusionQueryPrecise = VK_FALSE; enabled_features.occlusionQueryPrecise = VK_FALSE;
} }
#ifdef __APPLE__
if (!pgpu->features.logicOp) if (!pgpu->features.logicOp)
{ {
rsx_log.error("Your GPU does not support framebuffer logical operations. Graphics may not render correctly."); rsx_log.error("Your GPU does not support framebuffer logical operations. Graphics may not render correctly.");
enabled_features.logicOp = VK_FALSE; enabled_features.logicOp = VK_FALSE;
} }
#endif
VkDeviceCreateInfo device = {}; VkDeviceCreateInfo device = {};
device.sType = VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO; device.sType = VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO;