Skip to content

Commit

Permalink
[dxgi] Hack: Report Intel cards as AMD cards by default
Browse files Browse the repository at this point in the history
  • Loading branch information
Blisto91 committed Jun 9, 2023
1 parent f3fb5ba commit 531999b
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 0 deletions.
7 changes: 7 additions & 0 deletions dxvk.conf
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,13 @@
# dxgi.nvapiHack = True


# Report Intel GPUs as AMD GPUs by default. This is enabled by default
# to work around issues with UE4 games and XeSS on Intel.
#
# Supported values: True, False

# dxgi.intelVendorHack = True


# Override maximum amount of device memory and shared system memory
# reported to the application. This may fix texture streaming issues
Expand Down
8 changes: 8 additions & 0 deletions src/dxgi/dxgi_adapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,14 @@ namespace dxvk {
deviceProp.vendorID = uint16_t(DxvkGpuVendor::Amd);
deviceProp.deviceID = 0x67df; /* RX 480 */
}

// Intel workaround for XeSS and Unreal Engine 4 games
if (options->customVendorId < 0 && options->customDeviceId < 0
&& options->intelVendorHack && deviceProp.vendorID == uint16_t(DxvkGpuVendor::Intel)) {
Logger::info("DXGI: Intel vendor id 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));
Expand Down
5 changes: 5 additions & 0 deletions src/dxgi/dxgi_options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ namespace dxvk {
else
this->nvapiHack = config.getOption<bool>("dxgi.nvapiHack", true);

if (env::getEnvVar("DXVK_HIDE_INTEL_GPU") == "0")
this->intelVendorHack = false;
else
this->intelVendorHack = config.getOption<bool>("dxgi.intelVendorHack", true);

this->enableHDR = config.getOption<bool>("dxgi.enableHDR", env::getEnvVar("DXVK_HDR") == "1");
if (this->enableHDR && isHDRDisallowed()) {
Logger::info("HDR was configured to be enabled, but has been force disabled as a UE4 DX11 game was detected.");
Expand Down
3 changes: 3 additions & 0 deletions src/dxgi/dxgi_options.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ namespace dxvk {
/// Enables nvapi workaround
bool nvapiHack;

/// Enables Intel vendor id workaround
bool intelVendorHack;

/// Enable HDR
bool enableHDR;
};
Expand Down

0 comments on commit 531999b

Please sign in to comment.