From d194ca58c41427c590df0e7c8e292e350eb301f4 Mon Sep 17 00:00:00 2001 From: Martin Felke Date: Mon, 5 Jun 2023 00:28:03 +0200 Subject: [PATCH] some more formatting fixes and proper rename --- src/common/settings.cpp | 2 +- src/common/settings.h | 2 +- src/video_core/renderer_opengl/gl_device.cpp | 2 +- src/video_core/vulkan_common/vulkan_device.cpp | 2 +- src/yuzu/configuration/configure_graphics_advanced.cpp | 5 +++-- 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/common/settings.cpp b/src/common/settings.cpp index 7f92a97cb3..5d44fd7fee 100644 --- a/src/common/settings.cpp +++ b/src/common/settings.cpp @@ -257,7 +257,7 @@ void RestoreGlobalState(bool is_powered_on) { // this function only makes sense with integrated devices -u64 RamPercentToBytes(u8 percent) { +u64 RamPercentageToBytes(u8 percent) { // total RAM in bytes u64 total_ram = Common::GetMemInfo().TotalPhysicalMemory; diff --git a/src/common/settings.h b/src/common/settings.h index 1410598937..ffaaa6caf9 100644 --- a/src/common/settings.h +++ b/src/common/settings.h @@ -615,6 +615,6 @@ void UpdateRescalingInfo(); // Restore the global state of all applicable settings in the Values struct void RestoreGlobalState(bool is_powered_on); -u64 RamPercentToBytes(u8 percent); +u64 RamPercentageToBytes(u8 percent); } // namespace Settings diff --git a/src/video_core/renderer_opengl/gl_device.cpp b/src/video_core/renderer_opengl/gl_device.cpp index 021bfecd31..c01517dde2 100644 --- a/src/video_core/renderer_opengl/gl_device.cpp +++ b/src/video_core/renderer_opengl/gl_device.cpp @@ -292,7 +292,7 @@ u64 Device::GetTotalDedicatedVideoMemory() const { if (Settings::values.use_vram_percentage.GetValue()) { u8 percent = Settings::values.vram_percentage.GetValue(); - return Settings::RamPercentToBytes(percent); + return Settings::RamPercentageToBytes(percent); } else { // this is according to both former settings in the gl_buffer_cache // and gl_texture_cache, regarding device_access_memory diff --git a/src/video_core/vulkan_common/vulkan_device.cpp b/src/video_core/vulkan_common/vulkan_device.cpp index d52218e5ef..e6fe9f94e5 100644 --- a/src/video_core/vulkan_common/vulkan_device.cpp +++ b/src/video_core/vulkan_common/vulkan_device.cpp @@ -1042,7 +1042,7 @@ void Device::CollectPhysicalMemoryInfo() { const u8 percent = Settings::values.vram_percentage.GetValue(); const s64 available_memory = static_cast(device_access_memory - device_initial_usage); const s64 limit = Settings::values.use_vram_percentage.GetValue() - ? Settings::RamPercentToBytes(percent) + ? Settings::RamPercentageToBytes(percent) : 4_GiB; device_access_memory = static_cast(std::max( std::min(available_memory - 8_GiB, 4_GiB), std::min(local_memory, limit))); diff --git a/src/yuzu/configuration/configure_graphics_advanced.cpp b/src/yuzu/configuration/configure_graphics_advanced.cpp index 37afdb04c9..ba0472b20b 100644 --- a/src/yuzu/configuration/configure_graphics_advanced.cpp +++ b/src/yuzu/configuration/configure_graphics_advanced.cpp @@ -180,8 +180,9 @@ void ConfigureGraphicsAdvanced::SetupPerGameUI() { ui->use_vram_percentage, Settings::values.use_vram_percentage, use_vram_percentage); connect(ui->use_vram_percentage, &QCheckBox::clicked, ui->vram_percentage, [this]() { - ui->vram_percentage->setEnabled(ui->use_vram_percentage->isChecked() && - (use_vram_percentage != ConfigurationShared::CheckState::Global)); + ui->vram_percentage->setEnabled( + ui->use_vram_percentage->isChecked() && + (use_vram_percentage != ConfigurationShared::CheckState::Global)); }); }