diff options
| author | Zephyron <zephyron@citron-emu.org> | 2025-01-27 15:34:00 +1000 |
|---|---|---|
| committer | Mike Lothian <mike@fireburn.co.uk> | 2025-05-11 14:29:04 +0100 |
| commit | f50aa799dfe956b0a041a74db89a764454980ed2 (patch) | |
| tree | c8fa6fd6fa00cfc2a0ebf63dd4dc21cbf6fd95da /src | |
| parent | b5371eb41a044c0f85e3c8515870d658a3f442b5 (diff) | |
vulkan: Relax VRAM allocation limits for better stability
Adjusts VRAM allocation strategy to be more conservative while maintaining
performance:
- Increases reserve memory from 1/8th to 1/4th (max 2GB) for discrete GPUs
- Increases base memory limit from 6GB to 8GB
- Doubles resolution scaling memory from 1GB to 2GB per scale factor
- Reduces system memory reservation from 8GB to 4GB for integrated GPUs
- Increases maximum memory limit from 4GB to 6GB for integrated GPUs
These changes help prevent memory leaks while still providing adequate
VRAM for optimal performance.
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/vulkan_common/vulkan_device.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/video_core/vulkan_common/vulkan_device.cpp b/src/video_core/vulkan_common/vulkan_device.cpp index 5e2c5c645..99c103230 100644 --- a/src/video_core/vulkan_common/vulkan_device.cpp +++ b/src/video_core/vulkan_common/vulkan_device.cpp @@ -1333,22 +1333,24 @@ void Device::CollectPhysicalMemoryInfo() { device_access_memory += mem_properties.memoryHeaps[element].size; } if (!is_integrated) { - const u64 reserve_memory = std::min<u64>(device_access_memory / 8, 1_GiB); + // Increase reserve memory to be more conservative + const u64 reserve_memory = std::min<u64>(device_access_memory / 4, 2_GiB); device_access_memory -= reserve_memory; if (Settings::values.vram_usage_mode.GetValue() != Settings::VramUsageMode::Aggressive) { - // Account for resolution scaling in memory limits - const size_t normal_memory = 6_GiB; - const size_t scaler_memory = 1_GiB * Settings::values.resolution_info.ScaleUp(1); + // Increase base memory limit and scale factor for resolution scaling + const size_t normal_memory = 8_GiB; + const size_t scaler_memory = 2_GiB * Settings::values.resolution_info.ScaleUp(1); device_access_memory = std::min<u64>(device_access_memory, normal_memory + scaler_memory); } return; } + // For integrated GPUs, be more conservative with memory limits const s64 available_memory = static_cast<s64>(device_access_memory - device_initial_usage); device_access_memory = static_cast<u64>(std::max<s64>( - std::min<s64>(available_memory - 8_GiB, 4_GiB), std::min<s64>(local_memory, 4_GiB))); + std::min<s64>(available_memory - 4_GiB, 6_GiB), std::min<s64>(local_memory, 6_GiB))); } void Device::CollectToolingInfo() { |
