diff --git a/dxvk.conf b/dxvk.conf index 61c1cddc..e4ff023d 100644 --- a/dxvk.conf +++ b/dxvk.conf @@ -58,6 +58,15 @@ # dxgi.maxSharedMemory = 0 +# Some games think we are on Intel given a lack of NVAPI or +# AGS/atiadlxx support. Report our device memory as shared memory, +# and some small amount for a "carveout". + +# Supported values: True, False + +# dxgi.emulateUMA = False + + # Override back buffer count for the Vulkan swap chain. # Setting this to 0 or less will have no effect. # diff --git a/src/dxgi/dxgi_adapter.cpp b/src/dxgi/dxgi_adapter.cpp index 20845092..7fe62534 100644 --- a/src/dxgi/dxgi_adapter.cpp +++ b/src/dxgi/dxgi_adapter.cpp @@ -283,6 +283,15 @@ namespace dxvk { else sharedMemory += heap.size; } + + // Some games think we are on Intel given a lack of + // NVAPI or AGS/atiadlxx support. + // Report our device memory as shared memory, + // and some small amount for the carveout. + if (options->emulateUMA && !m_adapter->isUnifiedMemoryArchitecture()) { + sharedMemory = deviceMemory; + deviceMemory = 128 * (1 << 20); + } // Some games are silly and need their memory limited if (options->maxDeviceMemory > 0 diff --git a/src/dxgi/dxgi_options.cpp b/src/dxgi/dxgi_options.cpp index a7667119..19d4e7a5 100644 --- a/src/dxgi/dxgi_options.cpp +++ b/src/dxgi/dxgi_options.cpp @@ -32,6 +32,9 @@ namespace dxvk { this->customVendorId = parsePciId(config.getOption("dxgi.customVendorId")); this->customDeviceId = parsePciId(config.getOption("dxgi.customDeviceId")); this->customDeviceDesc = config.getOption("dxgi.customDeviceDesc", ""); + + // Emulate a UMA device + this->emulateUMA = config.getOption("dxgi.emulateUMA", false); // Interpret the memory limits as Megabytes this->maxDeviceMemory = VkDeviceSize(config.getOption("dxgi.maxDeviceMemory", 0)) << 20; diff --git a/src/dxgi/dxgi_options.h b/src/dxgi/dxgi_options.h index e2c85901..8eb19d08 100644 --- a/src/dxgi/dxgi_options.h +++ b/src/dxgi/dxgi_options.h @@ -30,6 +30,9 @@ namespace dxvk { VkDeviceSize maxDeviceMemory; VkDeviceSize maxSharedMemory; + /// Emulate UMA + bool emulateUMA; + /// Enables nvapi workaround bool nvapiHack; };