mirror of
https://github.com/doitsujin/dxvk.git
synced 2024-12-13 16:08:50 +01:00
[dxvk] Don't shrink HVV heap if it's the main video memory heap
May fix issues on RBAR-enabled Nvidia systems.
This commit is contained in:
parent
703cc78cc0
commit
a268de51e3
@ -202,6 +202,17 @@ namespace dxvk {
|
||||
m_memTypes[i].memTypeId = i;
|
||||
}
|
||||
|
||||
/* Check what kind of heap the HVV memory type is on, if any. If the
|
||||
* HVV memory type is on the largest device-local heap, we either have
|
||||
* an UMA system or an RBAR-enabled system. Otherwise, there will likely
|
||||
* be a separate, smaller heap for it. */
|
||||
VkDeviceSize largestDeviceLocalHeap = 0;
|
||||
|
||||
for (uint32_t i = 0; i < m_memProps.memoryTypeCount; i++) {
|
||||
if (m_memTypes[i].memType.propertyFlags & VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT)
|
||||
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)) {
|
||||
@ -212,9 +223,10 @@ namespace dxvk {
|
||||
|
||||
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;
|
||||
VkMemoryPropertyFlags hvvFlags = VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT | VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT;
|
||||
|
||||
if ((m_memTypes[i].memType.propertyFlags & flags) == flags)
|
||||
if ((m_memTypes[i].memType.propertyFlags & hvvFlags) == hvvFlags
|
||||
&& (m_memTypes[i].heap->properties.size < largestDeviceLocalHeap))
|
||||
m_memTypes[i].heap->budget = 32 << 20;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user