summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends/D3D/main.cpp
diff options
context:
space:
mode:
authorConnor McLaughlin <stenzek@gmail.com>2019-07-30 01:24:57 +1000
committerGitHub <noreply@github.com>2019-07-30 01:24:57 +1000
commitdea2b9c509b96cb58182b883c1df9f9f7f9234bf (patch)
tree040c38404307c5e2a0bc7986225ed49b4b3aabb7 /Source/Core/VideoBackends/D3D/main.cpp
parentb0113b6c64a7807e35cfd9dd597d3c5e77b4ceda (diff)
parentbaa9636d48008af602e15c76a3647317ff4d0aa4 (diff)
Merge pull request #8258 from CookiePLMonster/dx11.1-detection-fixes
D3D11 resources refactor and DX11.1 feature detection fixes
Diffstat (limited to 'Source/Core/VideoBackends/D3D/main.cpp')
-rw-r--r--Source/Core/VideoBackends/D3D/main.cpp29
1 files changed, 26 insertions, 3 deletions
diff --git a/Source/Core/VideoBackends/D3D/main.cpp b/Source/Core/VideoBackends/D3D/main.cpp
index d87965deff..33c9117f25 100644
--- a/Source/Core/VideoBackends/D3D/main.cpp
+++ b/Source/Core/VideoBackends/D3D/main.cpp
@@ -37,6 +37,31 @@ std::string VideoBackend::GetDisplayName() const
return _trans("Direct3D 11");
}
+std::optional<std::string> VideoBackend::GetWarningMessage() const
+{
+ std::optional<std::string> result;
+
+ // If user is on Win7, show a warning about partial DX11.1 support
+ // This is being called BEFORE FillBackendInfo is called for this backend,
+ // so query for logic op support manually
+ bool supportsLogicOp = false;
+ if (D3DCommon::LoadLibraries())
+ {
+ supportsLogicOp = D3D::SupportsLogicOp(g_Config.iAdapter);
+ D3DCommon::UnloadLibraries();
+ }
+
+ if (!supportsLogicOp)
+ {
+ result = _trans("Direct3D 11 renderer requires support for features not supported by your "
+ "system configuration. This is most likely because you are using Windows 7. "
+ "You may still use this backend, but you might encounter graphical artifacts."
+ "\n\nDo you really want to switch to Direct3D 11? If unsure, select 'No'.");
+ }
+
+ return result;
+}
+
void VideoBackend::InitBackendInfo()
{
if (!D3DCommon::LoadLibraries())
@@ -63,16 +88,13 @@ void VideoBackend::FillBackendInfo()
g_Config.backend_info.bSupportsClipControl = true;
g_Config.backend_info.bSupportsDepthClamp = true;
g_Config.backend_info.bSupportsReversedDepthRange = false;
- g_Config.backend_info.bSupportsLogicOp = true;
g_Config.backend_info.bSupportsMultithreading = false;
g_Config.backend_info.bSupportsGPUTextureDecoding = true;
- g_Config.backend_info.bSupportsST3CTextures = false;
g_Config.backend_info.bSupportsCopyToVram = true;
g_Config.backend_info.bSupportsLargePoints = false;
g_Config.backend_info.bSupportsPartialDepthCopies = false;
g_Config.backend_info.bSupportsBitfield = false;
g_Config.backend_info.bSupportsDynamicSamplerIndexing = false;
- g_Config.backend_info.bSupportsBPTCTextures = false;
g_Config.backend_info.bSupportsFramebufferFetch = false;
g_Config.backend_info.bSupportsBackgroundCompiling = true;
g_Config.backend_info.bSupportsST3CTextures = true;
@@ -84,6 +106,7 @@ void VideoBackend::FillBackendInfo()
g_Config.backend_info.bSupportsSSAA = true;
g_Config.backend_info.bSupportsShaderBinaries = true;
g_Config.backend_info.bSupportsPipelineCacheData = false;
+ g_Config.backend_info.bSupportsLogicOp = D3D::SupportsLogicOp(g_Config.iAdapter);
g_Config.backend_info.Adapters = D3DCommon::GetAdapterNames();
g_Config.backend_info.AAModes = D3D::GetAAModes(g_Config.iAdapter);