diff options
| author | MaranBr <maranbr@outlook.com> | 2025-09-20 14:17:07 +0200 |
|---|---|---|
| committer | crueter <crueter@eden-emu.dev> | 2025-09-20 14:17:07 +0200 |
| commit | 725407b989b5f9021ae7f1aae664f7204cc94a47 (patch) | |
| tree | 9e8cbdbd8460645745c384807cb9cc12a9d0e1c9 /src/video_core/vulkan_common/vulkan_device.cpp | |
| parent | 6510818fca962ebee78089e79e972221dfbe3ef4 (diff) | |
[video_core] Add ability for integrated devices to control the amount of memory used by the emulator (#2528)
This adds the ability for integrated devices to control the amount of memory used by the emulator.
Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/2528
Reviewed-by: Lizzie <lizzie@eden-emu.dev>
Reviewed-by: Shinmegumi <shinmegumi@eden-emu.dev>
Co-authored-by: MaranBr <maranbr@outlook.com>
Co-committed-by: MaranBr <maranbr@outlook.com>
Diffstat (limited to 'src/video_core/vulkan_common/vulkan_device.cpp')
| -rw-r--r-- | src/video_core/vulkan_common/vulkan_device.cpp | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/video_core/vulkan_common/vulkan_device.cpp b/src/video_core/vulkan_common/vulkan_device.cpp index 6d7c33099b..41917a1b90 100644 --- a/src/video_core/vulkan_common/vulkan_device.cpp +++ b/src/video_core/vulkan_common/vulkan_device.cpp @@ -1395,23 +1395,20 @@ void Device::CollectPhysicalMemoryInfo() { } device_access_memory += mem_properties.memoryHeaps[element].size; } - if (!is_integrated) { + if (is_integrated) { + const s64 available_memory = static_cast<s64>(device_access_memory - device_initial_usage); + const u64 memory_size = Settings::values.vram_usage_mode.GetValue() == Settings::VramUsageMode::Aggressive ? 6_GiB : 4_GiB; + device_access_memory = static_cast<u64>(std::max<s64>(std::min<s64>(available_memory - 8_GiB, memory_size), std::min<s64>(local_memory, memory_size))); + } else { const u64 reserve_memory = std::min<u64>(device_access_memory / 8, 1_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); - device_access_memory = - std::min<u64>(device_access_memory, normal_memory + scaler_memory); + device_access_memory = std::min<u64>(device_access_memory, normal_memory + scaler_memory); } - - return; } - 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, 6_GiB), std::min<s64>(local_memory, 6_GiB))); } void Device::CollectToolingInfo() { |
