From faf36ecba65755e08141bdefa1dd75eb03a068f8 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Wed, 22 Feb 2023 00:54:36 +1000 Subject: [PATCH] GS/D3D: Default to D3D11 for Intel --- pcsx2/GS/GSUtil.cpp | 13 +++++++++---- pcsx2/GS/Renderers/DX11/D3D.cpp | 27 +++++++++++++++++++++------ 2 files changed, 30 insertions(+), 10 deletions(-) diff --git a/pcsx2/GS/GSUtil.cpp b/pcsx2/GS/GSUtil.cpp index 771d6165ad..426953c27b 100644 --- a/pcsx2/GS/GSUtil.cpp +++ b/pcsx2/GS/GSUtil.cpp @@ -156,14 +156,19 @@ GSRendererType GSUtil::GetPreferredRenderer() // Mac: Prefer Metal hardware. return GSRendererType::Metal; #elif defined(_WIN32) - if (D3D::ShouldPreferRenderer() == D3D::Renderer::Vulkan) + const u8 preferred = D3D::ShouldPreferRenderer(); +#if defined(ENABLE_VULKAN) + if (preferred == D3D::Renderer::Vulkan) return GSRendererType::VK; +#endif #if defined(ENABLE_OPENGL) - else if (D3D::ShouldPreferRenderer() == D3D::Renderer::OpenGL) + if (preferred == D3D::Renderer::OpenGL) return GSRendererType::OGL; #endif - else - return GSRendererType::DX11; + if (preferred == D3D::Renderer::Direct3D12) + return GSRendererType::DX12; + + return GSRendererType::DX11; #else // Linux: Prefer GL/Vulkan, whatever is available. #if defined(ENABLE_OPENGL) diff --git a/pcsx2/GS/Renderers/DX11/D3D.cpp b/pcsx2/GS/Renderers/DX11/D3D.cpp index 689331f50b..07fcd1bd9c 100644 --- a/pcsx2/GS/Renderers/DX11/D3D.cpp +++ b/pcsx2/GS/Renderers/DX11/D3D.cpp @@ -174,22 +174,37 @@ namespace D3D switch (Vendor()) { case VendorID::Nvidia: + { if (feature_level == D3D_FEATURE_LEVEL_12_0) return Renderer::Vulkan; else if (feature_level == D3D_FEATURE_LEVEL_11_0) return Renderer::OpenGL; - [[fallthrough]]; + else + return Renderer::Direct3D11; + } + case VendorID::AMD: + { if (feature_level == D3D_FEATURE_LEVEL_12_0) return Renderer::Vulkan; - [[fallthrough]]; + else + return Renderer::Direct3D11; + } + case VendorID::Intel: - if (feature_level == D3D_FEATURE_LEVEL_12_0) - return Renderer::OpenGL; - [[fallthrough]]; + { + // Older Intel GPUs prior to Xe seem to have broken OpenGL drivers which choke + // on some of our shaders, causing what appears to be GPU timeouts+device removals. + // Vulkan has broken barriers, also prior to Xe. So just fall back to DX11 everywhere, + // unless we can find some way of differentiating Xe. + return Renderer::Direct3D11; + } + default: + { // Default is D3D11 - return Renderer::Default; + return Renderer::Direct3D11; + } } } }