diff --git a/src/common/config.cpp b/src/common/config.cpp index 9226a5bdf..c3f25b4b5 100644 --- a/src/common/config.cpp +++ b/src/common/config.cpp @@ -415,6 +415,10 @@ void setReadbacks(bool enable) { readbacksEnabled = enable; } +void setReadbackLinearImages(bool enable) { + readbackLinearImagesEnabled = enable; +} + void setDirectMemoryAccess(bool enable) { directMemoryAccessEnabled = enable; } diff --git a/src/common/config.h b/src/common/config.h index 81e54da3f..d3e693a2b 100644 --- a/src/common/config.h +++ b/src/common/config.h @@ -54,6 +54,7 @@ void setCopyGPUCmdBuffers(bool enable); bool readbacks(); void setReadbacks(bool enable); bool readbackLinearImages(); +void setReadbackLinearImages(bool enable); bool directMemoryAccess(); void setDirectMemoryAccess(bool enable); bool dumpShaders(); diff --git a/src/qt_gui/settings_dialog.cpp b/src/qt_gui/settings_dialog.cpp index 3ff308d72..4b89ff26d 100644 --- a/src/qt_gui/settings_dialog.cpp +++ b/src/qt_gui/settings_dialog.cpp @@ -424,6 +424,8 @@ SettingsDialog::SettingsDialog(std::shared_ptr 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(data, "GPU", "copyGPUBuffers", false)); ui->collectShaderCheckBox->setChecked( toml::find_or(data, "Debug", "CollectShader", false)); + ui->readbacksCheckBox->setChecked(toml::find_or(data, "GPU", "readbacks", false)); + ui->readbackLinearImagesCheckBox->setChecked( + toml::find_or(data, "GPU", "readbackLinearImages", false)); ui->enableCompatibilityCheckBox->setChecked( toml::find_or(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()); diff --git a/src/qt_gui/settings_dialog.ui b/src/qt_gui/settings_dialog.ui index 8cb2fc50c..be78794fc 100644 --- a/src/qt_gui/settings_dialog.ui +++ b/src/qt_gui/settings_dialog.ui @@ -73,8 +73,8 @@ 0 0 - 944 - 537 + 946 + 540 @@ -369,8 +369,8 @@ 0 0 - 414 - 69 + 375 + 68 @@ -538,8 +538,8 @@ 0 0 - 944 - 537 + 946 + 540 @@ -987,8 +987,8 @@ 0 0 - 944 - 537 + 946 + 540 @@ -1282,8 +1282,8 @@ 0 0 - 944 - 537 + 946 + 540 @@ -1524,8 +1524,8 @@ 0 0 - 944 - 537 + 946 + 540 @@ -1789,8 +1789,8 @@ 0 0 - 944 - 537 + 946 + 540 @@ -1931,8 +1931,8 @@ 0 0 - 944 - 537 + 946 + 540 @@ -2088,58 +2088,58 @@ - - - - 0 - 0 - - - - Advanced - - - Qt::AlignmentFlag::AlignLeading|Qt::AlignmentFlag::AlignLeft|Qt::AlignmentFlag::AlignTop - - - - - + + + + + + 0 + 0 + + + + Advanced + + + Qt::AlignmentFlag::AlignLeading|Qt::AlignmentFlag::AlignLeft|Qt::AlignmentFlag::AlignTop + + + Collect Shaders - - - - Copy GPU Buffers - - - - + Enable Crash Diagnostics - + + + + Copy GPU Buffers + + + + Host Debug Markers - + Guest Debug Markers - + Separate Log Files @@ -2147,9 +2147,55 @@ - - - + + + + + + + + Experimental Features + + + + + + Enable Readbacks + + + + + + + Enable Readback Linear Images + + + + + + + + + + + 11 + true + + + + WARNING: These features are experimental and should not be enabled unless you were told to, or a game requires it. Please ask in the shadPS4 Discord server if you have any questions. + + + Qt::AlignmentFlag::AlignLeading|Qt::AlignmentFlag::AlignLeft|Qt::AlignmentFlag::AlignTop + + + true + + + + + + @@ -2188,4 +2234,4 @@ - \ No newline at end of file + diff --git a/src/qt_gui/translations/en_US.ts b/src/qt_gui/translations/en_US.ts index 209bcf378..b95e0687d 100644 --- a/src/qt_gui/translations/en_US.ts +++ b/src/qt_gui/translations/en_US.ts @@ -1694,6 +1694,14 @@ Guest Debug Markers Guest Debug Markers + + Enable Readbacks + Enable Readbacks + + + Enable Readback Linear Images + Enable Readback Linear Images + Update Update @@ -1922,6 +1930,14 @@ Crash Diagnostics:\nCreates a .yaml file with info about the Vulkan state at the time of crashing.\nUseful for debugging 'Device lost' errors. If you have this enabled, you should enable Host AND Guest Debug Markers.\nDoes not work on Intel GPUs.\nYou need Vulkan Validation Layers enabled and the Vulkan SDK for this to work. Crash Diagnostics:\nCreates a .yaml file with info about the Vulkan state at the time of crashing.\nUseful for debugging 'Device lost' errors. If you have this enabled, you should enable Host AND Guest Debug Markers.\nDoes not work on Intel GPUs.\nYou need Vulkan Validation Layers enabled and the Vulkan SDK for this to work. + + Enable Readbacks:\nEnable GPU memory readbacks and writebacks.\nThis is required for proper behavior in some games.\nMight cause stability and/or performance issues. + Enable Readbacks:\nEnable GPU memory readbacks and writebacks.\nThis is required for proper behavior in some games.\nMight cause stability and/or performance issues. + + + Enable Readback Linear Images:\nEnables async downloading of GPU modified linear images.\nMight fix issues in some games. + Enable Readback Linear Images:\nEnables async downloading of GPU modified linear images.\nMight fix issues in some games. + Copy GPU Buffers:\nGets around race conditions involving GPU submits.\nMay or may not help with PM4 type 0 crashes. Copy GPU Buffers:\nGets around race conditions involving GPU submits.\nMay or may not help with PM4 type 0 crashes.