From cf9de54a12e662cfbf87beba10428c41e13d3ec9 Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Thu, 10 Jan 2019 11:57:09 +0100 Subject: [PATCH] [dxgi] Add dxgi.nvapiHack option to disable NVAPI workaround --- src/dxgi/dxgi_adapter.cpp | 2 +- src/dxgi/dxgi_options.cpp | 1 + src/dxgi/dxgi_options.h | 3 +++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/dxgi/dxgi_adapter.cpp b/src/dxgi/dxgi_adapter.cpp index d6b5d2d7..87acb067 100644 --- a/src/dxgi/dxgi_adapter.cpp +++ b/src/dxgi/dxgi_adapter.cpp @@ -159,7 +159,7 @@ namespace dxvk { // XXX nvapi workaround for a lot of Unreal Engine 4 games if (options->customVendorId < 0 && options->customDeviceId < 0 - && deviceProp.vendorID == uint16_t(DxvkGpuVendor::Nvidia)) { + && options->nvapiHack && deviceProp.vendorID == uint16_t(DxvkGpuVendor::Nvidia)) { Logger::info("DXGI: NvAPI workaround enabled, reporting AMD GPU"); deviceProp.vendorID = uint16_t(DxvkGpuVendor::Amd); deviceProp.deviceID = 0x67df; /* RX 480 */ diff --git a/src/dxgi/dxgi_options.cpp b/src/dxgi/dxgi_options.cpp index c1ce8686..1c91817b 100644 --- a/src/dxgi/dxgi_options.cpp +++ b/src/dxgi/dxgi_options.cpp @@ -40,6 +40,7 @@ namespace dxvk { this->maxSharedMemory = VkDeviceSize(config.getOption("dxgi.maxSharedMemory", 0)) << 20; this->d3d10Enable = config.getOption("d3d10.enable", true); + this->nvapiHack = config.getOption("dxgi.nvapiHack", true); } } \ No newline at end of file diff --git a/src/dxgi/dxgi_options.h b/src/dxgi/dxgi_options.h index 96bc5a64..3eb63c35 100644 --- a/src/dxgi/dxgi_options.h +++ b/src/dxgi/dxgi_options.h @@ -40,6 +40,9 @@ namespace dxvk { /// Enables D3D10 support bool d3d10Enable; + + /// Enables nvapi workaround + bool nvapiHack; }; }