formatting fixes

This commit is contained in:
Martin Felke 2023-06-04 23:43:19 +02:00
parent de5f61f8c7
commit b250b52511
4 changed files with 17 additions and 16 deletions

View file

@ -6,8 +6,8 @@
#include "common/assert.h"
#include "common/fs/path_util.h"
#include "common/logging/log.h"
#include "common/settings.h"
#include "common/memory_detect.h"
#include "common/settings.h"
namespace Settings {
@ -257,7 +257,7 @@ void RestoreGlobalState(bool is_powered_on) {
// this function only makes sense with integrated devices
u64 RAM_Percent_to_Byte(u8 percent) {
u64 RamPercentToByte(u8 percent) {
// total RAM in byte
u64 total_ram = Common::GetMemInfo().TotalPhysicalMemory;

View file

@ -292,9 +292,8 @@ u64 Device::GetTotalDedicatedVideoMemory() const {
if (Settings::values.use_vram_percentage.GetValue()) {
u8 percent = Settings::values.vram_percentage.GetValue();
return Settings::RAM_Percent_to_Byte(percent);
}
else {
return Settings::RamPercentToByte(percent);
} else {
// this is according to both former settings in the gl_buffer_cache
// and gl_texture_cache, regarding device_access_memory
return static_cast<u64>(tot_avail_mem_kb) * 1_KiB + 512_MiB;

View file

@ -1041,7 +1041,9 @@ void Device::CollectPhysicalMemoryInfo() {
}
const u8 percent = Settings::values.vram_percentage.GetValue();
const s64 available_memory = static_cast<s64>(device_access_memory - device_initial_usage);
const s64 limit = Settings::values.use_vram_percentage.GetValue() ? Settings::RAM_Percent_to_Byte(percent) : 4_GiB;
const s64 limit = Settings::values.use_vram_percentage.GetValue()
? Settings::RamPercentToByte(percent)
: 4_GiB;
device_access_memory = static_cast<u64>(std::max<s64>(
std::min<s64>(available_memory - 8_GiB, 4_GiB), std::min<s64>(local_memory, limit)));
}

View file

@ -46,15 +46,16 @@ void ConfigureGraphicsAdvanced::SetConfiguration() {
ui->use_vram_percentage->setChecked(Settings::values.use_vram_percentage.GetValue());
if (Settings::IsConfiguringGlobal()) {
ui->vram_percentage->setEnabled(Settings::values.use_vram_percentage.GetValue() && runtime_lock);
} else {
ui->vram_percentage->setEnabled(Settings::values.use_vram_percentage.GetValue() &&
use_vram_percentage != ConfigurationShared::CheckState::Global && runtime_lock);
runtime_lock);
} else {
ui->vram_percentage->setEnabled(
Settings::values.use_vram_percentage.GetValue() &&
use_vram_percentage != ConfigurationShared::CheckState::Global && runtime_lock);
}
ui->vram_percentage->setValue(Settings::values.vram_percentage.GetValue());
if (Settings::IsConfiguringGlobal()) {
ui->gpu_accuracy->setCurrentIndex(
static_cast<int>(Settings::values.gpu_accuracy.GetValue()));
@ -74,7 +75,8 @@ void ConfigureGraphicsAdvanced::SetConfiguration() {
!Settings::values.max_anisotropy.UsingGlobal());
ConfigurationShared::SetHighlight(ui->label_astc_recompression,
!Settings::values.astc_recompression.UsingGlobal());
ConfigurationShared::SetHighlight(ui->vram_percentage, !Settings::values.vram_percentage.UsingGlobal());
ConfigurationShared::SetHighlight(ui->vram_percentage,
!Settings::values.vram_percentage.UsingGlobal());
}
}
@ -105,8 +107,7 @@ void ConfigureGraphicsAdvanced::ApplyConfiguration() {
ui->enable_compute_pipelines_checkbox,
enable_compute_pipelines);
ConfigurationShared::ApplyPerGameSetting(&Settings::values.use_vram_percentage,
ui->use_vram_percentage,
use_vram_percentage);
ui->use_vram_percentage, use_vram_percentage);
Settings::values.vram_percentage.SetValue(ui->vram_percentage->value());
}
@ -175,9 +176,8 @@ void ConfigureGraphicsAdvanced::SetupPerGameUI() {
ConfigurationShared::SetColoredComboBox(
ui->astc_recompression_combobox, ui->label_astc_recompression,
static_cast<int>(Settings::values.astc_recompression.GetValue(true)));
ConfigurationShared::SetColoredTristate(ui->use_vram_percentage,
Settings::values.use_vram_percentage,
use_vram_percentage);
ConfigurationShared::SetColoredTristate(
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() &&