diff options
| author | JPikachu <jpikachu@eden-emu.dev> | 2025-08-27 22:19:17 +0200 |
|---|---|---|
| committer | crueter <crueter@eden-emu.dev> | 2025-08-27 22:19:17 +0200 |
| commit | 37375220e8dafd35e35f0eabfa7771e8ef61143a (patch) | |
| tree | a0257852a4626d20ca9c43a08e2328f81f39cbe6 /src | |
| parent | 9fae048a5a2c63777c080f0c432d31997de7478a (diff) | |
[VK] Refine VRAM allocation strategy for improved stability and performance (#334)
These adjustments enhance memory management,
While increasing shader performance across all GPU types, including iGPUs.
This commit fixes a bug in Super Mario Odyssey where loading into a new area or pausing the game
Would cause the whole game to slow down (Most noticeable on RDNA 2 GPUs like the Steam Deck)
Thank you to all of our testers for helping eliminate this bug,
And thank you to Camille for the instructions/commit and to Zephyron for addressing this in Citron.
Co-authored-by: JPikachu <jpikachu.eden@gmail.com>
Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/334
Reviewed-by: CamilleLaVey <camillelavey99@gmail.com>
Co-authored-by: JPikachu <jpikachu@eden-emu.dev>
Co-committed-by: JPikachu <jpikachu@eden-emu.dev>
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/vulkan_common/vulkan_device.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/video_core/vulkan_common/vulkan_device.cpp b/src/video_core/vulkan_common/vulkan_device.cpp index 6bd6eab009..cfa88850a0 100644 --- a/src/video_core/vulkan_common/vulkan_device.cpp +++ b/src/video_core/vulkan_common/vulkan_device.cpp @@ -1378,13 +1378,13 @@ 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); + 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); + 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); } @@ -1393,7 +1393,7 @@ void Device::CollectPhysicalMemoryInfo() { } 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() { |
