diff options
| author | 2019-04-19 21:02:46 -0400 | |
|---|---|---|
| committer | 2019-04-20 00:05:24 -0400 | |
| commit | 788497fd9d41bbfb82a1ac6816bee805a38e60cc (patch) | |
| tree | 29c3def5870dd2efc129f61d534e587a8d32e03a | |
| parent | Merge pull request #2415 from lioncash/const (diff) | |
| download | yuzu-788497fd9d41bbfb82a1ac6816bee805a38e60cc.tar.gz yuzu-788497fd9d41bbfb82a1ac6816bee805a38e60cc.tar.xz yuzu-788497fd9d41bbfb82a1ac6816bee805a38e60cc.zip | |
Allow picking a Compatibility Profile for OpenGL.
This option allows picking the compatibility profile since a lot of bugs
are fixed in it. We devs will use this option to easierly debug current
problems in our Core implementation.:wq
| -rw-r--r-- | src/core/settings.cpp | 1 | ||||
| -rw-r--r-- | src/core/settings.h | 1 | ||||
| -rw-r--r-- | src/yuzu/bootmanager.cpp | 6 | ||||
| -rw-r--r-- | src/yuzu/configuration/config.cpp | 3 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_graphics.cpp | 2 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_graphics.ui | 7 | ||||
| -rw-r--r-- | src/yuzu_cmd/config.cpp | 2 |
7 files changed, 21 insertions, 1 deletions
diff --git a/src/core/settings.cpp b/src/core/settings.cpp index 6d32ebea3..c1365879b 100644 --- a/src/core/settings.cpp +++ b/src/core/settings.cpp | |||
| @@ -90,6 +90,7 @@ void LogSettings() { | |||
| 90 | LogSetting("Renderer_UseResolutionFactor", Settings::values.resolution_factor); | 90 | LogSetting("Renderer_UseResolutionFactor", Settings::values.resolution_factor); |
| 91 | LogSetting("Renderer_UseFrameLimit", Settings::values.use_frame_limit); | 91 | LogSetting("Renderer_UseFrameLimit", Settings::values.use_frame_limit); |
| 92 | LogSetting("Renderer_FrameLimit", Settings::values.frame_limit); | 92 | LogSetting("Renderer_FrameLimit", Settings::values.frame_limit); |
| 93 | LogSetting("Renderer_UseCompatibilityProfile", Settings::values.use_compatibility_profile); | ||
| 93 | LogSetting("Renderer_UseDiskShaderCache", Settings::values.use_disk_shader_cache); | 94 | LogSetting("Renderer_UseDiskShaderCache", Settings::values.use_disk_shader_cache); |
| 94 | LogSetting("Renderer_UseAccurateGpuEmulation", Settings::values.use_accurate_gpu_emulation); | 95 | LogSetting("Renderer_UseAccurateGpuEmulation", Settings::values.use_accurate_gpu_emulation); |
| 95 | LogSetting("Renderer_UseAsynchronousGpuEmulation", | 96 | LogSetting("Renderer_UseAsynchronousGpuEmulation", |
diff --git a/src/core/settings.h b/src/core/settings.h index b84390745..5ff3634aa 100644 --- a/src/core/settings.h +++ b/src/core/settings.h | |||
| @@ -390,6 +390,7 @@ struct Values { | |||
| 390 | float resolution_factor; | 390 | float resolution_factor; |
| 391 | bool use_frame_limit; | 391 | bool use_frame_limit; |
| 392 | u16 frame_limit; | 392 | u16 frame_limit; |
| 393 | bool use_compatibility_profile; | ||
| 393 | bool use_disk_shader_cache; | 394 | bool use_disk_shader_cache; |
| 394 | bool use_accurate_gpu_emulation; | 395 | bool use_accurate_gpu_emulation; |
| 395 | bool use_asynchronous_gpu_emulation; | 396 | bool use_asynchronous_gpu_emulation; |
diff --git a/src/yuzu/bootmanager.cpp b/src/yuzu/bootmanager.cpp index 7eed9fcf3..5c98636c5 100644 --- a/src/yuzu/bootmanager.cpp +++ b/src/yuzu/bootmanager.cpp | |||
| @@ -377,7 +377,11 @@ void GRenderWindow::InitRenderTarget() { | |||
| 377 | // WA_DontShowOnScreen, WA_DeleteOnClose | 377 | // WA_DontShowOnScreen, WA_DeleteOnClose |
| 378 | QSurfaceFormat fmt; | 378 | QSurfaceFormat fmt; |
| 379 | fmt.setVersion(4, 3); | 379 | fmt.setVersion(4, 3); |
| 380 | fmt.setProfile(QSurfaceFormat::CoreProfile); | 380 | if (Settings::values.use_compatibility_profile) { |
| 381 | fmt.setProfile(QSurfaceFormat::CompatibilityProfile); | ||
| 382 | } else { | ||
| 383 | fmt.setProfile(QSurfaceFormat::CoreProfile); | ||
| 384 | } | ||
| 381 | // TODO: expose a setting for buffer value (ie default/single/double/triple) | 385 | // TODO: expose a setting for buffer value (ie default/single/double/triple) |
| 382 | fmt.setSwapBehavior(QSurfaceFormat::DefaultSwapBehavior); | 386 | fmt.setSwapBehavior(QSurfaceFormat::DefaultSwapBehavior); |
| 383 | shared_context = std::make_unique<QOpenGLContext>(); | 387 | shared_context = std::make_unique<QOpenGLContext>(); |
diff --git a/src/yuzu/configuration/config.cpp b/src/yuzu/configuration/config.cpp index 8725a78dc..6c6f047d8 100644 --- a/src/yuzu/configuration/config.cpp +++ b/src/yuzu/configuration/config.cpp | |||
| @@ -389,6 +389,8 @@ void Config::ReadValues() { | |||
| 389 | Settings::values.resolution_factor = ReadSetting("resolution_factor", 1.0).toFloat(); | 389 | Settings::values.resolution_factor = ReadSetting("resolution_factor", 1.0).toFloat(); |
| 390 | Settings::values.use_frame_limit = ReadSetting("use_frame_limit", true).toBool(); | 390 | Settings::values.use_frame_limit = ReadSetting("use_frame_limit", true).toBool(); |
| 391 | Settings::values.frame_limit = ReadSetting("frame_limit", 100).toInt(); | 391 | Settings::values.frame_limit = ReadSetting("frame_limit", 100).toInt(); |
| 392 | Settings::values.use_compatibility_profile = | ||
| 393 | ReadSetting("use_compatibility_profile", true).toBool(); | ||
| 392 | Settings::values.use_disk_shader_cache = ReadSetting("use_disk_shader_cache", true).toBool(); | 394 | Settings::values.use_disk_shader_cache = ReadSetting("use_disk_shader_cache", true).toBool(); |
| 393 | Settings::values.use_accurate_gpu_emulation = | 395 | Settings::values.use_accurate_gpu_emulation = |
| 394 | ReadSetting("use_accurate_gpu_emulation", false).toBool(); | 396 | ReadSetting("use_accurate_gpu_emulation", false).toBool(); |
| @@ -661,6 +663,7 @@ void Config::SaveValues() { | |||
| 661 | WriteSetting("resolution_factor", (double)Settings::values.resolution_factor, 1.0); | 663 | WriteSetting("resolution_factor", (double)Settings::values.resolution_factor, 1.0); |
| 662 | WriteSetting("use_frame_limit", Settings::values.use_frame_limit, true); | 664 | WriteSetting("use_frame_limit", Settings::values.use_frame_limit, true); |
| 663 | WriteSetting("frame_limit", Settings::values.frame_limit, 100); | 665 | WriteSetting("frame_limit", Settings::values.frame_limit, 100); |
| 666 | WriteSetting("use_compatibility_profile", Settings::values.use_compatibility_profile, true); | ||
| 664 | WriteSetting("use_disk_shader_cache", Settings::values.use_disk_shader_cache, true); | 667 | WriteSetting("use_disk_shader_cache", Settings::values.use_disk_shader_cache, true); |
| 665 | WriteSetting("use_accurate_gpu_emulation", Settings::values.use_accurate_gpu_emulation, false); | 668 | WriteSetting("use_accurate_gpu_emulation", Settings::values.use_accurate_gpu_emulation, false); |
| 666 | WriteSetting("use_asynchronous_gpu_emulation", Settings::values.use_asynchronous_gpu_emulation, | 669 | WriteSetting("use_asynchronous_gpu_emulation", Settings::values.use_asynchronous_gpu_emulation, |
diff --git a/src/yuzu/configuration/configure_graphics.cpp b/src/yuzu/configuration/configure_graphics.cpp index 0a9883d37..c299c0b5b 100644 --- a/src/yuzu/configuration/configure_graphics.cpp +++ b/src/yuzu/configuration/configure_graphics.cpp | |||
| @@ -73,6 +73,7 @@ void ConfigureGraphics::setConfiguration() { | |||
| 73 | static_cast<int>(FromResolutionFactor(Settings::values.resolution_factor))); | 73 | static_cast<int>(FromResolutionFactor(Settings::values.resolution_factor))); |
| 74 | ui->toggle_frame_limit->setChecked(Settings::values.use_frame_limit); | 74 | ui->toggle_frame_limit->setChecked(Settings::values.use_frame_limit); |
| 75 | ui->frame_limit->setValue(Settings::values.frame_limit); | 75 | ui->frame_limit->setValue(Settings::values.frame_limit); |
| 76 | ui->use_compatibility_profile->setChecked(Settings::values.use_compatibility_profile); | ||
| 76 | ui->use_disk_shader_cache->setChecked(Settings::values.use_disk_shader_cache); | 77 | ui->use_disk_shader_cache->setChecked(Settings::values.use_disk_shader_cache); |
| 77 | ui->use_accurate_gpu_emulation->setChecked(Settings::values.use_accurate_gpu_emulation); | 78 | ui->use_accurate_gpu_emulation->setChecked(Settings::values.use_accurate_gpu_emulation); |
| 78 | ui->use_asynchronous_gpu_emulation->setEnabled(!Core::System::GetInstance().IsPoweredOn()); | 79 | ui->use_asynchronous_gpu_emulation->setEnabled(!Core::System::GetInstance().IsPoweredOn()); |
| @@ -88,6 +89,7 @@ void ConfigureGraphics::applyConfiguration() { | |||
| 88 | ToResolutionFactor(static_cast<Resolution>(ui->resolution_factor_combobox->currentIndex())); | 89 | ToResolutionFactor(static_cast<Resolution>(ui->resolution_factor_combobox->currentIndex())); |
| 89 | Settings::values.use_frame_limit = ui->toggle_frame_limit->isChecked(); | 90 | Settings::values.use_frame_limit = ui->toggle_frame_limit->isChecked(); |
| 90 | Settings::values.frame_limit = ui->frame_limit->value(); | 91 | Settings::values.frame_limit = ui->frame_limit->value(); |
| 92 | Settings::values.use_compatibility_profile = ui->use_compatibility_profile->isChecked(); | ||
| 91 | Settings::values.use_disk_shader_cache = ui->use_disk_shader_cache->isChecked(); | 93 | Settings::values.use_disk_shader_cache = ui->use_disk_shader_cache->isChecked(); |
| 92 | Settings::values.use_accurate_gpu_emulation = ui->use_accurate_gpu_emulation->isChecked(); | 94 | Settings::values.use_accurate_gpu_emulation = ui->use_accurate_gpu_emulation->isChecked(); |
| 93 | Settings::values.use_asynchronous_gpu_emulation = | 95 | Settings::values.use_asynchronous_gpu_emulation = |
diff --git a/src/yuzu/configuration/configure_graphics.ui b/src/yuzu/configuration/configure_graphics.ui index 15ab18ecd..0f6f6c003 100644 --- a/src/yuzu/configuration/configure_graphics.ui +++ b/src/yuzu/configuration/configure_graphics.ui | |||
| @@ -50,6 +50,13 @@ | |||
| 50 | </layout> | 50 | </layout> |
| 51 | </item> | 51 | </item> |
| 52 | <item> | 52 | <item> |
| 53 | <widget class="QCheckBox" name="use_compatibility_profile"> | ||
| 54 | <property name="text"> | ||
| 55 | <string>Use OpenGL compatibility profile</string> | ||
| 56 | </property> | ||
| 57 | </widget> | ||
| 58 | </item> | ||
| 59 | <item> | ||
| 53 | <widget class="QCheckBox" name="use_disk_shader_cache"> | 60 | <widget class="QCheckBox" name="use_disk_shader_cache"> |
| 54 | <property name="text"> | 61 | <property name="text"> |
| 55 | <string>Use disk shader cache</string> | 62 | <string>Use disk shader cache</string> |
diff --git a/src/yuzu_cmd/config.cpp b/src/yuzu_cmd/config.cpp index f24cc77fe..d0ae058fd 100644 --- a/src/yuzu_cmd/config.cpp +++ b/src/yuzu_cmd/config.cpp | |||
| @@ -349,6 +349,8 @@ void Config::ReadValues() { | |||
| 349 | Settings::values.use_frame_limit = sdl2_config->GetBoolean("Renderer", "use_frame_limit", true); | 349 | Settings::values.use_frame_limit = sdl2_config->GetBoolean("Renderer", "use_frame_limit", true); |
| 350 | Settings::values.frame_limit = | 350 | Settings::values.frame_limit = |
| 351 | static_cast<u16>(sdl2_config->GetInteger("Renderer", "frame_limit", 100)); | 351 | static_cast<u16>(sdl2_config->GetInteger("Renderer", "frame_limit", 100)); |
| 352 | Settings::values.use_compatibility_profile = | ||
| 353 | sdl2_config->GetBoolean("Renderer", "use_compatibility_profile", true); | ||
| 352 | Settings::values.use_disk_shader_cache = | 354 | Settings::values.use_disk_shader_cache = |
| 353 | sdl2_config->GetBoolean("Renderer", "use_disk_shader_cache", false); | 355 | sdl2_config->GetBoolean("Renderer", "use_disk_shader_cache", false); |
| 354 | Settings::values.use_accurate_gpu_emulation = | 356 | Settings::values.use_accurate_gpu_emulation = |