some more formatting fixes and proper rename

This commit is contained in:
Martin Felke 2023-06-05 00:28:03 +02:00
commit d194ca58c4
5 changed files with 7 additions and 6 deletions

View file

@ -257,7 +257,7 @@ void RestoreGlobalState(bool is_powered_on) {
// this function only makes sense with integrated devices // this function only makes sense with integrated devices
u64 RamPercentToBytes(u8 percent) { u64 RamPercentageToBytes(u8 percent) {
// total RAM in bytes // total RAM in bytes
u64 total_ram = Common::GetMemInfo().TotalPhysicalMemory; u64 total_ram = Common::GetMemInfo().TotalPhysicalMemory;

View file

@ -615,6 +615,6 @@ void UpdateRescalingInfo();
// Restore the global state of all applicable settings in the Values struct // Restore the global state of all applicable settings in the Values struct
void RestoreGlobalState(bool is_powered_on); void RestoreGlobalState(bool is_powered_on);
u64 RamPercentToBytes(u8 percent); u64 RamPercentageToBytes(u8 percent);
} // namespace Settings } // namespace Settings

View file

@ -292,7 +292,7 @@ u64 Device::GetTotalDedicatedVideoMemory() const {
if (Settings::values.use_vram_percentage.GetValue()) { if (Settings::values.use_vram_percentage.GetValue()) {
u8 percent = Settings::values.vram_percentage.GetValue(); u8 percent = Settings::values.vram_percentage.GetValue();
return Settings::RamPercentToBytes(percent); return Settings::RamPercentageToBytes(percent);
} else { } else {
// this is according to both former settings in the gl_buffer_cache // this is according to both former settings in the gl_buffer_cache
// and gl_texture_cache, regarding device_access_memory // and gl_texture_cache, regarding device_access_memory

View file

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

View file

@ -180,8 +180,9 @@ void ConfigureGraphicsAdvanced::SetupPerGameUI() {
ui->use_vram_percentage, Settings::values.use_vram_percentage, use_vram_percentage); ui->use_vram_percentage, Settings::values.use_vram_percentage, use_vram_percentage);
connect(ui->use_vram_percentage, &QCheckBox::clicked, ui->vram_percentage, [this]() { connect(ui->use_vram_percentage, &QCheckBox::clicked, ui->vram_percentage, [this]() {
ui->vram_percentage->setEnabled(ui->use_vram_percentage->isChecked() && ui->vram_percentage->setEnabled(
(use_vram_percentage != ConfigurationShared::CheckState::Global)); ui->use_vram_percentage->isChecked() &&
(use_vram_percentage != ConfigurationShared::CheckState::Global));
}); });
} }