diff options
| author | Fernando S <fsahmkow27@gmail.com> | 2023-05-24 03:55:45 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-05-24 03:55:45 +0200 |
| commit | 76f63889692a0836dafd626841aa050ef26b407b (patch) | |
| tree | 442b586dc2ead257e4411101b05a06298c97e423 /src/video_core/vulkan_common/vulkan_device.cpp | |
| parent | a5d4c3e5add279f22635ceaffa0c4690e2c9662a (diff) | |
| parent | 415c78b87c008f0d963679ea9bc06c8aa566b506 (diff) | |
Merge pull request #10398 from liamwhite/bcn
video_core: add ASTC recompression
Diffstat (limited to 'src/video_core/vulkan_common/vulkan_device.cpp')
| -rw-r--r-- | src/video_core/vulkan_common/vulkan_device.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/video_core/vulkan_common/vulkan_device.cpp b/src/video_core/vulkan_common/vulkan_device.cpp index c0b2b3e17..3a7c2dedf 100644 --- a/src/video_core/vulkan_common/vulkan_device.cpp +++ b/src/video_core/vulkan_common/vulkan_device.cpp @@ -1001,6 +1001,11 @@ u64 Device::GetDeviceMemoryUsage() const { } void Device::CollectPhysicalMemoryInfo() { + // 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); + + // Calculate limits using memory budget VkPhysicalDeviceMemoryBudgetPropertiesEXT budget{}; budget.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_BUDGET_PROPERTIES_EXT; const auto mem_info = @@ -1030,6 +1035,7 @@ void Device::CollectPhysicalMemoryInfo() { if (!is_integrated) { const u64 reserve_memory = std::min<u64>(device_access_memory / 8, 1_GiB); device_access_memory -= reserve_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); |
