[dxvk] Simplify Nvidia HVV workaround

We no longer support 465 series drivers, so the check was obsolete.
This commit is contained in:
Philip Rebohle 2022-07-14 20:29:53 +02:00
parent 131af0d677
commit 81b89cf31d
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
4 changed files with 17 additions and 24 deletions

View File

@ -251,16 +251,15 @@
# Controls Nvidia HVV behaviour.
#
# Disables the host-visible, device-local heap on Nvidia drivers. This
# is used to avoid NVIDIA driver bug 3114283 on affected drivers, as
# well as in specific games on newer drivers.being enabled on all
# affected drivers.
# Restricts use of the host-visible, device-local heap on Nvidia drivers.
# This is used to avoid NVIDIA driver bug 3114283 on affected drivers, as
# well as in specific games on newer drivers.
#
# Supported values:
# - Auto: Don't change the default
# - True, False: Always enable / disable
# - True: Restrict HVV usage
# - False: Do not restrict HVV usage
# dxvk.shrinkNvidiaHvvHeap = Auto
# dxvk.shrinkNvidiaHvvHeap = False
# Controls graphics pipeline library behaviour

View File

@ -214,22 +214,16 @@ namespace dxvk {
largestDeviceLocalHeap = std::max(largestDeviceLocalHeap, m_memTypes[i].heap->properties.size);
}
/* Work around an issue on Nvidia drivers where using the entire
* device_local | host_visible heap can cause crashes or slowdowns */
if (m_device->properties().core.properties.vendorID == uint16_t(DxvkGpuVendor::Nvidia)) {
bool shrinkNvidiaHvvHeap = device->adapter()->matchesDriver(
VK_DRIVER_ID_NVIDIA_PROPRIETARY_KHR, 0, VK_MAKE_VERSION(465, 0, 0));
/* Work around an issue on Nvidia drivers where using the
* entire HVV heap can cause slowdowns in specific games */
if (device->adapter()->matchesDriver(VK_DRIVER_ID_NVIDIA_PROPRIETARY_KHR, 0, 0)
&& device->config().shrinkNvidiaHvvHeap) {
for (uint32_t i = 0; i < m_memProps.memoryTypeCount; i++) {
VkMemoryPropertyFlags hvvFlags = VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT | VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT;
applyTristate(shrinkNvidiaHvvHeap, device->config().shrinkNvidiaHvvHeap);
if (shrinkNvidiaHvvHeap) {
for (uint32_t i = 0; i < m_memProps.memoryTypeCount; i++) {
VkMemoryPropertyFlags hvvFlags = VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT | VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT;
if ((m_memTypes[i].memType.propertyFlags & hvvFlags) == hvvFlags
&& (m_memTypes[i].heap->properties.size < largestDeviceLocalHeap))
m_memTypes[i].heap->budget = 32 << 20;
}
if ((m_memTypes[i].memType.propertyFlags & hvvFlags) == hvvFlags
&& (m_memTypes[i].heap->properties.size < largestDeviceLocalHeap))
m_memTypes[i].heap->budget = 32 << 20;
}
}
}

View File

@ -8,7 +8,7 @@ namespace dxvk {
numCompilerThreads = config.getOption<int32_t> ("dxvk.numCompilerThreads", 0);
enableGraphicsPipelineLibrary = config.getOption<Tristate>("dxvk.enableGraphicsPipelineLibrary", Tristate::Auto);
useRawSsbo = config.getOption<Tristate>("dxvk.useRawSsbo", Tristate::Auto);
shrinkNvidiaHvvHeap = config.getOption<Tristate>("dxvk.shrinkNvidiaHvvHeap", Tristate::Auto);
shrinkNvidiaHvvHeap = config.getOption<bool> ("dxvk.shrinkNvidiaHvvHeap", false);
hud = config.getOption<std::string>("dxvk.hud", "");
}

View File

@ -25,7 +25,7 @@ namespace dxvk {
Tristate useRawSsbo;
/// Workaround for NVIDIA driver bug 3114283
Tristate shrinkNvidiaHvvHeap;
bool shrinkNvidiaHvvHeap;
/// HUD elements
std::string hud;