[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. # Controls Nvidia HVV behaviour.
# #
# Disables the host-visible, device-local heap on Nvidia drivers. This # Restricts use of the host-visible, device-local heap on Nvidia drivers.
# is used to avoid NVIDIA driver bug 3114283 on affected drivers, as # 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 # well as in specific games on newer drivers.
# affected drivers.
# #
# Supported values: # Supported values:
# - Auto: Don't change the default # - True: Restrict HVV usage
# - True, False: Always enable / disable # - False: Do not restrict HVV usage
# dxvk.shrinkNvidiaHvvHeap = Auto # dxvk.shrinkNvidiaHvvHeap = False
# Controls graphics pipeline library behaviour # Controls graphics pipeline library behaviour

View File

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

View File

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

View File

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