1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-11 10:24:10 +01:00

[dxgi] Make faking Dx10 support a per-app option

Also whitelist World of Warcraft, which requires this hack for now.
This commit is contained in:
Philip Rebohle 2018-07-20 13:49:07 +02:00
parent d744a3cd69
commit b601a94750
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
4 changed files with 19 additions and 5 deletions

View File

@ -8,6 +8,7 @@
#include "dxgi_enums.h" #include "dxgi_enums.h"
#include "dxgi_factory.h" #include "dxgi_factory.h"
#include "dxgi_format.h" #include "dxgi_format.h"
#include "dxgi_options.h"
#include "dxgi_output.h" #include "dxgi_output.h"
#include "../dxvk/vulkan/dxvk_vulkan_names.h" #include "../dxvk/vulkan/dxvk_vulkan_names.h"
@ -63,8 +64,9 @@ namespace dxvk {
|| InterfaceName == __uuidof(ID3D10Device1)) { || InterfaceName == __uuidof(ID3D10Device1)) {
Logger::warn("DXGI: CheckInterfaceSupport: No D3D10 support"); Logger::warn("DXGI: CheckInterfaceSupport: No D3D10 support");
if (env::getEnvVar(L"DXVK_FAKE_DX10_SUPPORT") == "1") DxgiOptions dxgiOptions = getDxgiAppOptions(env::getExeName());
return S_OK; return dxgiOptions.test(DxgiOption::FakeDx10Support)
? S_OK : DXGI_ERROR_UNSUPPORTED;
} }
Logger::err("DXGI: CheckInterfaceSupport: Unsupported interface"); Logger::err("DXGI: CheckInterfaceSupport: Unsupported interface");

View File

@ -17,6 +17,7 @@
#include "../util/rc/util_rc.h" #include "../util/rc/util_rc.h"
#include "../util/rc/util_rc_ptr.h" #include "../util/rc/util_rc_ptr.h"
#include "../util/util_env.h"
#include "../util/util_enum.h" #include "../util/util_enum.h"
#include "../util/util_error.h" #include "../util/util_error.h"
#include "../util/util_flags.h" #include "../util/util_flags.h"

View File

@ -6,15 +6,21 @@ namespace dxvk {
const static std::unordered_map<std::string, DxgiOptions> g_dxgiAppOptions = {{ const static std::unordered_map<std::string, DxgiOptions> g_dxgiAppOptions = {{
{ "Frostpunk.exe", DxgiOptions(DxgiOption::DeferSurfaceCreation) }, { "Frostpunk.exe", DxgiOptions(DxgiOption::DeferSurfaceCreation) },
{ "Wow.exe", DxgiOptions(DxgiOption::FakeDx10Support) },
}}; }};
DxgiOptions getDxgiAppOptions(const std::string& appName) { DxgiOptions getDxgiAppOptions(const std::string& appName) {
DxgiOptions options;
auto appOptions = g_dxgiAppOptions.find(appName); auto appOptions = g_dxgiAppOptions.find(appName);
if (appOptions != g_dxgiAppOptions.end())
options = appOptions->second;
return appOptions != g_dxgiAppOptions.end() if (env::getEnvVar(L"DXVK_FAKE_DX10_SUPPORT") == "1")
? appOptions->second options.set(DxgiOption::FakeDx10Support);
: DxgiOptions();
return options;
} }
} }

View File

@ -15,6 +15,11 @@ namespace dxvk {
/// fixes issues with games that create multiple swap chains /// fixes issues with games that create multiple swap chains
/// for a single window that may interfere with each other. /// for a single window that may interfere with each other.
DeferSurfaceCreation, DeferSurfaceCreation,
/// Report to the app that Dx10 interfaces are supported,
/// even if they are not actually supported. Some apps
/// refuse to start without it, some don't work with it.
FakeDx10Support,
}; };
using DxgiOptions = Flags<DxgiOption>; using DxgiOptions = Flags<DxgiOption>;