Skip to content

Commit

Permalink
D3D11: Show a warning message about unsupported features when switchi…
Browse files Browse the repository at this point in the history
…ng to D3D11 backend on Windows 7
  • Loading branch information
CookiePLMonster committed Jul 22, 2019
1 parent 9723d9d commit 46075a8
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
1 change: 1 addition & 0 deletions Source/Core/VideoBackends/D3D/VideoBackend.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class VideoBackend : public VideoBackendBase

std::string GetName() const override;
std::string GetDisplayName() const override;
std::optional<std::string> GetWarningMessage() const override;

void InitBackendInfo() override;

Expand Down
25 changes: 25 additions & 0 deletions Source/Core/VideoBackends/D3D/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down

0 comments on commit 46075a8

Please sign in to comment.