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

[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.
This commit is contained in:
Philip Rebohle 2018-11-01 13:47:04 +01:00
parent bfb7e54218
commit 5d49644cdc
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99

View File

@ -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,