[dxgi] Add separate option to override vendor IDs for NVK

This commit is contained in:
Philip Rebohle 2024-03-06 14:40:39 +01:00
parent 20490b678f
commit 0414bbe2d5
5 changed files with 25 additions and 10 deletions

View File

@ -62,7 +62,7 @@
# Report Nvidia GPUs as AMD GPUs. Unless NVAPI support is explicitly
# enabled through proton, this is done by default in order to work
# enabled through Proton, this is done by default in order to work
# around crashes or low performance with Nvidia-speciic code paths
# in games, especially Unreal Engine.
#
@ -71,6 +71,13 @@
# dxgi.hideNvidiaGpu = Auto
# Report Nvidia GPUs running on NVK as AMD GPUs.
#
# Supported values: Auto, True, False
# dxgi.hideNvkGpu = Auto
# Report AMD GPUs as Nvidia GPUs. This is only done for games that are
# known to have issues with AMDAGS or other AMD-specific code paths.
#

View File

@ -272,7 +272,8 @@ namespace dxvk {
auto deviceProp = m_adapter->deviceProperties();
auto memoryProp = m_adapter->memoryProperties();
auto vk11 = m_adapter->devicePropertiesExt().vk11;
auto vk12 = m_adapter->devicePropertiesExt().vk12;
// Custom Vendor / Device ID
if (options->customVendorId >= 0)
deviceProp.vendorID = options->customVendorId;
@ -298,7 +299,10 @@ namespace dxvk {
fallbackDevice = 0x2487;
}
bool hideGpu = (deviceProp.vendorID == uint16_t(DxvkGpuVendor::Nvidia) && options->hideNvidiaGpu)
bool hideNvidiaGpu = vk12.driverID == VK_DRIVER_ID_NVIDIA_PROPRIETARY
? options->hideNvidiaGpu : options->hideNvkGpu;
bool hideGpu = (deviceProp.vendorID == uint16_t(DxvkGpuVendor::Nvidia) && hideNvidiaGpu)
|| (deviceProp.vendorID == uint16_t(DxvkGpuVendor::Amd) && options->hideAmdGpu)
|| (deviceProp.vendorID == uint16_t(DxvkGpuVendor::Intel) && options->hideIntelGpu);

View File

@ -84,14 +84,11 @@ namespace dxvk {
this->hideNvidiaGpu = !isNvapiEnabled();
Tristate hideNvidiaGpuOption = config.getOption<Tristate>("dxgi.hideNvidiaGpu", Tristate::Auto);
if (hideNvidiaGpuOption == Tristate::Auto && !config.getOption<bool>("dxgi.nvapiHack", true)) {
Logger::warn("dxgi.nvapiHack is deprecated, please set dxgi.hideNvidiaGpu instead.");
hideNvidiaGpuOption = Tristate::False;
}
applyTristate(this->hideNvidiaGpu, hideNvidiaGpuOption);
// Always hide NVK devices by default since some NVAPI functionality may not work
this->hideNvkGpu = config.getOption<Tristate>("dxgi.hideNvkGpu", Tristate::Auto) == Tristate::True;
// Expose AMD and Intel GPU by default, unless a config override is active.
// Implement as a tristate so that we have the option to introduce similar
// logic to Nvidia later, if necessary.

View File

@ -33,9 +33,13 @@ namespace dxvk {
/// Emulate UMA
bool emulateUMA;
/// Reports Nvidia GPUs as a different vendor (usually AMD)
/// Reports Nvidia GPUs running on the proprietary driver as a different
/// vendor (usually AMD). Proton will generally disable this option.
bool hideNvidiaGpu;
/// Reports Nvidia GPUs running on NVK as a different vendor (usually AMD)
bool hideNvkGpu;
/// Reports AMD GPUs as a different vendor (usually Nvidia)
bool hideAmdGpu;

View File

@ -58,11 +58,13 @@ namespace dxvk {
* Intel needs to match the AMD result */
{ R"(\\(farcry3|fc3_blooddragon)_d3d11\.exe$)", {{
{ "dxgi.hideNvidiaGpu", "False" },
{ "dxgi.hideNvkGpu", "False" },
{ "dxgi.hideIntelGpu", "True" },
}} },
/* Far Cry 4 and Primal: Same as Far Cry 3 */
{ R"(\\(FarCry4|FCPrimal)\.exe$)", {{
{ "dxgi.hideNvidiaGpu", "False" },
{ "dxgi.hideNvkGpu", "False" },
{ "dxgi.hideIntelGpu", "True" },
}} },
/* Frostpunk: Renders one frame with D3D9 *
@ -891,6 +893,7 @@ namespace dxvk {
* GPU unless dxgi Id match actual GPU Id */
{ R"(\\Diablo IV\.exe$)", {{
{ "dxgi.hideNvidiaGpu", "False" },
{ "dxgi.hideNvkGpu", "False" },
}} },
/* WILD HEARTS™ *
* D3D12 title using D3D11 device for *