Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 19 additions & 5 deletions UnleashedRecomp/gpu/video.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1712,18 +1712,32 @@ bool Video::CreateHostDevice(const char *sdlVideoDriver, bool graphicsApiRetry)
#ifdef UNLEASHED_RECOMP_D3D12
if (interfaceFunction == CreateD3D12Interface)
{
bool redirectToVulkan = false;

if (deviceDescription.vendor == RenderDeviceVendor::AMD)
{
// AMD Drivers before this version have a known issue where MSAA resolve targets will fail to work correctly.
// If no specific graphics API was selected, we silently destroy this one and move to the next option as it'll
// just work incorrectly otherwise and result in visual glitches and 3D rendering not working in general.
constexpr uint64_t MinimumAMDDriverVersion = 0x1F00005DC2005CULL; // 31.0.24002.92
if ((Config::GraphicsAPI == EGraphicsAPI::Auto) && (deviceDescription.driverVersion < MinimumAMDDriverVersion))
{
g_device.reset();
g_interface.reset();
continue;
}
redirectToVulkan = true;
}
else if (deviceDescription.vendor == RenderDeviceVendor::INTEL)
{
// Intel drivers on D3D12 are extremely buggy, introducing various graphical glitches.
// We will redirect users to Vulkan until a workaround can be found.
if (Config::GraphicsAPI == EGraphicsAPI::Auto)
redirectToVulkan = true;
}

// Allow redirection to Vulkan only if we are not retrying after a crash,
// so the user can at least boot the game with D3D12 if Vulkan fails to work.
if (!graphicsApiRetry && redirectToVulkan)
{
g_device.reset();
g_interface.reset();
continue;
}

// Hardware resolve seems to be completely bugged on Intel D3D12 drivers.
Expand Down