Merge pull request #5072 from jroweboy/dont-load-hwshader-when-disabled

Dont load Disk Cache when HWShader is disabled
This commit is contained in:
James Rowe 2020-01-22 14:18:10 -07:00 committed by GitHub
commit be17f0851e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 3 deletions

View File

@ -42,6 +42,8 @@ ConfigureEnhancements::ConfigureEnhancements(QWidget* parent)
if (!ui->toggle_preload_textures->isEnabled())
ui->toggle_preload_textures->setChecked(false);
});
ui->toggle_disk_shader_cache->setEnabled(Settings::values.use_hw_shader);
}
void ConfigureEnhancements::SetConfiguration() {
@ -52,7 +54,8 @@ void ConfigureEnhancements::SetConfiguration() {
ui->toggle_linear_filter->setChecked(Settings::values.filter_mode);
ui->layout_combobox->setCurrentIndex(static_cast<int>(Settings::values.layout_option));
ui->swap_screen->setChecked(Settings::values.swap_screen);
ui->toggle_disk_shader_cache->setChecked(Settings::values.use_disk_shader_cache);
ui->toggle_disk_shader_cache->setChecked(Settings::values.use_hw_shader &&
Settings::values.use_disk_shader_cache);
ui->upright_screen->setChecked(Settings::values.upright_screen);
ui->toggle_dump_textures->setChecked(Settings::values.dump_textures);
ui->toggle_custom_textures->setChecked(Settings::values.custom_textures);
@ -101,7 +104,8 @@ void ConfigureEnhancements::ApplyConfiguration() {
Settings::values.layout_option =
static_cast<Settings::LayoutOption>(ui->layout_combobox->currentIndex());
Settings::values.swap_screen = ui->swap_screen->isChecked();
Settings::values.use_disk_shader_cache = ui->toggle_disk_shader_cache->isChecked();
Settings::values.use_disk_shader_cache =
Settings::values.use_hw_shader && ui->toggle_disk_shader_cache->isChecked();
Settings::values.upright_screen = ui->upright_screen->isChecked();
Settings::values.dump_textures = ui->toggle_dump_textures->isChecked();
Settings::values.custom_textures = ui->toggle_custom_textures->isChecked();

View File

@ -106,7 +106,7 @@ ShaderDiskCache::ShaderDiskCache(bool separable) : separable{separable} {}
std::optional<std::vector<ShaderDiskCacheRaw>> ShaderDiskCache::LoadTransferable() {
const bool has_title_id = GetProgramID() != 0;
if (!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 {};
tried_to_load = true;