Permalink
Browse files

[dxgi] Hack: Report Nvidia cards as AMD cards by default

Prevents UE4 games from repeatedly trying to load nvapi.dll
on a performance-critical code path.
  • Loading branch information...
doitsujin committed Nov 1, 2018
1 parent bfb7e54 commit 5d49644cdc071866c5556997a35bd946d7724457
Showing with 8 additions and 0 deletions.
  1. +8 −0 src/dxgi/dxgi_adapter.cpp
@@ -158,6 +158,14 @@ namespace dxvk {
if (options->customDeviceId >= 0)
deviceProp.deviceID = options->customDeviceId;

// XXX nvapi workaround for a lot of Unreal Engine 4 games
if (options->customVendorId < 0 && options->customDeviceId < 0
&& 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 */
}

// Convert device name
std::memset(pDesc->Description, 0, sizeof(pDesc->Description));
::MultiByteToWideChar(CP_UTF8, 0, deviceProp.deviceName, -1,

0 comments on commit 5d49644

Please sign in to comment.