qt: Add toggle in the settings window for readbacks (#3305)

* Add readback and readback linear image toggles to the settings window

* reuse and crowdin

* clang-format... my worst enemy...

* Experimental group box (#3)

* New Groupbox

* adjustments

* revised warning on experimental group box

---------

Co-authored-by: rainmakerv2 <30595646+rainmakerv3@users.noreply.github.com>
This commit is contained in:
tomboylover93
2025-07-24 08:02:29 -03:00
committed by GitHub
parent 7ef0cc0698
commit 6a476fdb42
5 changed files with 126 additions and 48 deletions

View File

@@ -424,6 +424,8 @@ SettingsDialog::SettingsDialog(std::shared_ptr<gui_settings> gui_settings,
ui->hostMarkersCheckBox->installEventFilter(this);
ui->collectShaderCheckBox->installEventFilter(this);
ui->copyGPUBuffersCheckBox->installEventFilter(this);
ui->readbacksCheckBox->installEventFilter(this);
ui->readbackLinearImagesCheckBox->installEventFilter(this);
}
}
@@ -542,6 +544,9 @@ void SettingsDialog::LoadValuesFromConfig() {
toml::find_or<bool>(data, "GPU", "copyGPUBuffers", false));
ui->collectShaderCheckBox->setChecked(
toml::find_or<bool>(data, "Debug", "CollectShader", false));
ui->readbacksCheckBox->setChecked(toml::find_or<bool>(data, "GPU", "readbacks", false));
ui->readbackLinearImagesCheckBox->setChecked(
toml::find_or<bool>(data, "GPU", "readbackLinearImages", false));
ui->enableCompatibilityCheckBox->setChecked(
toml::find_or<bool>(data, "General", "compatibilityEnabled", false));
ui->checkCompatibilityOnStartupCheckBox->setChecked(
@@ -758,6 +763,10 @@ void SettingsDialog::updateNoteTextEdit(const QString& elementName) {
text = tr("Copy GPU Buffers:\\nGets around race conditions involving GPU submits.\\nMay or may not help with PM4 type 0 crashes.");
} else if (elementName == "collectShaderCheckBox") {
text = tr("Collect Shaders:\\nYou need this enabled to edit shaders with the debug menu (Ctrl + F10).");
} else if (elementName == "readbacksCheckBox") {
text = tr("Enable Readbacks:\\nEnable GPU memory readbacks and writebacks.\\nThis is required for proper behavior in some games.\\nMight cause stability and/or performance issues.");
} else if (elementName == "readbackLinearImagesCheckBox") {
text = tr("Enable Readback Linear Images:\\nEnables async downloading of GPU modified linear images.\\nMight fix issues in some games.");
} else if (elementName == "separateLogFilesCheckbox") {
text = tr("Separate Log Files:\\nWrites a separate logfile for each game.");}
// clang-format on
@@ -828,6 +837,8 @@ void SettingsDialog::UpdateSettings() {
Config::setVkHostMarkersEnabled(ui->hostMarkersCheckBox->isChecked());
Config::setVkGuestMarkersEnabled(ui->guestMarkersCheckBox->isChecked());
Config::setVkCrashDiagnosticEnabled(ui->crashDiagnosticsCheckBox->isChecked());
Config::setReadbacks(ui->readbacksCheckBox->isChecked());
Config::setReadbackLinearImages(ui->readbackLinearImagesCheckBox->isChecked());
Config::setCollectShaderForDebug(ui->collectShaderCheckBox->isChecked());
Config::setCopyGPUCmdBuffers(ui->copyGPUBuffersCheckBox->isChecked());
m_gui_settings->SetValue(gui::gen_checkForUpdates, ui->updateCheckBox->isChecked());