1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-02 10:24:12 +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_factory.h"
#include "dxgi_format.h"
#include "dxgi_options.h"
#include "dxgi_output.h"
#include "../dxvk/vulkan/dxvk_vulkan_names.h"
@ -63,8 +64,9 @@ namespace dxvk {
|| InterfaceName == __uuidof(ID3D10Device1)) {
Logger::warn("DXGI: CheckInterfaceSupport: No D3D10 support");
if (env::getEnvVar(L"DXVK_FAKE_DX10_SUPPORT") == "1")
return S_OK;
DxgiOptions dxgiOptions = getDxgiAppOptions(env::getExeName());
return dxgiOptions.test(DxgiOption::FakeDx10Support)
? S_OK : DXGI_ERROR_UNSUPPORTED;
}
Logger::err("DXGI: CheckInterfaceSupport: Unsupported interface");

View File

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

View File

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

View File

@ -15,6 +15,11 @@ namespace dxvk {
/// fixes issues with games that create multiple swap chains
/// for a single window that may interfere with each other.
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>;