renderer: Add disable right eye performance hack

This commit is contained in:
PabloMK7
2024-11-14 20:11:58 +01:00
committed by OpenSauce04
parent 189dccda83
commit 758ded7fae
43 changed files with 590 additions and 168 deletions

View File

@@ -689,6 +689,7 @@ void QtConfig::ReadRendererValues() {
ReadGlobalSetting(Settings::values.texture_sampling);
ReadGlobalSetting(Settings::values.delay_game_render_thread_us);
ReadGlobalSetting(Settings::values.disable_right_eye_render);
if (global) {
ReadBasicSetting(Settings::values.use_shader_jit);
@@ -1220,6 +1221,7 @@ void QtConfig::SaveRendererValues() {
WriteGlobalSetting(Settings::values.texture_sampling);
WriteGlobalSetting(Settings::values.delay_game_render_thread_us);
WriteGlobalSetting(Settings::values.disable_right_eye_render);
if (global) {
WriteSetting(QStringLiteral("use_shader_jit"), Settings::values.use_shader_jit.GetValue(),

View File

@@ -66,6 +66,7 @@ void ConfigureEnhancements::SetConfiguration() {
ui->toggle_custom_textures->setChecked(Settings::values.custom_textures.GetValue());
ui->toggle_preload_textures->setChecked(Settings::values.preload_textures.GetValue());
ui->toggle_async_custom_loading->setChecked(Settings::values.async_custom_loading.GetValue());
ui->disable_right_eye_render->setChecked(Settings::values.disable_right_eye_render.GetValue());
}
void ConfigureEnhancements::updateShaders(Settings::StereoRenderOption stereo_option) {
@@ -120,6 +121,7 @@ void ConfigureEnhancements::ApplyConfiguration() {
Settings::values.pp_shader_name =
ui->shader_combobox->itemText(ui->shader_combobox->currentIndex()).toStdString();
}
Settings::values.disable_right_eye_render = ui->disable_right_eye_render->isChecked();
ConfigurationShared::ApplyPerGameSetting(&Settings::values.filter_mode,
ui->toggle_linear_filter, linear_filter);
@@ -133,6 +135,9 @@ void ConfigureEnhancements::ApplyConfiguration() {
ui->toggle_preload_textures, preload_textures);
ConfigurationShared::ApplyPerGameSetting(&Settings::values.async_custom_loading,
ui->toggle_async_custom_loading, async_custom_loading);
ConfigurationShared::ApplyPerGameSetting(&Settings::values.disable_right_eye_render,
ui->disable_right_eye_render,
disable_right_eye_render);
}
void ConfigureEnhancements::SetupPerGameUI() {
@@ -146,10 +151,15 @@ void ConfigureEnhancements::SetupPerGameUI() {
ui->toggle_preload_textures->setEnabled(Settings::values.preload_textures.UsingGlobal());
ui->toggle_async_custom_loading->setEnabled(
Settings::values.async_custom_loading.UsingGlobal());
ui->disable_right_eye_render->setEnabled(
Settings::values.disable_right_eye_render.UsingGlobal());
return;
}
ui->stereo_group->setVisible(false);
ui->render_3d_combobox->setEnabled(false);
ui->factor_3d->setEnabled(false);
ui->mono_rendering_eye->setEnabled(false);
ui->widget_shader->setVisible(false);
ConfigurationShared::SetColoredTristate(ui->toggle_linear_filter, Settings::values.filter_mode,
@@ -163,6 +173,9 @@ void ConfigureEnhancements::SetupPerGameUI() {
ConfigurationShared::SetColoredTristate(ui->toggle_async_custom_loading,
Settings::values.async_custom_loading,
async_custom_loading);
ConfigurationShared::SetColoredTristate(ui->disable_right_eye_render,
Settings::values.disable_right_eye_render,
disable_right_eye_render);
ConfigurationShared::SetColoredComboBox(
ui->resolution_factor_combobox, ui->widget_resolution,

View File

@@ -43,5 +43,6 @@ private:
ConfigurationShared::CheckState custom_textures;
ConfigurationShared::CheckState preload_textures;
ConfigurationShared::CheckState async_custom_loading;
ConfigurationShared::CheckState disable_right_eye_render;
QColor bg_color;
};

View File

@@ -310,6 +310,16 @@
</item>
</layout>
</item>
<item>
<widget class="QCheckBox" name="disable_right_eye_render">
<property name="text">
<string>Disable Right Eye Rendering</string>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Disable Right Eye Rendering&lt;/p&gt;&lt;p&gt;Disables rendering the right eye image when not using stereoscopic mode. Greatly improves performance in some games, but can cause flickering in others.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>

View File

@@ -23,6 +23,7 @@ ConfigureGraphics::ConfigureGraphics(QString gl_renderer, std::span<const QStrin
ui->physical_device_combo->setEnabled(!is_powered_on);
ui->toggle_async_shaders->setEnabled(!is_powered_on);
ui->toggle_async_present->setEnabled(!is_powered_on);
ui->toggle_accurate_mul->setEnabled(!is_powered_on);
// Set the index to -1 to ensure the below lambda is called with setCurrentIndex
ui->graphics_api_combo->setCurrentIndex(-1);