diff --git a/src/citra_qt/configuration/configure_graphics.cpp b/src/citra_qt/configuration/configure_graphics.cpp index 44290f7831..75602a8b46 100644 --- a/src/citra_qt/configuration/configure_graphics.cpp +++ b/src/citra_qt/configuration/configure_graphics.cpp @@ -23,25 +23,19 @@ ConfigureGraphics::ConfigureGraphics(QWidget* parent) connect(ui->toggle_hw_renderer, &QCheckBox::toggled, this, [this] { auto checked = ui->toggle_hw_renderer->isChecked(); ui->hw_renderer_group->setEnabled(checked); + ui->toggle_disk_shader_cache->setEnabled(checked && ui->toggle_hw_shader->isChecked()); }); ui->hw_shader_group->setEnabled(ui->toggle_hw_shader->isChecked()); - connect(ui->toggle_hw_shader, &QCheckBox::toggled, ui->hw_shader_group, &QWidget::setEnabled); + ui->toggle_disk_shader_cache->setEnabled(ui->toggle_hw_renderer->isChecked() && + ui->toggle_hw_shader->isChecked()); - ui->toggle_disk_shader_cache->setEnabled(ui->toggle_hw_shader->isChecked() && - ui->toggle_accurate_mul->isChecked()); connect(ui->toggle_hw_shader, &QCheckBox::toggled, this, [this] { - ui->toggle_disk_shader_cache->setEnabled(ui->toggle_hw_shader->isChecked() && - ui->toggle_accurate_mul->isChecked()); - if (!ui->toggle_disk_shader_cache->isEnabled()) - ui->toggle_disk_shader_cache->setChecked(false); + auto checked = ui->toggle_hw_shader->isChecked(); + ui->hw_shader_group->setEnabled(checked); + ui->toggle_disk_shader_cache->setEnabled(checked); }); - connect(ui->toggle_accurate_mul, &QCheckBox::toggled, this, [this] { - ui->toggle_disk_shader_cache->setEnabled(ui->toggle_accurate_mul->isChecked()); - if (!ui->toggle_disk_shader_cache->isEnabled()) - ui->toggle_disk_shader_cache->setChecked(false); - }); #ifdef __APPLE__ connect(ui->toggle_hw_shader, &QCheckBox::stateChanged, this, [this](int state) { if (state == Qt::Checked) { diff --git a/src/citra_qt/configuration/configure_graphics.ui b/src/citra_qt/configuration/configure_graphics.ui index c9eb552a12..5616e1d421 100644 --- a/src/citra_qt/configuration/configure_graphics.ui +++ b/src/citra_qt/configuration/configure_graphics.ui @@ -121,7 +121,7 @@ - <html><head/><body><p>Reduce stuttering by storing and loading generated shaders to disk.</p><p>It cannot be used without Enable Hardware Shader or Accurate Multiplication.</p></body></html> + <html><head/><body><p>Reduce stuttering by storing and loading generated shaders to disk.</p></body></html> Use Disk Shader Cache diff --git a/src/video_core/renderer_opengl/gl_shader_disk_cache.cpp b/src/video_core/renderer_opengl/gl_shader_disk_cache.cpp index 58730d6ee7..a44fc299df 100644 --- a/src/video_core/renderer_opengl/gl_shader_disk_cache.cpp +++ b/src/video_core/renderer_opengl/gl_shader_disk_cache.cpp @@ -106,8 +106,8 @@ ShaderDiskCache::ShaderDiskCache(bool separable) : separable{separable} {} std::optional> ShaderDiskCache::LoadTransferable() { const bool has_title_id = GetProgramID() != 0; - if (!Settings::values.use_hw_shader || !Settings::values.shaders_accurate_mul || - !Settings::values.use_disk_shader_cache || !has_title_id) { + if (!Settings::values.use_hw_shader || !Settings::values.use_disk_shader_cache || + !has_title_id) { return std::nullopt; } tried_to_load = true; diff --git a/src/video_core/renderer_opengl/gl_shader_manager.cpp b/src/video_core/renderer_opengl/gl_shader_manager.cpp index ccbcc8875b..8a878b65a9 100644 --- a/src/video_core/renderer_opengl/gl_shader_manager.cpp +++ b/src/video_core/renderer_opengl/gl_shader_manager.cpp @@ -496,7 +496,8 @@ void ShaderProgramManager::LoadDiskCache(const std::atomic_bool& stop_loading, if (dump != dump_map.end() && decomp != decompiled_map.end()) { // Only load this shader if its sanitize_mul setting matches - if (decomp->second.sanitize_mul == VideoCore::g_hw_shader_accurate_mul) { + if (raw.GetProgramType() == ProgramType::VS && + decomp->second.sanitize_mul != VideoCore::g_hw_shader_accurate_mul) { continue; } @@ -617,6 +618,6 @@ void ShaderProgramManager::LoadDiskCache(const std::atomic_bool& stop_loading, if (precompiled_cache_altered) { disk_cache.SaveVirtualPrecompiledFile(); } -} // namespace OpenGL +} } // namespace OpenGL