[dxgi] Add emulateUMA option

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".
This commit is contained in:
Joshua Ashton 2021-05-12 00:00:02 +01:00 committed by Philip Rebohle
parent fe0dc2d579
commit 15e0594ec4
4 changed files with 24 additions and 0 deletions

View File

@ -58,6 +58,15 @@
# dxgi.maxSharedMemory = 0 # 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. # Override back buffer count for the Vulkan swap chain.
# Setting this to 0 or less will have no effect. # Setting this to 0 or less will have no effect.
# #

View File

@ -283,6 +283,15 @@ namespace dxvk {
else else
sharedMemory += heap.size; 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 // Some games are silly and need their memory limited
if (options->maxDeviceMemory > 0 if (options->maxDeviceMemory > 0

View File

@ -32,6 +32,9 @@ namespace dxvk {
this->customVendorId = parsePciId(config.getOption<std::string>("dxgi.customVendorId")); this->customVendorId = parsePciId(config.getOption<std::string>("dxgi.customVendorId"));
this->customDeviceId = parsePciId(config.getOption<std::string>("dxgi.customDeviceId")); this->customDeviceId = parsePciId(config.getOption<std::string>("dxgi.customDeviceId"));
this->customDeviceDesc = config.getOption<std::string>("dxgi.customDeviceDesc", ""); this->customDeviceDesc = config.getOption<std::string>("dxgi.customDeviceDesc", "");
// Emulate a UMA device
this->emulateUMA = config.getOption<bool>("dxgi.emulateUMA", false);
// Interpret the memory limits as Megabytes // Interpret the memory limits as Megabytes
this->maxDeviceMemory = VkDeviceSize(config.getOption<int32_t>("dxgi.maxDeviceMemory", 0)) << 20; this->maxDeviceMemory = VkDeviceSize(config.getOption<int32_t>("dxgi.maxDeviceMemory", 0)) << 20;

View File

@ -30,6 +30,9 @@ namespace dxvk {
VkDeviceSize maxDeviceMemory; VkDeviceSize maxDeviceMemory;
VkDeviceSize maxSharedMemory; VkDeviceSize maxSharedMemory;
/// Emulate UMA
bool emulateUMA;
/// Enables nvapi workaround /// Enables nvapi workaround
bool nvapiHack; bool nvapiHack;
}; };