diff options
| author | JPikachu <jpikachu@eden-emu.dev> | 2025-08-30 19:35:53 +0200 |
|---|---|---|
| committer | crueter <crueter@eden-emu.dev> | 2025-08-30 19:35:53 +0200 |
| commit | ab015bc7305d7eec23451ec2f7b577e26f1e1ba1 (patch) | |
| tree | 8bd4eeb5130c68c79fedbcd1f310cf1bb4242c20 /src/video_core/vulkan_common/vulkan_device.cpp | |
| parent | f005f6a3abcf59641af47f420569457d20c58d05 (diff) | |
[VK] Fix asserts with incorrect memory allocations (#357)
This fixes many assertions with incorrect memory allocations. Regression introduced in PR 334.
Co-authored-by: JPikachu <jpikachu.eden@gmail.com>
Co-authored-by: MaranBr <maranbr@outlook.com>
Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/357
Reviewed-by: Lizzie <lizzie@eden-emu.dev>
Reviewed-by: crueter <crueter@eden-emu.dev>
Co-authored-by: JPikachu <jpikachu@eden-emu.dev>
Co-committed-by: JPikachu <jpikachu@eden-emu.dev>
Diffstat (limited to 'src/video_core/vulkan_common/vulkan_device.cpp')
| -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 cfa88850a0..95c0d974cc 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 / 4, 2_GiB); + 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 = 8_GiB; - const size_t scaler_memory = 2_GiB * Settings::values.resolution_info.ScaleUp(1); + 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); } @@ -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 - 4_GiB, 6_GiB), std::min<s64>(local_memory, 6_GiB))); + std::min<s64>(available_memory - 8_GiB, 6_GiB), std::min<s64>(local_memory, 6_GiB))); } void Device::CollectToolingInfo() { |
