mirror of
https://github.com/EduApps-CDG/OpenDX
synced 2024-12-30 09:45:37 +01:00
[dxvk] Rework Nvidia HVV option
This commit is contained in:
parent
8912c7adb0
commit
778aee0372
12
dxvk.conf
12
dxvk.conf
@ -227,18 +227,18 @@
|
|||||||
# dxvk.useRawSsbo = Auto
|
# dxvk.useRawSsbo = Auto
|
||||||
|
|
||||||
|
|
||||||
# Controls workaround for NVIDIA HVV Heap bug.
|
# Controls Nvidia HVV behaviour.
|
||||||
#
|
#
|
||||||
# Limits the budget of NVIDIA's HVV (host-visible,
|
# Disables the host-visible, device-local heap on Nvidia drivers. This
|
||||||
# device-local) heap to be half of the reported size. This is
|
# is used to avoid NVIDIA driver bug 3114283 on affected drivers, as
|
||||||
# needed to avoid NVIDIA driver bug 3114283, and defaults to
|
# well as in specific games on newer drivers.being enabled on all
|
||||||
# being enabled on all affected drivers.
|
# affected drivers.
|
||||||
#
|
#
|
||||||
# Supported values:
|
# Supported values:
|
||||||
# - Auto: Don't change the default
|
# - Auto: Don't change the default
|
||||||
# - True, False: Always enable / disable
|
# - True, False: Always enable / disable
|
||||||
|
|
||||||
# dxvk.halveNvidiaHVVHeap = Auto
|
# dxvk.disableNvidiaHvvHeap = Auto
|
||||||
|
|
||||||
|
|
||||||
# Sets enabled HUD elements
|
# Sets enabled HUD elements
|
||||||
|
@ -178,27 +178,22 @@ namespace dxvk {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Work around an issue on Nvidia drivers where using the entire
|
/* Work around an issue on Nvidia drivers where using the entire
|
||||||
* device_local | host_visible heap can cause crashes, presumably
|
* device_local | host_visible heap can cause crashes or slowdowns */
|
||||||
* due to subsequent internal driver allocations failing */
|
if (m_device->properties().core.properties.vendorID == uint16_t(DxvkGpuVendor::Nvidia)) {
|
||||||
bool nvidiaBug3114283Active = false;
|
bool shrinkNvidiaHvvHeap = device->adapter()->matchesDriver(DxvkGpuVendor::Nvidia,
|
||||||
|
VK_DRIVER_ID_NVIDIA_PROPRIETARY_KHR, 0, VK_MAKE_VERSION(465, 0, 0));
|
||||||
|
|
||||||
// Fix is available in mainline drivers starting with the 465 driver series.
|
applyTristate(shrinkNvidiaHvvHeap, device->config().shrinkNvidiaHvvHeap);
|
||||||
if (device->adapter()->matchesDriver(DxvkGpuVendor::Nvidia,
|
|
||||||
VK_DRIVER_ID_NVIDIA_PROPRIETARY_KHR,
|
|
||||||
0,
|
|
||||||
VK_MAKE_VERSION(465, 0, 0))) {
|
|
||||||
nvidiaBug3114283Active = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
applyTristate(nvidiaBug3114283Active, device->config().halveNvidiaHVVHeap);
|
if (shrinkNvidiaHvvHeap) {
|
||||||
|
for (uint32_t i = 0; i < m_memProps.memoryTypeCount; i++) {
|
||||||
|
VkMemoryPropertyFlags flags = VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT | VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT;
|
||||||
|
|
||||||
if ((m_device->properties().core.properties.vendorID == uint16_t(DxvkGpuVendor::Nvidia))
|
if ((m_memTypes[i].memType.propertyFlags & flags) == flags) {
|
||||||
&& (nvidiaBug3114283Active)) {
|
m_memTypes[i].heap->budget = 32 << 20;
|
||||||
for (uint32_t i = 0; i < m_memProps.memoryTypeCount; i++) {
|
m_memTypes[i].chunkSize = 1 << 20;
|
||||||
constexpr VkMemoryPropertyFlags flags = VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT | VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT;
|
}
|
||||||
|
}
|
||||||
if ((m_memTypes[i].memType.propertyFlags & flags) == flags)
|
|
||||||
m_memTypes[i].heap->budget = m_memTypes[i].heap->properties.size / 2;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,7 @@ namespace dxvk {
|
|||||||
enableOpenXR = config.getOption<bool> ("dxvk.enableOpenXR", true);
|
enableOpenXR = config.getOption<bool> ("dxvk.enableOpenXR", true);
|
||||||
numCompilerThreads = config.getOption<int32_t> ("dxvk.numCompilerThreads", 0);
|
numCompilerThreads = config.getOption<int32_t> ("dxvk.numCompilerThreads", 0);
|
||||||
useRawSsbo = config.getOption<Tristate>("dxvk.useRawSsbo", Tristate::Auto);
|
useRawSsbo = config.getOption<Tristate>("dxvk.useRawSsbo", Tristate::Auto);
|
||||||
halveNvidiaHVVHeap = config.getOption<Tristate>("dxvk.halveNvidiaHVVHeap", Tristate::Auto);
|
shrinkNvidiaHvvHeap = config.getOption<Tristate>("dxvk.shrinkNvidiaHvvHeap", Tristate::Auto);
|
||||||
hud = config.getOption<std::string>("dxvk.hud", "");
|
hud = config.getOption<std::string>("dxvk.hud", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,11 +24,8 @@ namespace dxvk {
|
|||||||
/// Shader-related options
|
/// Shader-related options
|
||||||
Tristate useRawSsbo;
|
Tristate useRawSsbo;
|
||||||
|
|
||||||
/// Workaround for NVIDIA driver
|
/// Workaround for NVIDIA driver bug 3114283
|
||||||
/// bug 3114283. Cut usable HVV
|
Tristate shrinkNvidiaHvvHeap;
|
||||||
/// (Host-Visible Vidmem) heap
|
|
||||||
/// in half to avoid crash
|
|
||||||
Tristate halveNvidiaHVVHeap;
|
|
||||||
|
|
||||||
/// HUD elements
|
/// HUD elements
|
||||||
std::string hud;
|
std::string hud;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user