mirror of
https://github.com/doitsujin/dxvk.git
synced 2024-12-02 01:24:11 +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:
parent
d744a3cd69
commit
b601a94750
@ -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");
|
||||
|
@ -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"
|
||||
|
@ -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) {
|
||||
DxgiOptions options;
|
||||
|
||||
auto appOptions = g_dxgiAppOptions.find(appName);
|
||||
if (appOptions != g_dxgiAppOptions.end())
|
||||
options = appOptions->second;
|
||||
|
||||
return appOptions != g_dxgiAppOptions.end()
|
||||
? appOptions->second
|
||||
: DxgiOptions();
|
||||
if (env::getEnvVar(L"DXVK_FAKE_DX10_SUPPORT") == "1")
|
||||
options.set(DxgiOption::FakeDx10Support);
|
||||
|
||||
return options;
|
||||
}
|
||||
|
||||
}
|
@ -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>;
|
||||
|
Loading…
Reference in New Issue
Block a user