mirror of
https://github.com/stenzek/duckstation.git
synced 2025-07-23 10:30:23 +00:00
VulkanDevice: Use driver type enum for auto selection
This commit is contained in:
parent
792b72b955
commit
5e2e39f642
@ -1937,30 +1937,36 @@ bool VulkanDevice::IsSuitableDefaultRenderer()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check the first GPU, should be enough.
|
// Check the first GPU, should be enough.
|
||||||
const std::string& name = gpus.front().second.name;
|
const AdapterInfo& ainfo = gpus.front().second;
|
||||||
INFO_LOG("Using Vulkan GPU '{}' for automatic renderer check.", name);
|
INFO_LOG("Using Vulkan GPU '{}' for automatic renderer check.", ainfo.name);
|
||||||
|
|
||||||
// Any software rendering (LLVMpipe, SwiftShader).
|
// Any software rendering (LLVMpipe, SwiftShader).
|
||||||
if (StringUtil::StartsWithNoCase(name, "llvmpipe") || StringUtil::StartsWithNoCase(name, "SwiftShader"))
|
if ((ainfo.driver_type & GPUDriverType::SoftwareFlag) == GPUDriverType::SoftwareFlag)
|
||||||
{
|
{
|
||||||
INFO_LOG("Not using Vulkan for software renderer.");
|
INFO_LOG("Not using Vulkan for software renderer.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// For Intel, OpenGL usually ends up faster on Linux, because of fbfetch.
|
#ifdef __linux__
|
||||||
// Plus, the Ivy Bridge and Haswell drivers are incomplete.
|
// Intel Ivy Bridge/Haswell/Broadwell drivers are incomplete.
|
||||||
if (StringUtil::StartsWithNoCase(name, "Intel"))
|
if (ainfo.driver_type == GPUDriverType::IntelMesa &&
|
||||||
|
(ainfo.name.find("Ivy Bridge") != std::string::npos || ainfo.name.find("Haswell") != std::string::npos ||
|
||||||
|
ainfo.name.find("Broadwell") != std::string::npos || ainfo.name.find("(IVB") != std::string::npos ||
|
||||||
|
ainfo.name.find("(HSW") != std::string::npos || ainfo.name.find("(BDW") != std::string::npos))
|
||||||
{
|
{
|
||||||
INFO_LOG("Not using Vulkan for Intel GPU.");
|
INFO_LOG("Not using Vulkan for Intel GPU with incomplete driver.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(__linux__) || defined(__ANDROID__)
|
||||||
// V3D is buggy, image copies with larger textures are broken.
|
// V3D is buggy, image copies with larger textures are broken.
|
||||||
if (StringUtil::StartsWithNoCase(name, "V3D"))
|
if (ainfo.driver_type == GPUDriverType::BroadcomMesa)
|
||||||
{
|
{
|
||||||
INFO_LOG("Not using Vulkan for V3D GPU.");
|
INFO_LOG("Not using Vulkan for V3D GPU with buggy driver.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
INFO_LOG("Allowing Vulkan as default renderer.");
|
INFO_LOG("Allowing Vulkan as default renderer.");
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user